| XQUERY/XSLT API DOCUMENTATION 4.2 |
All XQuery & XSLT Functions MarkLogic Built-In Functions Admin (xdmp:) AppServer (xdmp:) Classifier (cts:) Debug (dbg:) Document Conversion (xdmp:) Extension (xdmp:) Documents, Directories, Properties, and Locks Functions Extension Functions Function Values Functions HTTP Functions JSON Functions MarkLogic Server Functions Search Functions XML Functions XQuery Context Functions XSLT Functions map (map:) Math (math:) Profile (prof:) Search (cts:) cts:query Constructors Functions Geospatial Functions Geospatial Lexicon Functions Lexicon Functions Search Functions Search Clustering Functions Security (xdmp:) Server Monitoring (xdmp:) Spell (spell:) Update (xdmp:) XQuery Library Modules Admin Library (admin:) Actions Functions Appserver Functions Database Functions Forest Functions Group Functions Host Functions Mimetypes Functions Scheduler Functions Alerting (alert:) Elastic Compute Cloud (ec2:) Entity Enrichment (entity:) Flexible Replication (flexrep:) Geospatial Supporting Functions GEO Functions GeoRSS Functions GML Functions KML Functions MCGM Functions Information Studio (info:) Information Studio Developer (infodev:) Library Services (dls:) cts:query Constructor Functions Document Management Functions Document Update Functions Retention Policy Functions XInclude Functions Modular Documents XInclude Functions XPointer Functions PKI (pki:) Plugin (plugin:) Search (search:) Security-sec (sec:) Spelling Dictionary Management (spell:) Thesaurus (thsr:) Triggers (trgr:) Triggers Library (trgr:) WordProcessingML (ooxml:) ZIP Package (ooxml:) CPF Functions Content Processing Framework (cpf:) CSS Conversion (css:) DocBook Conversion (dbk:) Domains (dom:) Excel Conversion (excel:) Generic Conversion (cvt:) Links (lnk:) MSWord Conversion (msword:) PDF Conversion (pdf:) Pipelines (p:) Powerpoint Conversion (ppt:) XHTML Conversion (xhtml:) W3C-Standard Functions Accessor (fn:) AnyURI (fn:) Boolean (fn:) Context (fn:) DurationDateTime (fn:) Error and Trace (fn:) Node (fn:) Numeric (fn:) QName (fn:) Sequence (fn:) String (fn:) XSLT (fn:) W3C XQuery/XSLT Reference W3C XQuery Functions W3C XQuery Language W3C XSLT Language
This page was generated September 12, 2012 6:02 AM | XQuery & XSLT Built-In & Modules Function Reference
Module: Library Services - cts:query Constructor Functions
Functions to return `cts:query` constructors.
Function Summary
dls:as-of-query | This function returns a query that matches the most recent numbered version of documents that were created before the specified date and time.
dls:author-query | This function returns a query that matches documents authored by the specified user.
dls:document-include-query | This function returns a query that matches any managed document that has an XInclude link that exactly matches the specified URI.
dls:document-version-query | This function returns a query that matches the specified version of the managed documents.
dls:document-versions-query | This function returns a query that matches any version of the specified URI.
dls:documents-query | This function returns a query that matches the latest versions of the managed documents in the database.
Function Detail
dls:as-of-query(
| $when as xs:dateTime
) as cts:properties-query
Summary: This function returns a query that matches the most recent numbered version of documents that were created before the specified date and time.
Parameters:
$when : The date and time before which the documents were created.
Required Privilege: The `dls-user` role is required to run this function, or the privilege: `http://marklogic.com/xdmp/privileges/dls-user`
Example:
      xquery version "1.0-ml";

      import module namespace dls = "http://marklogic.com/xdmp/dls"
          at "/MarkLogic/dls.xqy";

      cts:search(fn:doc(), dls:as-of-query(xs:dateTime(fn:current-dateTime())))

      (: Returns the versions of the managed documents that were created before the
         specified date and time. :)
dls:author-query(
| $author as xs:unsignedLong
) as cts:properties-query
Summary: This function returns a query that matches documents authored by the specified user.
Parameters:
$author : The id of the user who authored the documents.
Required Privilege: The `dls-user` role is required to run this function, or the privilege: `http://marklogic.com/xdmp/privileges/dls-user`
Example:
      xquery version "1.0-ml";

      import module namespace dls = "http://marklogic.com/xdmp/dls"
          at "/MarkLogic/dls.xqy";

      cts:search(fn:doc(), dls:author-query(xdmp:user("Jim")))

      (: Returns all of the documents authored by 'Jim'. :)
dls:document-include-query(
| $uri as xs:string
) as cts:query
Summary: This function returns a query that matches any managed document that has an XInclude link that exactly matches the specified URI.
Parameters:
$uri : The URI of the linked-to document.
Required Privilege: The `dls-user` role is required to run this function, or the privilege: `http://marklogic.com/xdmp/privileges/dls-user`
Example:
      xquery version "1.0-ml";

      import module namespace dls = "http://marklogic.com/xdmp/dls"
          at "/MarkLogic/dls.xqy";

      cts:search(fn:doc(), dls:document-include-query("/foo.xml"))

      (: Returns the contents of the documents that contain an XInclude to the
         '/foo.xml' document. :)
dls:document-version-query(
| $version as xs:unsignedLong
) as cts:properties-query
Summary: This function returns a query that matches the specified version of the managed documents.
Parameters:
$version : The version of the managed documents.
Required Privilege: The `dls-user` role is required to run this function, or the privilege: `http://marklogic.com/xdmp/privileges/dls-user`
Example:
      xquery version "1.0-ml";

      import module namespace dls = "http://marklogic.com/xdmp/dls"
          at "/MarkLogic/dls.xqy";

      cts:search(fn:doc(), dls:document-version-query(3))

      (: Returns Version 3 of all of the managed documents in the database. :)
dls:document-versions-query(
| $uri as xs:string
) as cts:properties-query
Summary: This function returns a query that matches any version of the specified URI. If the URI contains either of the wildcard characters '?' or '*', then the search is wildcarded. Specifying '*' matches any numbered version of any managed document.
Parameters:
$uri : The URI of the document.
Required Privilege: The `dls-user` role is required to run this function, or the privilege: `http://marklogic.com/xdmp/privileges/dls-user`
Example:
      xquery version "1.0-ml";

      import module namespace dls = "http://marklogic.com/xdmp/dls"
          at "/MarkLogic/dls.xqy";

      cts:search(fn:doc(), dls:document-versions-query("/foo/bar/baz.xml"))

      (: Returns the contents of all versions of the 'baz.xml' document. :)
dls:documents-query( ) as cts:properties-query
Summary: This function returns a query that matches the latest versions of the managed documents in the database.
Required Privilege: The `dls-user` role is required to run this function, or the privilege: `http://marklogic.com/xdmp/privileges/dls-user`
Example:
      xquery version "1.0-ml";

      import module namespace dls = "http://marklogic.com/xdmp/dls"
          at "/MarkLogic/dls.xqy";

      cts:search(fn:doc(), dls:documents-query())

      (: Returns the latest versions of the managed documents in the database. :)

© Copyright 2002-2012 MarkLogic Corporation. All rights reserved.