MarkLogic 12 EA 1 Product Documentation
temporal.documentPeriod

temporal.documentPeriod(
   temporal-collection as String,
   axis as String,
   root as Node
) as Sequence

Summary

This function returns the period (as a dateTime pair) for the named axis in the document identified by its root node in the named collection.

An TEMPORAL-NOAXISINFO exception is thrown if no information is found in root for the axis.

Parameters
temporal-collection The name of the temporal collection.
axis The name of axis from which to get the period.
root The root node of the document.

Example

const temporal = require("/MarkLogic/temporal.xqy");
temporal.documentPeriod("temporal", "valid", 
  cts.doc("clue.xml.7788866244426452375"));

=> Returns the period for the valid axis set for the document, 
   "clue.xml.7788866244426452375". 

Powered by MarkLogic Server | Terms of Use | Privacy Policy