Loading TOC...


   $templates as element(tde:template)*,
   [$excludeTemplateURIs as xs:string*]
) as map:map


In addition to xdmp:validate that can be used for validating against the extraction template schema.

The recommended workflow for users is to validate an extraction template before inserting it into the schema database. Unless you use the tde:template-insert function, Ill-formed templates are not validated or rejected at document insertion time.

For more information on extraction templates, see Template Driven Extraction (TDE) in the Application Developer's Guide.

$templates The templates to validate.
$excludeTemplateURIs A sequence of URIs for stored templates to ignore during the validation. When a template is being updated, users can exclude a previous version of the template that might conflict with the version passed to tde:validate.

Usage Notes

The tde:validate function enables users to do the following:


xquery version "1.0-ml";

let $t1:=
<template xmlns="http://marklogic.com/xdmp/tde">

return tde:validate(($t1),("previous_version_of_t1.xml"))


<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="valid">
    <map:value xsi:type="xs:boolean">false</map:value>
  <map:entry key="error">
    <map:value xsi:type="xs:string">TDE-INVALIDTEMPLATENODE</map:value>
  <map:entry key="message">
    <map:value xsi:type="xs:string">TDE-INVALIDTEMPLATENODE: Invalid extraction template node: /tde:template/tde:rows/tde:row/tde:columns/tde:column/tde:scalar-type</map:value>

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