Loading TOC...


   $template-infos as map:map*
) as empty-sequence()


This function validates and inserts multiple templates, is similar to tde:template-insert for individual template, throw errors for any invalid template or duplicate template URIs provided by sequence of argument with tde:template-info .

Before inserting, validates each new template against all other new and existing (not in the new URIs list) templates with same schema/view-name. Any existing template with the same URI in the new URIs list will be ignored and replaced directly even if the new template has same URI but different schema/view-name.

template-infos A sequence of maps that specify the template information (URI, template, permissions, collections) to apply as produced by tde:template-info .

Usage Notes

The tde-admin role is required in order to insert templates 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">
  <description>populates patients' data</description>

return tde:template-batch-insert(
         ( tde:template-info("t1.xml",$t1),

(: Inserts 3 templates as t1.xml, t2.xml, t3.xml files. :)

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