Loading TOC...

MarkLogic 9 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

var 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". 

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.