<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/temporal.axisCreate.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>temporal.axisCreate</api:function-name><api:suggest>temporal.axiscreate</api:suggest><api:suggest>temporal</api:suggest><api:suggest>axiscreate</api:suggest><api:function-link mode="xquery" fullname="temporal:axis-create">/apidoc/8.0/temporal:axis-create.xml</api:function-link><api:function mode="javascript" name="axisCreate" lib="temporal" category="Temporal" hidden="false" bucket="MarkLogic Built-In Functions" prefix="temporal" namespace="http://marklogic.com/xdmp/temporal" fullname="temporal.axisCreate"><api:summary>
  This function constructs an axis definition based on the existing range indexes that can be 
  added to a collection in subsequent API calls. The axis definition is stored in the schema
  database.
  <p xmlns="http://www.w3.org/1999/xhtml">
  For details on how to create an axis, see  
 <a href="/guide/temporal/temporal-quick-start#id_75804">Create System and Valid Axes</a> in the <em>Temporal Developer's Guide</em>
  </p><p xmlns="http://www.w3.org/1999/xhtml">   
  A TEMPORAL-NONDATETIME exception is thrown if range index scalar type is not dateTime.
  A TEMPORAL-DUPAXIS exception is thrown if the axis already exists.
  </p>
  </api:summary><api:params><api:param name="axis-name" type="xs:string"><api:param-description>
    The name to be used to identify the axis. 
    </api:param-description><api:param-name>axis-name</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="start-range-index" type="cts:reference"><api:param-description>
    A reference to a range index to be used as the start of the time period.
    </api:param-description><api:param-name>start-range-index</api:param-name><api:param-type>cts.reference</api:param-type></api:param><api:param name="end-range-index" type="cts:reference"><api:param-description>
    A reference to a range index to be used as the end of the time period.
    </api:param-description><api:param-name>end-range-index</api:param-name><api:param-type>cts.reference</api:param-type></api:param></api:params><api:return>String</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
var temporal = require("/MarkLogic/temporal.xqy");

temporal.axisRemove("system");
temporal.axisRemove("valid");
var output = new Array();
output.push(
  temporal.axisCreate(
   "system",
   cts.elementReference(xs.QName("systemStart")),
   cts.elementReference(xs.QName("systemEnd"))) 
  );

output.push(
  temporal.axisCreate(
   "valid",
   cts.elementReference(xs.QName("validStart")),
   cts.elementReference(xs.QName("validEnd"))) 
  );
output;

// First removes, then creates two axes, named "system" and "valid",
// from the element range indexes, "systemStart", "systemEnd",
// "validStart", and "validEnd".  Then it returns the IDs of the
// new axes.
</pre></api:example></api:function></api:function-page>