tde:template-info( $uri as xs:string, $root as node(), [$permissions as element(sec:permission)*], [$collections as xs:string*] ) as map:map
This function returns a map:map (object[]) containing individual template information used for inserting templates with tde:template-batch-insert(). Permissions and collections are optional. If no permissions specified, xdmp:default-permissions() is the default.
tde-admin
role is required in order to insert a template into the
schema database.
Note that this is a library function
that requires that you import the tde.xqy
module.
xquery version "1.0-ml"; import module "http://marklogic.com/xdmp/tde" at "/MarkLogic/tde.xqy"; let $t1 := <template xmlns="http://marklogic.com/xdmp/tde"> ... </template> return tde:template-info("t1.xml", $t1), (: or with permissions and collections tde:template-info("t1.xml",$t1,(xdmp:permission("role1","update")),("collectionA")) :) => <map:map xmlns:map="http://marklogic.com/xdmp/map" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <map:entry key="uri"><map:value xsi:type="xs:string">t1.xml</map:value></map:entry> <map:entry key="template"><map:value> <template xmlns="http://marklogic.com/xdmp/tde"> ... </template></map:value></map:entry> </map:map>
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.