<?xml version="1.0" encoding="UTF-8"?><chapter xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="variables-keys-functions-and-templates"><title>TAN variables, keys, functions, and templates</title><para>The 87 global variables, 5 keys, 121 functions, and 57 templates (Ŧ = named template; ŧ = template mode) defined in the TAN function library, are the following (ʞ = key):</para><para>ŧ #all </para>
<para><code><link linkend="function-aaa-to-int">tan:aaa-to-int</link></code>() <code><link linkend="template-add-square-brackets">ŧ add-square-brackets</link></code> <code><link linkend="variable-all-functions">$all-functions</link></code> <code><link linkend="variable-all-head-iris">$all-head-iris</link></code> <code><link linkend="variable-all-ids">$all-ids</link></code> <code><link linkend="variable-all-keywords">$all-keywords</link></code> <code><link linkend="variable-alphabet-numeral-key">$alphabet-numeral-key</link></code> <code><link linkend="function-analyze-leaf-div-string-length">tan:analyze-leaf-div-string-length</link></code>() <code><link linkend="function-analyze-leaf-div-text-length-loop">tan:analyze-leaf-div-text-length-loop</link></code>() <code><link linkend="function-analyze-numbers-in-string">tan:analyze-numbers-in-string</link></code>() <code><link linkend="function-analyze-ref-loop">tan:analyze-ref-loop</link></code>() <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link></code>() <code><link linkend="function-analyze-stats">tan:analyze-stats</link></code>() <code><link linkend="function-analyze-string-length">tan:analyze-string-length</link></code>() <code><link linkend="template-analyze-string-length-pass-1">ŧ analyze-string-length-pass-1</link></code> <code><link linkend="template-analyze-string-length-pass-2">ŧ analyze-string-length-pass-2</link></code> <code><link linkend="variable-apos">$apos</link></code> <code><link linkend="function-ara-to-int">tan:ara-to-int</link></code>() <code><link linkend="variable-arabic-indic-numeral-pattern">$arabic-indic-numeral-pattern</link></code> <code><link linkend="function-atomize-string">tan:atomize-string</link></code>() <code><link linkend="variable-attributes-that-take-non-arabic-numerals">$attributes-that-take-non-arabic-numerals</link></code> </para>
<para><code><link linkend="function-base-uri">tan:base-uri</link></code>() <code><link linkend="function-batch-replace">tan:batch-replace</link></code>() <code><link linkend="function-blob-to-regex">tan:blob-to-regex</link></code>() <code><link linkend="variable-body">$body</link></code> </para>
<para><code><link linkend="template-catalog-expansion-terse">ŧ catalog-expansion-terse</link></code> <code><link linkend="function-cfn">tan:cfn</link></code>() <code><link linkend="variable-char-reg-exp">$char-reg-exp</link></code> <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code> <code><link linkend="function-chop-string">tan:chop-string</link></code>() <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-class-2-expansion-normal">ŧ class-2-expansion-normal</link></code> <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code> <code><link linkend="template-class-2-expansion-terse-pass-2">ŧ class-2-expansion-terse-pass-2</link></code> <code><link linkend="template-class-2-expansion-verbose">ŧ class-2-expansion-verbose</link></code> <code><link linkend="function-class-number">tan:class-number</link></code>() <code><link linkend="function-codepoints-to-string">tan:codepoints-to-string</link></code>() <code><link linkend="function-collate">tan:collate</link></code>() <code><link linkend="function-collate-loop-inner">tan:collate-loop-inner</link></code>() <code><link linkend="function-collate-loop-outer">tan:collate-loop-outer</link></code>() <code><link linkend="function-condition-evaluation-loop">tan:condition-evaluation-loop</link></code>() <code><link linkend="function-conditions-hold">tan:conditions-hold</link></code>() <code><link linkend="function-copy-of">tan:copy-of</link></code>() <code><link linkend="function-copy-of-except">tan:copy-of-except</link></code>() <code><link linkend="template-copy-of-except">ŧ copy-of-except</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse-alias">ŧ core-expansion-terse-alias</link></code> <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code> <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code> <code><link linkend="template-core-resolution-arabic-numerals">ŧ core-resolution-arabic-numerals</link></code> <code><link linkend="function-counts-to-firsts">tan:counts-to-firsts</link></code>() <code><link linkend="function-counts-to-lasts">tan:counts-to-lasts</link></code>() </para>
<para><code><link linkend="function-data-type-check">tan:data-type-check</link></code>() <code><link linkend="function-dateTime-to-decimal">tan:dateTime-to-decimal</link></code>() <code><link linkend="function-dec-to-hex">tan:dec-to-hex</link></code>() <code><link linkend="function-definition">tan:definition</link></code>() <code><link linkend="template-dependencies-tokenized-selectively">ŧ dependencies-tokenized-selectively</link></code> <code><link linkend="template-dependency-expansion-normal">ŧ dependency-expansion-normal</link></code> <code><link linkend="template-dependency-expansion-terse">ŧ dependency-expansion-terse</link></code> <code><link linkend="template-dependency-expansion-terse-no-alter">ŧ dependency-expansion-terse-no-alter</link></code> <code><link linkend="template-dependency-expansion-verbose">ŧ dependency-expansion-verbose</link></code> <code><link linkend="variable-dhy">$dhy</link></code> <code><link linkend="function-diff">tan:diff</link></code>() <code><link linkend="function-diff-loop">tan:diff-loop</link></code>() <code><link linkend="template-diff-to-collation">ŧ diff-to-collation</link></code> <code><link linkend="function-distinct-items">tan:distinct-items</link></code>() <code><link linkend="function-div-to-div-transfer">tan:div-to-div-transfer</link></code>() <code><link linkend="key-div-via-orig-ref">ʞ div-via-orig-ref</link></code>') <code><link linkend="key-div-via-ref">ʞ div-via-ref</link></code>') <code><link linkend="template-divs-excluding-what-qs">ŧ divs-excluding-what-qs</link></code> <code><link linkend="variable-doc-class">$doc-class</link></code> <code><link linkend="variable-doc-id">$doc-id</link></code> <code><link linkend="variable-doc-namespace">$doc-namespace</link></code> <code><link linkend="variable-doc-parent-directory">$doc-parent-directory</link></code> <code><link linkend="variable-doc-type">$doc-type</link></code> <code><link linkend="variable-doc-uri">$doc-uri</link></code> <code><link linkend="variable-duplicate-head-iris">$duplicate-head-iris</link></code> <code><link linkend="variable-duplicate-ids">$duplicate-ids</link></code> <code><link linkend="function-duplicate-items">tan:duplicate-items</link></code>() </para>
<para><code><link linkend="template-element-to-error">ŧ element-to-error</link></code> <code><link linkend="variable-elements-that-must-always-refer-to-tan-files">$elements-that-must-always-refer-to-tan-files</link></code> <code><link linkend="variable-elements-that-refer-to-textual-items">$elements-that-refer-to-textual-items</link></code> <code><link linkend="variable-empty-doc">$empty-doc</link></code> <code><link linkend="variable-empty-element">$empty-element</link></code> <code><link linkend="variable-erroneously-looped-doc">$erroneously-looped-doc</link></code> <code><link linkend="function-error">tan:error</link></code>() <code><link linkend="function-error-report">tan:error-report</link></code>() <code><link linkend="variable-errors">$errors</link></code> <code><link linkend="function-errors-checked-where">tan:errors-checked-where</link></code>() <code><link linkend="variable-errors-to-squelch">$errors-to-squelch</link></code> <code><link linkend="function-escape">tan:escape</link></code>() <code><link linkend="function-evaluate">tan:evaluate</link></code>() <code><link linkend="template-evaluate-conditions">ŧ evaluate-conditions</link></code> <code><link linkend="function-expand-doc">tan:expand-doc</link></code>() <code><link linkend="function-expand-numerical-sequence">tan:expand-numerical-sequence</link></code>() <code><link linkend="function-expand-pos-or-chars">tan:expand-pos-or-chars</link></code>() <code><link linkend="function-expand-search">tan:expand-search</link></code>() <code><link linkend="template-expand-tan-key-dependencies">ŧ expand-tan-key-dependencies</link></code> </para>
<para><code><link linkend="function-feature-test-to-groups">tan:feature-test-to-groups</link></code>() <code><link linkend="function-first-loc-available">tan:first-loc-available</link></code>() <code><link linkend="template-first-stamp">ŧ first-stamp</link></code> <code><link linkend="function-fix">tan:fix</link></code>() <code><link linkend="template-fragment-to-text">ŧ fragment-to-text</link></code> </para>
<para><code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code>() <code><link linkend="function-get-doc-hist">tan:get-doc-hist</link></code>() <code><link linkend="function-get-parent-elements">tan:get-parent-elements</link></code>() <code><link linkend="function-get-ucd-decomp">tan:get-ucd-decomp</link></code>() <code><link linkend="function-get-via-q-ref">tan:get-via-q-ref</link></code>() <code><link linkend="function-glossary">tan:glossary</link></code>() <code><link linkend="function-grc-to-int">tan:grc-to-int</link></code>() <code><link linkend="variable-greek-letter-numeral-pattern">$greek-letter-numeral-pattern</link></code> <code><link linkend="function-group-adjacent-elements">tan:group-adjacent-elements</link></code>() <code><link linkend="function-group-elements">tan:group-elements</link></code>() <code><link linkend="function-group-elements-by-shared-node-values">tan:group-elements-by-shared-node-values</link></code>() <code><link linkend="function-group-elements-by-shared-node-values-loop">tan:group-elements-by-shared-node-values-loop</link></code>() </para>
<para><code><link linkend="variable-head">$head</link></code> <code><link linkend="function-help">tan:help</link></code>() <code><link linkend="function-help-extracted">tan:help-extracted</link></code>() <code><link linkend="function-help-or-info">tan:help-or-info</link></code>() <code><link linkend="variable-help-trigger-regex">$help-trigger-regex</link></code> <code><link linkend="variable-hex-key">$hex-key</link></code> <code><link linkend="function-hex-to-dec">tan:hex-to-dec</link></code>() </para>
<para><code><link linkend="variable-id-idrefs">$id-idrefs</link></code> <code><link linkend="variable-inclusions-1st-da">$inclusions-1st-da</link></code> <code><link linkend="variable-inclusions-resolved">$inclusions-resolved</link></code> <code><link linkend="function-info">tan:info</link></code>() <code><link linkend="function-infuse-divs">tan:infuse-divs</link></code>() <code><link linkend="template-infuse-tokenized-div">ŧ infuse-tokenized-div</link></code> <code><link linkend="template-infuse-tokenized-text">ŧ infuse-tokenized-text</link></code> <code><link linkend="key-item-via-node-name">ʞ item-via-node-name</link></code>') </para>
<para><code><link linkend="variable-keys-1st-da">$keys-1st-da</link></code> <code><link linkend="variable-keys-expanded">$keys-expanded</link></code> <code><link linkend="variable-keys-resolved">$keys-resolved</link></code> </para>
<para><code><link linkend="variable-latin-letter-numeral-pattern">$latin-letter-numeral-pattern</link></code> <code><link linkend="function-letter-to-number">tan:letter-to-number</link></code>() </para>
<para><code><link linkend="function-matches">tan:matches</link></code>() <code><link linkend="function-median">tan:median</link></code>() <code><link linkend="function-merge-analyzed-stats">tan:merge-analyzed-stats</link></code>() <code><link linkend="function-merge-divs">tan:merge-divs</link></code>() <code><link linkend="template-merge-divs">ŧ merge-divs</link></code> <code><link linkend="function-merge-expanded-docs">tan:merge-expanded-docs</link></code>() <code><link linkend="template-merge-expanded-docs-prep">ŧ merge-expanded-docs-prep</link></code> <code><link linkend="variable-morphologies-1st-da">$morphologies-1st-da</link></code> <code><link linkend="variable-morphologies-expanded">$morphologies-expanded</link></code> <code><link linkend="variable-morphologies-resolved">$morphologies-resolved</link></code> <code><link linkend="function-most-common-item">tan:most-common-item</link></code>() <code><link linkend="function-most-recent-dateTime">tan:most-recent-dateTime</link></code>() <code><link linkend="function-must-refer-to-external-tan-file">tan:must-refer-to-external-tan-file</link></code>() </para>
<para><code><link linkend="variable-n-type">$n-type</link></code> <code><link linkend="variable-n-type-label">$n-type-label</link></code> <code><link linkend="variable-n-type-pattern">$n-type-pattern</link></code> <code><link linkend="function-namespace">tan:namespace</link></code>() <code><link linkend="variable-namespaces-and-prefixes">$namespaces-and-prefixes</link></code> <code><link linkend="template-no-misfit-divs-or-anchors">ŧ no-misfit-divs-or-anchors</link></code> <code><link linkend="function-no-outliers">tan:no-outliers</link></code>() <code><link linkend="variable-nonlatin-letter-numeral-pattern">$nonlatin-letter-numeral-pattern</link></code> <code><link linkend="function-normalize-div-text">tan:normalize-div-text</link></code>() <code><link linkend="function-normalize-sequence">tan:normalize-sequence</link></code>() <code><link linkend="template-normalize-tei-space">ŧ normalize-tei-space</link></code> <code><link linkend="function-normalize-text">tan:normalize-text</link></code>() <code><link linkend="function-normalize-xml-element-space">tan:normalize-xml-element-space</link></code>() <code><link linkend="template-normalize-xml-fragment-space">ŧ normalize-xml-fragment-space</link></code> <code><link linkend="variable-now">$now</link></code> <code><link linkend="function-number-sort">tan:number-sort</link></code>() </para>
<para><code><link linkend="variable-official-urn-namespaces">$official-urn-namespaces</link></code> <code><link linkend="template-only-misfit-divs">ŧ only-misfit-divs</link></code> <code><link linkend="template-only-misfit-divs-and-anchors">ŧ only-misfit-divs-and-anchors</link></code> <code><link linkend="function-ordinal">tan:ordinal</link></code>() <code><link linkend="variable-orig-self">$orig-self</link></code> <code><link linkend="function-outliers">tan:outliers</link></code>() </para>
<para><code><link linkend="function-pluck">tan:pluck</link></code>() <code><link linkend="template-pluck">ŧ pluck</link></code> <code><link linkend="function-possible-bibliography-id">tan:possible-bibliography-id</link></code>() <code><link linkend="template-prep-regex-char-class">ŧ prep-regex-char-class</link></code> <code><link linkend="function-prepend-id-or-idrefs">tan:prepend-id-or-idrefs</link></code>() <code><link linkend="template-prepend-id-or-idrefs">ŧ prepend-id-or-idrefs</link></code> <code><link linkend="variable-previous-TAN-versions">$previous-TAN-versions</link></code> <code><link linkend="variable-primary-agent">$primary-agent</link></code> <code><link linkend="function-process-regex-escape-u">tan:process-regex-escape-u</link></code>() <code><link linkend="function-product">tan:product</link></code>() <code><link linkend="function-product-loop">tan:product-loop</link></code>() </para>
<para><code><link linkend="key-q-ref">ʞ q-ref</link></code>') <code><link linkend="function-q-ref">tan:q-ref</link></code>() <code><link linkend="variable-quot">$quot</link></code> </para>
<para><code><link linkend="template-reconstruct-div-hierarchy">ŧ reconstruct-div-hierarchy</link></code> <code><link linkend="function-regex">tan:regex</link></code>() <code><link linkend="variable-regex-characters-not-permitted">$regex-characters-not-permitted</link></code> <code><link linkend="variable-regex-escaping-characters">$regex-escaping-characters</link></code> <code><link linkend="variable-relationship-keywords-for-tan-files">$relationship-keywords-for-tan-files</link></code> <code><link linkend="function-replace">tan:replace</link></code>() <code><link linkend="function-reset-hierarchy">tan:reset-hierarchy</link></code>() <code><link linkend="template-reset-hierarchy">ŧ reset-hierarchy</link></code> <code><link linkend="function-resolve-alias">tan:resolve-alias</link></code>() <code><link linkend="function-resolve-alias-loop">tan:resolve-alias-loop</link></code>() <code><link linkend="template-resolve-attr-include">ŧ resolve-attr-include</link></code> <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>() <code><link linkend="function-resolve-href">tan:resolve-href</link></code>() <code><link linkend="template-resolve-href">ŧ resolve-href</link></code> <code><link linkend="function-resolve-idref">tan:resolve-idref</link></code>() <code><link linkend="function-resolve-keyword">tan:resolve-keyword</link></code>() <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code> <code><link linkend="variable-rng-collection">$rng-collection</link></code> <code><link linkend="variable-rng-collection-without-TEI">$rng-collection-without-TEI</link></code> <code><link linkend="function-rom-to-int">tan:rom-to-int</link></code>() <code><link linkend="variable-roman-numeral-pattern">$roman-numeral-pattern</link></code> </para>
<para><code><link linkend="variable-schema-collection">$schema-collection</link></code> <code><link linkend="variable-see-alsos-1st-da">$see-alsos-1st-da</link></code> <code><link linkend="variable-see-alsos-resolved">$see-alsos-resolved</link></code> <code><link linkend="variable-self-expanded">$self-expanded</link></code> <code><link linkend="variable-self-resolved">$self-resolved</link></code> <code><link linkend="variable-separator-hierarchy">$separator-hierarchy</link></code> <code><link linkend="variable-separator-hierarchy-minor">$separator-hierarchy-minor</link></code> <code><link linkend="variable-separator-major">$separator-major</link></code> <code><link linkend="function-sequence-collapse">tan:sequence-collapse</link></code>() <code><link linkend="function-sequence-error">tan:sequence-error</link></code>() <code><link linkend="function-shallow-copy">tan:shallow-copy</link></code>() <code><link linkend="template-snap-to-word-pass-1">ŧ snap-to-word-pass-1</link></code> <code><link linkend="variable-source-ids">$source-ids</link></code> <code><link linkend="variable-sources-1st-da">$sources-1st-da</link></code> <code><link linkend="variable-sources-must-be-altered">$sources-must-be-altered</link></code> <code><link linkend="variable-sources-resolved">$sources-resolved</link></code> <code><link linkend="variable-special-end-div-chars">$special-end-div-chars</link></code> <code><link linkend="variable-special-end-div-chars-regex">$special-end-div-chars-regex</link></code> <code><link linkend="variable-src-ids">$src-ids</link></code> <code><link linkend="variable-stated-validation-phase">$stated-validation-phase</link></code> <code><link linkend="function-string-base">tan:string-base</link></code>() <code><link linkend="function-string-composite">tan:string-composite</link></code>() <code><link linkend="function-string-length">tan:string-length</link></code>() <code><link linkend="function-string-to-int">tan:string-to-int</link></code>() <code><link linkend="function-string-to-numerals">tan:string-to-numerals</link></code>() <code><link linkend="template-string-to-numerals">ŧ string-to-numerals</link></code> <code><link linkend="template-strip-all-attributes-except">ŧ strip-all-attributes-except</link></code> <code><link linkend="template-strip-duplicate-children-by-attribute-value">ŧ strip-duplicate-children-by-attribute-value</link></code> <code><link linkend="function-strip-duplicates">tan:strip-duplicates</link></code>() <code><link linkend="template-strip-duplicates">ŧ strip-duplicates</link></code> <code><link linkend="template-strip-specific-attributes">ŧ strip-specific-attributes</link></code> <code><link linkend="template-strip-text">ŧ strip-text</link></code> <code><link linkend="function-syr-to-int">tan:syr-to-int</link></code>() <code><link linkend="variable-syriac-letter-numeral-pattern">$syriac-letter-numeral-pattern</link></code> </para>
<para><code><link linkend="variable-tag-urn-regex-pattern">$tag-urn-regex-pattern</link></code> <code><link linkend="variable-tan-classes">$tan-classes</link></code> <code><link linkend="function-tan-type">tan:tan-type</link></code>() <code><link linkend="function-text-join">tan:text-join</link></code>() <code><link linkend="template-text-join">ŧ text-join</link></code> <code><link linkend="template-text-only">ŧ text-only</link></code> <code><link linkend="key-tok-via-ref">ʞ tok-via-ref</link></code>') <code><link linkend="variable-token-definition-default">$token-definition-default</link></code> <code><link linkend="variable-token-definitions-reserved">$token-definitions-reserved</link></code> <code><link linkend="variable-tokenization-nonspace">$tokenization-nonspace</link></code> <code><link linkend="function-tokenize">tan:tokenize</link></code>() <code><link linkend="function-tokenize-div">tan:tokenize-div</link></code>() <code><link linkend="template-tokenize-div">ŧ tokenize-div</link></code> <code><link linkend="function-tokenize-text">tan:tokenize-text</link></code>() <code><link linkend="function-true">tan:true</link></code>() </para>
<para><code><link linkend="variable-TAN-elements-that-take-the-attribute-which">$TAN-elements-that-take-the-attribute-which</link></code> <code><link linkend="variable-TAN-keyword-files">$TAN-keyword-files</link></code> <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code> <code><link linkend="variable-TAN-namespace">$TAN-namespace</link></code> <code><link linkend="variable-TAN-version">$TAN-version</link></code> </para>
<para><code><link linkend="function-uri-directory">tan:uri-directory</link></code>() <code><link linkend="function-uri-relative-to">tan:uri-relative-to</link></code>() </para>
<para><code><link linkend="variable-validation-phase-names">$validation-phase-names</link></code> <code><link linkend="function-value-of">tan:value-of</link></code>() <code><link linkend="function-variables-checked-where">tan:variables-checked-where</link></code>() </para>
<para><code><link linkend="function-xml-to-string">tan:xml-to-string</link></code>() <code><link linkend="variable-xpath-pattern">$xpath-pattern</link></code> </para>
<para><code><link linkend="function-zip-uris">tan:zip-uris</link></code>() <code><link linkend="variable-zwj">$zwj</link></code> </para>
<para>The contents of this chapter have been generated automatically. Although much effort has
         been spent to ensure accurate representation of the schemas and function library, you may
         find errors or inconsistencies. In such cases, the functions and schemas (particularly the
         RELAX-NG, compact syntax) are to be given priority.</para><section><title>TAN-core global variables, keys, and functions summarized</title><section><title>variables</title><section xml:id="variable-all-head-iris"><title><code>$all-head-iris</code></title><para>Definition: <code><link linkend="variable-head">$head</link>//tan:IRI[not(ancestor::tan:error)]</code></para><para>Used by variable <code><link linkend="variable-duplicate-head-iris">$duplicate-head-iris</link></code></para><para>Relies upon <code><link linkend="variable-head">$head</link></code> .</para></section>
<section xml:id="variable-all-ids"><title><code>$all-ids</code></title><para>Definition: <code>(<link linkend="variable-head">$head</link>//(<link linkend="attribute-xmlid">@xml:id</link>, <link linkend="attribute-id">@id</link>), /tei:TEI//descendant-or-self::tei:*/<link linkend="attribute-xmlid">@xml:id</link>)</code></para><para>Used by variable <code><link linkend="variable-duplicate-ids">$duplicate-ids</link></code></para><para>Used by template <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code></para><para>Relies upon <code><link linkend="variable-head">$head</link></code> .</para></section>
<section xml:id="variable-all-keywords"><title><code>$all-keywords</code></title><para>Definition: <code>(<link linkend="variable-keys-expanded">$keys-expanded</link>, <link linkend="variable-TAN-keywords">$TAN-keywords</link>)</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-keys-expanded">$keys-expanded</link></code> <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code> .</para></section>
<section xml:id="variable-alphabet-numeral-key"><title><code>$alphabet-numeral-key</code></title><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>Used by function <code><link linkend="function-letter-to-number">tan:letter-to-number</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-apos"><title><code>$apos</code></title><para>Definition: <code>"'"</code></para><para>Used by function <code><link linkend="function-errors-checked-where">tan:errors-checked-where</link></code>() <code><link linkend="function-variables-checked-where">tan:variables-checked-where</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-arabic-indic-numeral-pattern"><title><code>$arabic-indic-numeral-pattern</code></title><para>Definition: <code>'[٠١٢٣٤٥٦٧٨٩]+'</code></para><para>Used by variable <code><link linkend="variable-nonlatin-letter-numeral-pattern">$nonlatin-letter-numeral-pattern</link></code></para><para>Used by function <code><link linkend="function-ara-to-int">tan:ara-to-int</link></code>() <code><link linkend="function-letter-to-number">tan:letter-to-number</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-attributes-that-take-non-arabic-numerals"><title><code>$attributes-that-take-non-arabic-numerals</code></title><para>Definition: <code>('ref', 'n', 'new')</code></para><para>Used by template <code><link linkend="template-core-resolution-arabic-numerals">ŧ core-resolution-arabic-numerals</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-body"><title><code>$body</code></title><para>Definition: <code><link linkend="variable-self-resolved">$self-resolved</link>/*/(tan:body, tei:text/tei:body)</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-self-resolved">$self-resolved</link></code> .</para></section>
<section xml:id="variable-dhy"><title><code>$dhy</code></title><para>Definition: <code>'­'</code></para><para>Used by variable <code><link linkend="variable-special-end-div-chars">$special-end-div-chars</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-doc-class"><title><code>$doc-class</code></title><para>Definition: <code><link linkend="function-class-number">tan:class-number</link>(<link linkend="variable-self-resolved">$self-resolved</link>)</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="function-class-number">tan:class-number</link></code> <code><link linkend="variable-self-resolved">$self-resolved</link></code> .</para></section>
<section xml:id="variable-doc-id"><title><code>$doc-id</code></title><para>Definition: <code>/*/<link linkend="attribute-id">@id</link></code></para><para>Used by variable <code><link linkend="variable-doc-namespace">$doc-namespace</link></code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-expansion-terse <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-doc-namespace"><title><code>$doc-namespace</code></title><para>Definition: <code>substring-before(substring-after(<link linkend="variable-doc-id">$doc-id</link>, 'tag:'), ':')</code></para><para>Used by variable <code><link linkend="variable-primary-agent">$primary-agent</link></code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code></para><para>Relies upon <code><link linkend="variable-doc-id">$doc-id</link></code> .</para></section>
<section xml:id="variable-doc-parent-directory"><title><code>$doc-parent-directory</code></title><para>Definition: <code><link linkend="function-uri-directory">tan:uri-directory</link>(<link linkend="variable-doc-uri">$doc-uri</link>)</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="function-uri-directory">tan:uri-directory</link></code> <code><link linkend="variable-doc-uri">$doc-uri</link></code> .</para></section>
<section xml:id="variable-doc-type"><title><code>$doc-type</code></title><para>Definition: <code>name(/*)</code></para><para>Used by variable <code><link linkend="variable-morphologies-1st-da">$morphologies-1st-da</link></code> <code><link linkend="variable-morphologies-resolved">$morphologies-resolved</link></code></para><para>Used by function <code><link linkend="function-merge-expanded-docs">tan:merge-expanded-docs</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-doc-uri"><title><code>$doc-uri</code></title><para>Definition: <code>base-uri(/*)</code></para><para>Used by variable <code><link linkend="variable-doc-parent-directory">$doc-parent-directory</link></code></para><para>Used by template <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-duplicate-head-iris"><title><code>$duplicate-head-iris</code></title><para>Definition: <code><link linkend="variable-all-head-iris">$all-head-iris</link>[index-of(<link linkend="variable-all-head-iris">$all-head-iris</link>, .)[2]]</code></para><para>Used by template <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code></para><para>Relies upon <code><link linkend="variable-all-head-iris">$all-head-iris</link></code> .</para></section>
<section xml:id="variable-duplicate-ids"><title><code>$duplicate-ids</code></title><para>Definition: <code><link linkend="variable-all-ids">$all-ids</link>[index-of(<link linkend="variable-all-ids">$all-ids</link>, .)[2]]</code></para><para>Used by template <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code> <code><link linkend="template-catalog-expansion-terse">ŧ catalog-expansion-terse</link></code> <code><link linkend="template-catalog-expansion-terse">ŧ catalog-expansion-terse</link></code></para><para>Relies upon <code><link linkend="variable-all-ids">$all-ids</link></code> .</para></section>
<section xml:id="variable-elements-that-must-always-refer-to-tan-files"><title><code>$elements-that-must-always-refer-to-tan-files</code></title><para>Definition: <code>('morphology', 'inclusion', 'key')</code></para><para>Used by function <code><link linkend="function-must-refer-to-external-tan-file">tan:must-refer-to-external-tan-file</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-elements-that-refer-to-textual-items"><title><code>$elements-that-refer-to-textual-items</code></title><para>Definition: <code>('person', 'agent', 'scriptum', 'work', 'version', 'source')</code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-empty-doc"><title><code>$empty-doc</code></title><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>Used by template <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-empty-element"><title><code>$empty-element</code></title><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-expansion-terse-no-alter <code><link linkend="template-dependency-expansion-terse">ŧ dependency-expansion-terse</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-erroneously-looped-doc"><title><code>$erroneously-looped-doc</code></title><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> .</para></section>
<section xml:id="variable-greek-letter-numeral-pattern"><title><code>$greek-letter-numeral-pattern</code></title><para>Definition: <code>'͵?([α-θΑ-ΘϛϚ]?[ρ-ωΡ-ΩϠϡ]?[ι-πΙ-ΠϘϙϞϟ]?[α-θΑ-ΘϛϚ]|[α-θΑ-ΘϛϚ]?[ρ-ωΡ-ΩϠϡ]?[ι-πΙ-ΠϘϙϞϟ][α-θΑ-ΘϛϚ]?|[α-θΑ-ΘϛϚ]?[ρ-ωΡ-ΩϠϡ][ι-πΙ-ΠϘϙϞϟ]?[α-θΑ-ΘϛϚ]?)ʹ?'</code></para><para>Used by variable <code><link linkend="variable-nonlatin-letter-numeral-pattern">$nonlatin-letter-numeral-pattern</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-head"><title><code>$head</code></title><para>Definition: <code><link linkend="variable-self-resolved">$self-resolved</link>/*/tan:head</code></para><para>Used by variable <code><link linkend="variable-src-ids">$src-ids</link></code> <code><link linkend="variable-source-ids">$source-ids</link></code> <code><link linkend="variable-all-ids">$all-ids</link></code> <code><link linkend="variable-all-head-iris">$all-head-iris</link></code> <code><link linkend="variable-primary-agent">$primary-agent</link></code> <code><link linkend="variable-keys-1st-da">$keys-1st-da</link></code> <code><link linkend="variable-sources-1st-da">$sources-1st-da</link></code> <code><link linkend="variable-sources-must-be-altered">$sources-must-be-altered</link></code> <code><link linkend="variable-see-alsos-1st-da">$see-alsos-1st-da</link></code> <code><link linkend="variable-morphologies-1st-da">$morphologies-1st-da</link></code> <code><link linkend="variable-morphologies-resolved">$morphologies-resolved</link></code></para><para>Used by template <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code> <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code></para><para>Used by function <code><link linkend="function-definition">tan:definition</link></code>() <code><link linkend="function-diff-loop">tan:diff-loop</link></code>()</para><para>Relies upon <code><link linkend="variable-self-resolved">$self-resolved</link></code> .</para></section>
<section xml:id="variable-id-idrefs"><title><code>$id-idrefs</code></title><para>Definition: <code>doc('TAN-idrefs.xml')</code></para><para>Used by template <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code> <code><link linkend="template-prepend-id-or-idrefs">ŧ prepend-id-or-idrefs</link></code></para><para>Used by function <code><link linkend="function-definition">tan:definition</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-inclusions-1st-da"><title><code>$inclusions-1st-da</code></title><para>Definition: <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>(/*/tan:head/tan:inclusion)</code></para><para>Used by variable <code><link linkend="variable-inclusions-resolved">$inclusions-resolved</link></code></para><para>Relies upon <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code> .</para></section>
<section xml:id="variable-inclusions-resolved"><title><code>$inclusions-resolved</code></title><para>Definition: <code><link linkend="function-resolve-doc">tan:resolve-doc</link>(<link linkend="variable-inclusions-1st-da">$inclusions-1st-da</link>, false(), 'incl', /*/tan:head/tan:inclusion/<link linkend="attribute-xmlid">@xml:id</link>, (), ())</code></para><para>Used by template <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code></para><para>Relies upon <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> <code><link linkend="variable-inclusions-1st-da">$inclusions-1st-da</link></code> .</para></section>
<section xml:id="variable-keys-1st-da"><title><code>$keys-1st-da</code></title><para>Definition: <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>(<link linkend="variable-head">$head</link>/tan:key)</code></para><para>Used by variable <code><link linkend="variable-keys-resolved">$keys-resolved</link></code></para><para>Used by template <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code></para><para>Used by function <code><link linkend="function-glossary">tan:glossary</link></code>()</para><para>Relies upon <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code> <code><link linkend="variable-head">$head</link></code> .</para></section>
<section xml:id="variable-keys-expanded"><title><code>$keys-expanded</code></title><para>Definition: <code><link linkend="function-expand-doc">tan:expand-doc</link>(<link linkend="variable-keys-resolved">$keys-resolved</link>)</code></para><para>Used by variable <code><link linkend="variable-all-keywords">$all-keywords</link></code></para><para>Relies upon <code><link linkend="function-expand-doc">tan:expand-doc</link></code> <code><link linkend="variable-keys-resolved">$keys-resolved</link></code> .</para></section>
<section xml:id="variable-keys-resolved"><title><code>$keys-resolved</code></title><para>Definition: <code><link linkend="function-resolve-doc">tan:resolve-doc</link>(<link linkend="variable-keys-1st-da">$keys-1st-da</link>)</code></para><para>Used by variable <code><link linkend="variable-keys-expanded">$keys-expanded</link></code></para><para>Used by template <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code></para><para>Relies upon <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> <code><link linkend="variable-keys-1st-da">$keys-1st-da</link></code> .</para></section>
<section xml:id="variable-latin-letter-numeral-pattern"><title><code>$latin-letter-numeral-pattern</code></title><para>Definition: <code>'a+|b+|c+|d+|e+|f+|g+|h+|i+|j+|k+|l+|m+|n+|o+|p+|q+|r+|s+|t+|u+|v+|w+|x+|y+|z+'</code></para><para>Used by variable <code><link linkend="variable-n-type-pattern">$n-type-pattern</link></code></para><para>Used by function <code><link linkend="function-aaa-to-int">tan:aaa-to-int</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-morphologies-1st-da"><title><code>$morphologies-1st-da</code></title><para>Definition: <code>          if (<link linkend="variable-doc-type">$doc-type</link> = 'TAN-A-lm') then             <link linkend="function-get-1st-doc">tan:get-1st-doc</link>(<link linkend="variable-head">$head</link>/tan:definitions/tan:morphology)          else             ()</code></para><para>Used by variable <code><link linkend="variable-morphologies-resolved">$morphologies-resolved</link></code></para><para>Relies upon <code><link linkend="variable-doc-type">$doc-type</link></code> <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code> <code><link linkend="variable-head">$head</link></code> .</para></section>
<section xml:id="variable-morphologies-resolved"><title><code>$morphologies-resolved</code></title><para>Definition: <code>          if (<link linkend="variable-doc-type">$doc-type</link> = 'TAN-A-lm') then             <link linkend="function-resolve-doc">tan:resolve-doc</link>(<link linkend="variable-morphologies-1st-da">$morphologies-1st-da</link>, false(), 'morphology', <link linkend="variable-head">$head</link>/tan:definitions/tan:morphology/<link linkend="attribute-xmlid">@xml:id</link>, (), ())          else             ()</code></para><para>Used by variable <code><link linkend="variable-morphologies-expanded">$morphologies-expanded</link></code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>()</para><para>Relies upon <code><link linkend="variable-doc-type">$doc-type</link></code> <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> <code><link linkend="variable-morphologies-1st-da">$morphologies-1st-da</link></code> <code><link linkend="variable-head">$head</link></code> .</para></section>
<section xml:id="variable-n-type"><title><code>$n-type</code></title><para>Definition: <code>('i', '1', '1a', 'a', 'a1', 'α', '$', 'i-or-a')</code></para><para>Used by template <code><link linkend="template-string-to-numerals">ŧ string-to-numerals</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-n-type-label"><title><code>$n-type-label</code></title><para>Definition: <code>          ('Roman numerals', 'Arabic numerals', 'Arabic numerals + alphabet numeral', 'alphabet numeral', 'alphabet numeral + Arabic numeral',          'non-Latin-alphabet numeral', 'string', 'Roman or alphabet numeral')</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-n-type-pattern"><title><code>$n-type-pattern</code></title><para>Definition: <code>          (concat('^(', <link linkend="variable-roman-numeral-pattern">$roman-numeral-pattern</link>, ')$'),          '^(\d+)$',          concat('^(\d+)(', <link linkend="variable-latin-letter-numeral-pattern">$latin-letter-numeral-pattern</link>, ')$'),          concat('^(', <link linkend="variable-latin-letter-numeral-pattern">$latin-letter-numeral-pattern</link>, ')$'),          concat('^(', <link linkend="variable-latin-letter-numeral-pattern">$latin-letter-numeral-pattern</link>, ')(\d+)$'),          concat('^(', <link linkend="variable-nonlatin-letter-numeral-pattern">$nonlatin-letter-numeral-pattern</link>, ')$'),          '(.)')</code></para><para>Used by template <code><link linkend="template-string-to-numerals">ŧ string-to-numerals</link></code></para><para>Relies upon <code><link linkend="variable-roman-numeral-pattern">$roman-numeral-pattern</link></code> <code><link linkend="variable-latin-letter-numeral-pattern">$latin-letter-numeral-pattern</link></code> <code><link linkend="variable-nonlatin-letter-numeral-pattern">$nonlatin-letter-numeral-pattern</link></code> .</para></section>
<section xml:id="variable-nonlatin-letter-numeral-pattern"><title><code>$nonlatin-letter-numeral-pattern</code></title><para>Definition: <code>string-join((<link linkend="variable-arabic-indic-numeral-pattern">$arabic-indic-numeral-pattern</link>, <link linkend="variable-greek-letter-numeral-pattern">$greek-letter-numeral-pattern</link>, <link linkend="variable-syriac-letter-numeral-pattern">$syriac-letter-numeral-pattern</link>), '|')</code></para><para>Used by variable <code><link linkend="variable-n-type-pattern">$n-type-pattern</link></code></para><para>Relies upon <code><link linkend="variable-arabic-indic-numeral-pattern">$arabic-indic-numeral-pattern</link></code> <code><link linkend="variable-greek-letter-numeral-pattern">$greek-letter-numeral-pattern</link></code> <code><link linkend="variable-syriac-letter-numeral-pattern">$syriac-letter-numeral-pattern</link></code> .</para></section>
<section xml:id="variable-now"><title><code>$now</code></title><para>Definition: <code><link linkend="function-dateTime-to-decimal">tan:dateTime-to-decimal</link>(current-dateTime())</code></para><para>Used by template <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code></para><para>Relies upon <code><link linkend="function-dateTime-to-decimal">tan:dateTime-to-decimal</link></code> .</para></section>
<section xml:id="variable-official-urn-namespaces"><title><code>$official-urn-namespaces</code></title><para>Definition: <code>          ('3gpp',          'adid',          'alert',          'bbf',          'broadband-forum-org',          'cablelabs',          'ccsds',          'cgi',          'clei',          'dgiwg',          'dslforum-org',          'dvb',          'ebu',          'eidr',          'epc',          'epcglobal',          'eurosystem',          'example',          'fdc',          'fipa',          'geant',          'globus',          'gsma',          'hbbtv',          'ieee',          'ietf',          'iptc',          'isan',          'isbn',          'iso',          'issn',          'ivis',          'liberty',          'mace',          'mef',          'mpeg',          'mrn',          'nato',          'nbn',          'nena',          'newsml',          'nfc',          'nzl',          'oasis',          'ogc',          'ogf',          'oid',          'oipf',          'oma',          'pin',          'publicid',          's1000d',          'schac',          'service',          'smpte',          'swift',          'tva',          'uci',          'ucode',          'uuid',          'web3d',          'xmlorg',          'xmpp',          'urn-1',          'urn-2',          'urn-3',          'urn-4',          'urn-5',          'urn-6',          'urn-7')</code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-orig-self"><title><code>$orig-self</code></title><para>Definition: <code>/</code></para><para>Used by template <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-previous-TAN-versions"><title><code>$previous-TAN-versions</code></title><para>Definition: <code>('1 dev')</code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-primary-agent"><title><code>$primary-agent</code></title><para>Definition: <code>(<link linkend="variable-head">$head</link>/tan:definitions/(tan:person, tan:organization, tan:algorithm)[tan:IRI[matches(., concat('^tag:', <link linkend="variable-doc-namespace">$doc-namespace</link>))]])[1]</code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code></para><para>Relies upon <code><link linkend="variable-head">$head</link></code> <code><link linkend="variable-doc-namespace">$doc-namespace</link></code> .</para></section>
<section xml:id="variable-quot"><title><code>$quot</code></title><para>Definition: <code>'"'</code></para><para>Used by function <code><link linkend="function-errors-checked-where">tan:errors-checked-where</link></code>() <code><link linkend="function-variables-checked-where">tan:variables-checked-where</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-regex-characters-not-permitted"><title><code>$regex-characters-not-permitted</code></title><para>Definition: <code>'[  - ]'</code></para><para>Used by template <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-relationship-keywords-for-tan-files"><title><code>$relationship-keywords-for-tan-files</code></title><para>Definition: <code><link linkend="function-glossary">tan:glossary</link>('relationship', (), 'TAN files')</code></para><para>Used by function <code><link linkend="function-must-refer-to-external-tan-file">tan:must-refer-to-external-tan-file</link></code>()</para><para>Relies upon <code><link linkend="function-glossary">tan:glossary</link></code> .</para></section>
<section xml:id="variable-roman-numeral-pattern"><title><code>$roman-numeral-pattern</code></title><para>Definition: <code>'m{0,4}(cm|cd|d?c{0,3})(xc|xl|l?x{0,3})(ix|iv|v?i{0,3})'</code></para><para>Used by variable <code><link linkend="variable-n-type-pattern">$n-type-pattern</link></code></para><para>Used by function <code><link linkend="function-rom-to-int">tan:rom-to-int</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-see-alsos-1st-da"><title><code>$see-alsos-1st-da</code></title><para>Definition: <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>(<link linkend="variable-head">$head</link>/tan:see-also)</code></para><para>Used by variable <code><link linkend="variable-see-alsos-resolved">$see-alsos-resolved</link></code></para><para>Relies upon <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code> <code><link linkend="variable-head">$head</link></code> .</para></section>
<section xml:id="variable-see-alsos-resolved"><title><code>$see-alsos-resolved</code></title><para>Definition: <code><link linkend="function-resolve-doc">tan:resolve-doc</link>(<link linkend="variable-see-alsos-1st-da">$see-alsos-1st-da</link>)</code></para><para>Used by template <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code></para><para>Relies upon <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> <code><link linkend="variable-see-alsos-1st-da">$see-alsos-1st-da</link></code> .</para></section>
<section xml:id="variable-self-expanded"><title><code>$self-expanded</code></title><para>Definition: <code><link linkend="function-expand-doc">tan:expand-doc</link>(<link linkend="variable-self-resolved">$self-resolved</link>)</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="function-expand-doc">tan:expand-doc</link></code> <code><link linkend="variable-self-resolved">$self-resolved</link></code> .</para></section>
<section xml:id="variable-self-resolved"><title><code>$self-resolved</code></title><para>Definition: <code><link linkend="function-resolve-doc">tan:resolve-doc</link>(/)</code></para><para>Used by variable <code><link linkend="variable-self-expanded">$self-expanded</link></code> <code><link linkend="variable-head">$head</link></code> <code><link linkend="variable-body">$body</link></code> <code><link linkend="variable-doc-class">$doc-class</link></code></para><para>Relies upon <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> .</para></section>
<section xml:id="variable-separator-hierarchy"><title><code>$separator-hierarchy</code></title><para>Definition: <code>' '</code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-expansion-terse-no-alter <code><link linkend="template-dependency-expansion-terse">ŧ dependency-expansion-terse</link></code> <code><link linkend="template-dependencies-tokenized-selectively">ŧ dependencies-tokenized-selectively</link></code> <code><link linkend="template-merge-divs">ŧ merge-divs</link></code> <code><link linkend="template-only-misfit-divs">ŧ only-misfit-divs</link></code> <code><link linkend="template-reconstruct-div-hierarchy">ŧ reconstruct-div-hierarchy</link></code> <code><link linkend="template-string-to-numerals">ŧ string-to-numerals</link></code></para><para>Used by function <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link></code>() <code><link linkend="function-analyze-ref-loop">tan:analyze-ref-loop</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-separator-hierarchy-minor"><title><code>$separator-hierarchy-minor</code></title><para>Definition: <code>'#'</code></para><para>Used by template <code><link linkend="template-string-to-numerals">ŧ string-to-numerals</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-separator-major"><title><code>$separator-major</code></title><para>Definition: <code>'##'</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-source-ids"><title><code>$source-ids</code></title><para>Definition: <code>          if (exists(<link linkend="variable-head">$head</link>/tan:source/<link linkend="attribute-xmlid">@xml:id</link>)) then             <link linkend="variable-head">$head</link>/tan:source/<link linkend="attribute-xmlid">@xml:id</link>          else             for $i in (1 to count(<link linkend="variable-head">$head</link>/tan:source))             return                string($i)</code></para><para>Used by variable <code><link linkend="variable-sources-resolved">$sources-resolved</link></code></para><para>Relies upon <code><link linkend="variable-head">$head</link></code> .</para></section>
<section xml:id="variable-sources-1st-da"><title><code>$sources-1st-da</code></title><para>Definition: <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>(<link linkend="variable-head">$head</link>/tan:source)</code></para><para>Used by variable <code><link linkend="variable-sources-resolved">$sources-resolved</link></code></para><para>Relies upon <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code> <code><link linkend="variable-head">$head</link></code> .</para></section>
<section xml:id="variable-sources-must-be-altered"><title><code>$sources-must-be-altered</code></title><para>Definition: <code>exists(<link linkend="variable-head">$head</link>/tan:alter/(tan:equate, tan:rename, tan:reassign, tan:skip))</code></para><para>Used by variable <code><link linkend="variable-sources-resolved">$sources-resolved</link></code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>()</para><para>Relies upon <code><link linkend="variable-head">$head</link></code> .</para></section>
<section xml:id="variable-sources-resolved"><title><code>$sources-resolved</code></title><para>Definition: <code><link linkend="function-resolve-doc">tan:resolve-doc</link>(<link linkend="variable-sources-1st-da">$sources-1st-da</link>, <link linkend="variable-sources-must-be-altered">$sources-must-be-altered</link>, 'src', <link linkend="variable-source-ids">$source-ids</link>, (), ())</code></para><para>Used by template <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>()</para><para>Relies upon <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> <code><link linkend="variable-sources-1st-da">$sources-1st-da</link></code> <code><link linkend="variable-sources-must-be-altered">$sources-must-be-altered</link></code> <code><link linkend="variable-source-ids">$source-ids</link></code> .</para></section>
<section xml:id="variable-stated-validation-phase"><title><code>$stated-validation-phase</code></title><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-syriac-letter-numeral-pattern"><title><code>$syriac-letter-numeral-pattern</code></title><para>Definition: <code>'[ܐܒܓܕܗܘܙܚܛ]?\p{Mc}?(ܬ?[ܩܪܫܬ]|[ܢܣܥܦܨ]\p{Mc})?\p{Mc}?[ܝܟܠܡܢܣܥܦܨ]?\p{Mc}?[ܐܒܓܕܗܘܙܚܛ]\p{Mc}?|[ܐܒܓܕܗܘܙܚܛ]?\p{Mc}?(ܬ?[ܩܪܫܬ]|[ܢܣܥܦܨ]\p{Mc})?\p{Mc}?[ܝܟܠܡܢܣܥܦܨ]\p{Mc}?[ܐܒܓܕܗܘܙܚܛ]?\p{Mc}?|[ܐܒܓܕܗܘܙܚܛ]?\p{Mc}?(ܬ?[ܩܪܫܬ]|[ܢܣܥܦܨ]\p{Mc})\p{Mc}?[ܝܟܠܡܢܣܥܦܨ]?\p{Mc}?[ܐܒܓܕܗܘܙܚܛ]?\p{Mc}?'</code></para><para>Used by variable <code><link linkend="variable-nonlatin-letter-numeral-pattern">$nonlatin-letter-numeral-pattern</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-tag-urn-regex-pattern"><title><code>$tag-urn-regex-pattern</code></title><para>Definition: <code>'tag:([\-a-zA-Z0-9._%+]+@)?[\-a-zA-Z0-9.]+\.[A-Za-z]{2,4},\d{4}(-(0\d|1[0-2]))?(-([0-2]\d|3[01]))?:\S+'</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-tan-classes"><title><code>$tan-classes</code></title><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>Used by function <code><link linkend="function-class-number">tan:class-number</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-TAN-keyword-files"><title><code>$TAN-keyword-files</code></title><para>Definition: <code>collection('../../TAN-key/collection.xml')</code></para><para>Used by variable <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-TAN-keywords"><title><code>$TAN-keywords</code></title><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para> We do not put dependency TAN-key files through the customary <code><link linkend="function-expand-doc">tan:expand-doc</link></code>(), which relies upon <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code> </para><para>Used by variable <code><link linkend="variable-all-keywords">$all-keywords</link></code> <code><link linkend="variable-token-definitions-reserved">$token-definitions-reserved</link></code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code></para><para>Used by function <code><link linkend="function-glossary">tan:glossary</link></code>()</para><para>Relies upon <code><link linkend="variable-TAN-keyword-files">$TAN-keyword-files</link></code> <code><link linkend="template-expand-tan-key-dependencies">ŧ expand-tan-key-dependencies</link></code> .</para></section>
<section xml:id="variable-TAN-namespace"><title><code>$TAN-namespace</code></title><para>Definition: <code>'tag:textalign.net,2015'</code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-TAN-version"><title><code>$TAN-version</code></title><para>Definition: <code>'2018'</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-token-definition-default"><title><code>$token-definition-default</code></title><para>Definition: <code><link linkend="variable-token-definitions-reserved">$token-definitions-reserved</link>[1]</code></para><para>Used by function <code><link linkend="function-tokenize-text">tan:tokenize-text</link></code>() <code><link linkend="function-tokenize-text">tan:tokenize-text</link></code>()</para><para>Relies upon <code><link linkend="variable-token-definitions-reserved">$token-definitions-reserved</link></code> .</para></section>
<section xml:id="variable-token-definitions-reserved"><title><code>$token-definitions-reserved</code></title><para>Definition: <code><link linkend="variable-TAN-keywords">$TAN-keywords</link>//tan:token-definition</code></para><para>Used by variable <code><link linkend="variable-tokenization-nonspace">$tokenization-nonspace</link></code> <code><link linkend="variable-token-definition-default">$token-definition-default</link></code></para><para>Relies upon <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code> .</para></section>
<section xml:id="variable-validation-phase-names"><title><code>$validation-phase-names</code></title><para>Definition: <code>('terse', 'normal', 'verbose')</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-zwj"><title><code>$zwj</code></title><para>Definition: <code>'‍'</code></para><para>Used by variable <code><link linkend="variable-special-end-div-chars">$special-end-div-chars</link></code></para><para>Used by template <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
</section>
<section><title>keys</title><section xml:id="key-item-via-node-name"><title><code>ʞ item-via-node-name')</code></title><para>Looks for elements matching <code>tan:item</code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code></para><para>Used by function <code><link linkend="function-glossary">tan:glossary</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="key-q-ref"><title><code>ʞ q-ref')</code></title><para>Looks for elements matching <code>*</code></para><para>Used by function <code><link linkend="function-get-via-q-ref">tan:get-via-q-ref</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
</section>
<section><title>functions</title><section xml:id="function-aaa-to-int"><title><code>tan:aaa-to-int()</code></title><para><code>tan:aaa-to-int($arg as xs:string*) as xs:integer*</code></para><para> Input: any alphabet numerals </para><para> Output:the integer equivalent </para><para> Sequence goes a, b, c, ... z, aa, bb, ..., aaa, bbb, ....  E.g., 'ccc' - &gt; 55 </para><para>Used by template <code><link linkend="template-string-to-numerals">ŧ string-to-numerals</link></code></para><para>Relies upon <code><link linkend="variable-latin-letter-numeral-pattern">$latin-letter-numeral-pattern</link></code> .</para></section>
<section xml:id="function-analyze-numbers-in-string"><title><code>tan:analyze-numbers-in-string()</code></title><para><code>tan:analyze-numbers-in-string($string-to-analyze as xs:string, $ambig-is-roman as xs:boolean?) as element()*</code></para><para> Companion function to the above, this function returns the analysis in element form </para><para>Used by template <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code></para><para>Used by function <code><link linkend="function-string-to-numerals">tan:string-to-numerals</link></code>()</para><para>Relies upon <code><link linkend="template-string-to-numerals">ŧ string-to-numerals</link></code> .</para></section>
<section xml:id="function-analyze-ref-loop"><title><code>tan:analyze-ref-loop()</code></title><para><code>tan:analyze-ref-loop($elements-to-process as element()*, $number-of-ns-in-last-item-processed as xs:integer?, $current-contextual-ref as element()?) as element()*</code></para><para> Input: elements from <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link></code>() that should be evaluated as a ref </para><para> Output: the likely resolution of those refs </para><para>Used by function <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link></code>() <code><link linkend="function-analyze-ref-loop">tan:analyze-ref-loop</link></code>()</para><para>Relies upon <code><link linkend="variable-separator-hierarchy">$separator-hierarchy</link></code> <code><link linkend="function-analyze-ref-loop">tan:analyze-ref-loop</link></code> .</para></section>
<section xml:id="function-analyze-sequence"><title><code>tan:analyze-sequence()</code></title><para><emphasis>Option 1 (TAN-core-functions)</emphasis></para><para><code>tan:analyze-sequence($sequence-string as xs:string, $name-of-attribute as xs:string?) as element()</code></para><para> two-parameter version of the fuller function below </para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-expansion-terse-no-alter <code><link linkend="template-dependency-expansion-terse">ŧ dependency-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code></para><para>Used by function <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link></code>()</para><para>Relies upon <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link></code> .</para><para><emphasis>Option 2 (TAN-core-functions)</emphasis></para><para><code>tan:analyze-sequence($sequence-string as xs:string, $name-of-attribute as xs:string?, $expand-ranges as xs:boolean) as element()</code></para><para> Input: any value of a sequence; a string of the name of the attribute for the sequence (default 'ref'); a boolean indicating whether ranges should be expanded </para><para> Output: <code>&lt;analysis&gt;</code> with children elements that have the name of the second parameter (with <code>@attr</code> and an empty value inserted); those children are grouped by <code>&lt;range&gt;</code> if items are detected to be part of a range. </para><para> If a request for help is detected, the flag will be removed and <code><link linkend="attribute-help">@help</link></code> will be inserted at the appropriate place. </para><para> If ranges are requested to be expanded, it is expected to apply only to integers, and will not operate on values of 'max' or 'last' </para><para> This function normalizes strings ahead of time; no need to run that function beforehand </para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-expansion-terse-no-alter <code><link linkend="template-dependency-expansion-terse">ŧ dependency-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code></para><para>Used by function <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link></code>()</para><para>Relies upon <code><link linkend="function-expand-numerical-sequence">tan:expand-numerical-sequence</link></code> <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-normalize-sequence">tan:normalize-sequence</link></code> <code><link linkend="variable-separator-hierarchy">$separator-hierarchy</link></code> <code><link linkend="function-sequence-error">tan:sequence-error</link></code> <code><link linkend="function-help-extracted">tan:help-extracted</link></code> <code><link linkend="function-analyze-ref-loop">tan:analyze-ref-loop</link></code> .</para></section>
<section xml:id="function-ara-to-int"><title><code>tan:ara-to-int()</code></title><para><code>tan:ara-to-int($arabic-indic-numerals as xs:string*) as xs:integer*</code></para><para> Input: Arabic-indic numerals </para><para> Output: Integer values, if the input conforms to the correct pattern </para><para>Used by function <code><link linkend="function-letter-to-number">tan:letter-to-number</link></code>()</para><para>Relies upon <code><link linkend="variable-arabic-indic-numeral-pattern">$arabic-indic-numeral-pattern</link></code> .</para></section>
<section xml:id="function-base-uri"><title><code>tan:base-uri()</code></title><para><code>tan:base-uri($any-node as node()?) as xs:anyURI?</code></para><para> Input: any node </para><para> Output: the base uri of the node's document </para><para> NB, this function differs from fn:base-uri in that it first looks for a <code>@base-uri</code> stamped at the document node. This is important because many TAN documents will be transformed, bound to variables, and so divorced from an original context dectable only through <code>@base-uri.</code> </para><para>Used by template <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code> <code><link linkend="template-first-stamp">ŧ first-stamp</link></code> expand-tan-key-dependencies <code><link linkend="template-first-stamp">ŧ first-stamp</link></code> <code><link linkend="template-resolve-href">ŧ resolve-href</link></code> expand-tan-key-dependencies</para><para>Used by function <code><link linkend="function-cfn">tan:cfn</link></code>() <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-cfn"><title><code>tan:cfn()</code></title><para><code>tan:cfn($item as item()*) as xs:string*</code></para><para> Input: any items </para><para> Output: the Current File Name, without extension, of the host document node of each item </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-base-uri">tan:base-uri</link></code> .</para></section>
<section xml:id="function-class-number"><title><code>tan:class-number()</code></title><para><code>tan:class-number($nodes as node()*) as xs:integer*</code></para><para> Input: any nodes of a TAN document </para><para> Output: one digit per node, specifying which TAN class the file fits, based on the name of the root element. If no match is found in the root element, 0 is returned </para><para>Used by variable <code><link linkend="variable-doc-class">$doc-class</link></code></para><para>Used by template <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>() <code><link linkend="function-must-refer-to-external-tan-file">tan:must-refer-to-external-tan-file</link></code>() <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code>()</para><para>Relies upon <code><link linkend="function-tan-type">tan:tan-type</link></code> <code><link linkend="variable-tan-classes">$tan-classes</link></code> .</para></section>
<section xml:id="function-condition-evaluation-loop"><title><code>tan:condition-evaluation-loop()</code></title><para><code>tan:condition-evaluation-loop($elements-with-condition-attributes-to-be-evaluated as element()*, $context-to-evaluate-against as item()*) as xs:boolean</code></para><para> Companion function to the one above, indicating whether the conditions in the attributes hold </para><para>Used by function <code><link linkend="function-conditions-hold">tan:conditions-hold</link></code>() <code><link linkend="function-condition-evaluation-loop">tan:condition-evaluation-loop</link></code>()</para><para>Relies upon <code><link linkend="function-condition-evaluation-loop">tan:condition-evaluation-loop</link></code> <code><link linkend="template-evaluate-conditions">ŧ evaluate-conditions</link></code> .</para></section>
<section xml:id="function-conditions-hold"><title><code>tan:conditions-hold()</code></title><para><emphasis>Option 1 (TAN-core-functions)</emphasis></para><para><code>tan:conditions-hold($element-with-condition-attributes as element()?, $context-to-evaluate-against as item()*) as xs:boolean?</code></para><para> 2-param version of the master one, below </para><para>Used by template <code><link linkend="template-class-2-expansion-terse-pass-2">ŧ class-2-expansion-terse-pass-2</link></code></para><para>Used by function <code><link linkend="function-conditions-hold">tan:conditions-hold</link></code>()</para><para>Relies upon <code><link linkend="function-conditions-hold">tan:conditions-hold</link></code> .</para><para><emphasis>Option 2 (TAN-core-functions)</emphasis></para><para><code>tan:conditions-hold($element-with-condition-attributes as element()?, $context-to-evaluate-against as item()*, $test-sequence as xs:string*) as xs:boolean*</code></para><para> Input: a TAN element with attributes that should be checked for their truth value; a context against which the check the values </para><para> Output: the input elements, with the relevant attributes replaced by a value indicating whether the condition holds </para><para>Used by template <code><link linkend="template-class-2-expansion-terse-pass-2">ŧ class-2-expansion-terse-pass-2</link></code></para><para>Used by function <code><link linkend="function-conditions-hold">tan:conditions-hold</link></code>()</para><para>Relies upon <code><link linkend="function-condition-evaluation-loop">tan:condition-evaluation-loop</link></code> .</para></section>
<section xml:id="function-copy-of"><title><code>tan:copy-of()</code></title><para><code>tan:copy-of($doc-fragment as item()*, $exclude-elements-beyond-what-depth as xs:integer?) as item()*</code></para><para> Input: any document fragment, and an optional integer specifying the depth of copy requested </para><para> Output: a copy of the fragment to the depth specified </para><para> This function depends upon the full version of <code><link linkend="function-copy-of-except">tan:copy-of-except</link></code>(); it is particularly useful for diagnostics, e.g., retrieving a long document's root element and its children, without descendants </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-copy-of-except">tan:copy-of-except</link></code> .</para></section>
<section xml:id="function-copy-of-except"><title><code>tan:copy-of-except()</code></title><para><emphasis>Option 1 (TAN-core-functions)</emphasis></para><para><code>tan:copy-of-except($doc-fragment as item()*, $exclude-elements-named as xs:string*, $exclude-attributes-named as xs:string*, $exclude-elements-with-attributes-named as xs:string*) as item()*</code></para><para> short version of the full function, below </para><para>Used by template <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code></para><para>Used by function <code><link linkend="function-copy-of">tan:copy-of</link></code>() <code><link linkend="function-copy-of-except">tan:copy-of-except</link></code>()</para><para>Relies upon <code><link linkend="function-copy-of-except">tan:copy-of-except</link></code> .</para><para><emphasis>Option 2 (TAN-core-functions)</emphasis></para><para><code>tan:copy-of-except($doc-fragment as item()*, $exclude-elements-named as xs:string*, $exclude-attributes-named as xs:string*, $exclude-elements-with-attributes-named as xs:string*, $exclude-elements-beyond-what-depth as xs:integer?, $shallow-skip-elements-named as xs:string*) as item()*</code></para><para> Input: any document fragment; sequences of strings specifying names of elements to exclude, names of attributes to exclude, and names of attributes whose parent elements should be excluded; an integer beyond which depth copies should not be made </para><para> Output: the same fragment, altered </para><para> This function was written primarily to service the merge of TAN-A-div sources, where realigned divs could be extracted from their source documents </para><para>Used by template <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code></para><para>Used by function <code><link linkend="function-copy-of">tan:copy-of</link></code>() <code><link linkend="function-copy-of-except">tan:copy-of-except</link></code>()</para><para>Relies upon <code><link linkend="template-copy-of-except">ŧ copy-of-except</link></code> .</para></section>
<section xml:id="function-dateTime-to-decimal"><title><code>tan:dateTime-to-decimal()</code></title><para><code>tan:dateTime-to-decimal($time-or-dateTime as item()*) as xs:decimal*</code></para><para> Input: any xs:date or xs:dateTime </para><para> Output: decimal between 0 and 1 that acts as a proxy for the date and time. These decimal values can then be sorted and compared. </para><para> Example: (2015-05-10) - &gt; 0.2015051 </para><para> If input is not castable as a date or dateTime, 0 is returned </para><para>Used by variable <code><link linkend="variable-now">$now</link></code></para><para>Used by template <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code> <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code></para><para>Used by function <code><link linkend="function-most-recent-dateTime">tan:most-recent-dateTime</link></code>() <code><link linkend="function-get-doc-hist">tan:get-doc-hist</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-definition"><title><code>tan:definition()</code></title><para><code>tan:definition($ref-nodes as node()*) as element()*</code></para><para> Input: an attribute or element that contains a text value </para><para> Output: the corresponding definitions. If a value does not exist, an <code>&lt;error&gt;</code> is returned. </para><para> Assumes space normalization, and ignores help requests </para><para>Used by template <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code></para><para>Relies upon <code><link linkend="variable-head">$head</link></code> <code><link linkend="variable-id-idrefs">$id-idrefs</link></code> <code><link linkend="function-error">tan:error</link></code> .</para></section>
<section xml:id="function-distinct-items"><title><code>tan:distinct-items()</code></title><para><code>tan:distinct-items($items as item()*) as item()*</code></para><para> Input: any sequence of items </para><para> Output: Those items that are not deeply equal to any other item in the sequence </para><para> This function is parallel to <code>distinct-values(</code>), but handles non-string input </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-duplicate-items"><title><code>tan:duplicate-items()</code></title><para><code>tan:duplicate-items($sequence as item()*) as item()*</code></para><para> Input: any sequence of items </para><para> Output: those items that appear in the sequence more than once </para><para> This function parallels the standard <code>fn:distinct-values(</code>) </para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-dependencies-tokenized-selectively">ŧ dependencies-tokenized-selectively</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-dependency-expansion-terse">ŧ dependency-expansion-terse</link></code> core-expansion-terse <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code> <code><link linkend="template-catalog-expansion-terse">ŧ catalog-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-expand-numerical-sequence"><title><code>tan:expand-numerical-sequence()</code></title><para><code>tan:expand-numerical-sequence($selector as xs:string?, $max as xs:integer?) as xs:integer*</code></para><para> Input: a string representing a TAN selector (used by <code><link linkend="attribute-pos">@pos</link></code>, <code>@char</code>), and an integer defining the value of 'last' </para><para> Output: a sequence of numbers representing the positions selected, unsorted, and retaining duplicate values.</para><para>            Example: ("2 - 4, last-5 - last, 36", 50) -&gt; (2, 3, 4, 45, 46, 47, 48, 49, 50, 36)</para><para>            Errors will be flagged as follows:</para><para>            0 = value that falls below 1</para><para>            -1 = value that surpasses the value of <code>$max</code></para><para>            -2 = ranges that call for negative steps, e.g., '4 - 2' </para><para>Used by function <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link></code>()</para><para>Relies upon <code><link linkend="function-normalize-sequence">tan:normalize-sequence</link></code> .</para></section>
<section xml:id="function-expand-pos-or-chars"><title><code>tan:expand-pos-or-chars()</code></title><para><code>tan:expand-pos-or-chars($elements as element()*, $max as xs:integer?) as xs:integer*</code></para><para> Input: any elements that are <code>&lt;pos&gt;</code>, <code>&lt;chars&gt;</code>, or <code>&lt;range&gt;</code>s; an integer representing what 'max' means </para><para> Output: the elements converted to integers they represent </para><para> Because the results are normally positive integers, the following should be treated as error codes:</para><para>            0 = value that falls below 1</para><para>            -1 = value that cannot be converted to an integer</para><para>            -2 = ranges that call for negative steps, e.g., '4 - 2' </para><para>Used by template <code><link linkend="template-dependencies-tokenized-selectively">ŧ dependencies-tokenized-selectively</link></code> <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-first-loc-available"><title><code>tan:first-loc-available()</code></title><para><code>tan:first-loc-available($elements-that-are-locations-or-parents-of-locations as element()*) as xs:string?</code></para><para> Input: An element that contains one or more tan:location elements </para><para> Output: the value of the first tan:location/<code><link linkend="attribute-href">@href</link></code> to point to a document available, resolved If no location is available nothing is returned. </para><para>Used by function <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code>()</para><para>Relies upon <code><link linkend="function-resolve-href">tan:resolve-href</link></code> .</para></section>
<section xml:id="function-get-1st-doc"><title><code>tan:get-1st-doc()</code></title><para><code>tan:get-1st-doc($TAN-elements as element()*) as document-node()*</code></para><para> Input: any TAN elements naming files (e.g., <code><link linkend="element-source">&lt;source&gt;</link></code>, <code><link linkend="element-see-also">&lt;see-also&gt;</link></code>, <code><link linkend="element-inclusion">&lt;inclusion&gt;</link></code>, <code><link linkend="element-key">&lt;key&gt;</link></code>; an indication whether some basic errors should be checked if the retrieved file is a TAN document </para><para> Output: the first document available for each element, plus/or any relevant error messages. </para><para>Used by variable <code><link linkend="variable-inclusions-1st-da">$inclusions-1st-da</link></code> <code><link linkend="variable-keys-1st-da">$keys-1st-da</link></code> <code><link linkend="variable-sources-1st-da">$sources-1st-da</link></code> <code><link linkend="variable-see-alsos-1st-da">$see-alsos-1st-da</link></code> <code><link linkend="variable-morphologies-1st-da">$morphologies-1st-da</link></code></para><para>Used by template <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-class-2-expansion-verbose">ŧ class-2-expansion-verbose</link></code> <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="template-resolve-href">ŧ resolve-href</link></code> <code><link linkend="function-class-number">tan:class-number</link></code> <code><link linkend="function-tan-type">tan:tan-type</link></code> <code><link linkend="function-first-loc-available">tan:first-loc-available</link></code> <code><link linkend="function-uri-relative-to">tan:uri-relative-to</link></code> <code><link linkend="function-resolve-href">tan:resolve-href</link></code> <code><link linkend="function-base-uri">tan:base-uri</link></code> .</para></section>
<section xml:id="function-get-doc-hist"><title><code>tan:get-doc-hist()</code></title><para><code>tan:get-doc-hist($TAN-doc as document-node()*) as element()*</code></para><para> Input: any TAN document </para><para> Output: a sequence of elements with <code><link linkend="attribute-when">@when</link></code>, <code><link linkend="attribute-ed-when">@ed-when</link></code>, and <code><link linkend="attribute-when-accessed">@when-accessed</link></code>, sorted from most recent to least; each element includes <code>@when-sort</code>, a decimal that represents the value of the most recent time-date stamp in that element </para><para>Used by template <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code></para><para>Relies upon <code><link linkend="function-dateTime-to-decimal">tan:dateTime-to-decimal</link></code> .</para></section>
<section xml:id="function-get-via-q-ref"><title><code>tan:get-via-q-ref()</code></title><para><code>tan:get-via-q-ref($q-ref as xs:string*, $q-reffed-document as document-node()*) as node()*</code></para><para> Input: any number of qrefs, any number of q-reffed documents </para><para> Output: the elements corresponding to the q-refs </para><para> This function is used by the core validation routine, especially to associate errors in included elements with the primary including element </para><para>Used by template <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code> <code><link linkend="template-class-2-expansion-normal">ŧ class-2-expansion-normal</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-glossary"><title><code>tan:glossary()</code></title><para><emphasis>Option 1 (TAN-core-functions)</emphasis></para><para><code>tan:glossary($element-that-takes-attribute-which as item()) as element()*</code></para><para> one-parameter version of the master one, below </para><para>Used by variable <code><link linkend="variable-relationship-keywords-for-tan-files">$relationship-keywords-for-tan-files</link></code></para><para>Used by template <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code></para><para>Used by function <code><link linkend="function-glossary">tan:glossary</link></code>()</para><para>Relies upon <code><link linkend="function-glossary">tan:glossary</link></code> <code><link linkend="variable-keys-1st-da">$keys-1st-da</link></code> .</para><para><emphasis>Option 2 (TAN-core-functions)</emphasis></para><para><code>tan:glossary($element-that-takes-attribute-which as item(), $extra-TAN-keys-expanded as document-node()*, $group-name-alter as xs:string?) as element()*</code></para><para> Input: any element that has <code><link linkend="attribute-which">@which</link></code> (or a string value of the name of an element that takes <code><link linkend="attribute-which">@which</link></code>); any TAN-key documents (expanded) other than the standard TAN ones; and an optional name that restricts the search to a particular group </para><para> Output: the keyword <code>&lt;items&gt;</code> (most of which contain <code><link linkend="element-IRI">&lt;IRI&gt;</link></code>, <code><link linkend="element-name">&lt;name&gt;</link></code>, and <code><link linkend="element-desc">&lt;desc&gt;</link></code>) that are valid definitions for the element in question, filtered by matches on <code><link linkend="attribute-which">@which</link></code>, if present in the first parameter </para><para>Used by variable <code><link linkend="variable-relationship-keywords-for-tan-files">$relationship-keywords-for-tan-files</link></code></para><para>Used by template <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code></para><para>Used by function <code><link linkend="function-glossary">tan:glossary</link></code>()</para><para>Relies upon <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code> .</para></section>
<section xml:id="function-group-elements-by-shared-node-values"><title><code>tan:group-elements-by-shared-node-values()</code></title><para><emphasis>Option 1 (TAN-core-functions)</emphasis></para><para><code>tan:group-elements-by-shared-node-values($elements-to-group as element()*) as element()*</code></para><para> One-parameter version of the fuller one below.  </para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-merge-divs">ŧ merge-divs</link></code> <code><link linkend="template-merge-divs">ŧ merge-divs</link></code></para><para>Used by function <code><link linkend="function-group-elements-by-shared-node-values">tan:group-elements-by-shared-node-values</link></code>()</para><para>Relies upon <code><link linkend="function-group-elements-by-shared-node-values">tan:group-elements-by-shared-node-values</link></code> .</para><para><emphasis>Option 2 (TAN-core-functions)</emphasis></para><para><code>tan:group-elements-by-shared-node-values($elements-to-group as element()*, $regex-of-names-of-nodes-to-group-by as xs:string?) as element()*</code></para><para> Input: a sequence of elements; an optional string representing the name of children in the elements </para><para> Output: the same elements, but grouped in <code><link linkend="element-group">&lt;group&gt;</link></code> according to whether the text contents of the child elements specified are equal </para><para> Each <code><link linkend="element-group">&lt;group&gt;</link></code> will have an <code><link linkend="attribute-n">@n</link></code> stipulating the position of the first element put in the group. That way the results can be sorted in order of their original elements </para><para> Transitivity is assumed. If suppose elements X, Y, and Z have children values A and B; B and C; and C and D, respectively. All three elements will be grouped, even though Y and Z do not share children values directly.  </para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-merge-divs">ŧ merge-divs</link></code> <code><link linkend="template-merge-divs">ŧ merge-divs</link></code></para><para>Used by function <code><link linkend="function-group-elements-by-shared-node-values">tan:group-elements-by-shared-node-values</link></code>()</para><para>Relies upon <code><link linkend="function-group-elements-by-shared-node-values-loop">tan:group-elements-by-shared-node-values-loop</link></code> .</para></section>
<section xml:id="function-group-elements-by-shared-node-values-loop"><title><code>tan:group-elements-by-shared-node-values-loop()</code></title><para><code>tan:group-elements-by-shared-node-values-loop($elements-to-group as element()*, $regex-of-names-of-nodes-to-group-by as xs:string?, $groups-so-far as element()*) as element()*</code></para><para> Supporting loop function of the one above. </para><para>Used by function <code><link linkend="function-group-elements-by-shared-node-values">tan:group-elements-by-shared-node-values</link></code>() <code><link linkend="function-group-elements-by-shared-node-values-loop">tan:group-elements-by-shared-node-values-loop</link></code>()</para><para>Relies upon <code><link linkend="function-group-elements-by-shared-node-values-loop">tan:group-elements-by-shared-node-values-loop</link></code> .</para></section>
<section xml:id="function-letter-to-number"><title><code>tan:letter-to-number()</code></title><para><code>tan:letter-to-number($numerical-letters as xs:anyAtomicType*) as xs:integer*</code></para><para> Input: any sequence of strings that represent alphabetic numerals </para><para> Output: those numerals </para><para> Works only for letter patterns that have been defined; anything else produces null results </para><para>Used by template <code><link linkend="template-string-to-numerals">ŧ string-to-numerals</link></code></para><para>Used by function <code><link linkend="function-grc-to-int">tan:grc-to-int</link></code>() <code><link linkend="function-syr-to-int">tan:syr-to-int</link></code>()</para><para>Relies upon <code><link linkend="variable-arabic-indic-numeral-pattern">$arabic-indic-numeral-pattern</link></code> <code><link linkend="function-ara-to-int">tan:ara-to-int</link></code> <code><link linkend="variable-alphabet-numeral-key">$alphabet-numeral-key</link></code> .</para></section>
<section xml:id="function-merge-expanded-docs"><title><code>tan:merge-expanded-docs()</code></title><para><code>tan:merge-expanded-docs($expanded-docs as document-node()*) as document-node()?</code></para><para> Input: Any TAN documents that have been expanded at least tersely </para><para> Output: A document that is a collation of the documents. There is one <code><link linkend="element-head">&lt;head&gt;</link></code> per source, but only one <code><link linkend="element-body">&lt;body&gt;</link></code>, with contents merged. </para><para> Class 1 merging: All <code><link linkend="element-div">&lt;div&gt;</link></code>s with the same <code>&lt;ref&gt;</code> values are grouped together. If the class 1 files are sources of a class 2 file, it is assumed that all actions in the <code><link linkend="element-alter">&lt;alter&gt;</link></code> have been performed. </para><para> Class 2 merging: TBD </para><para> Class 3 merging: TBD </para><para> NB: Class 1 files should have their hierarchies in proper order; use reset-hierarchy beforehand if you're unsure </para><para>Used by template <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code></para><para>Relies upon <code><link linkend="function-tan-type">tan:tan-type</link></code> <code><link linkend="template-merge-expanded-docs-prep">ŧ merge-expanded-docs-prep</link></code> <code><link linkend="template-merge-divs">ŧ merge-divs</link></code> .</para></section>
<section xml:id="function-most-recent-dateTime"><title><code>tan:most-recent-dateTime()</code></title><para><code>tan:most-recent-dateTime($dateTimes as item()*) as item()?</code></para><para> Input: a series of ISO-compliant date or dateTimes </para><para> Output: the most recent one </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-dateTime-to-decimal">tan:dateTime-to-decimal</link></code> .</para></section>
<section xml:id="function-must-refer-to-external-tan-file"><title><code>tan:must-refer-to-external-tan-file()</code></title><para><code>tan:must-refer-to-external-tan-file($node as node()) as xs:boolean</code></para><para> Input: node in a TAN document. </para><para> Output: boolean value indicating whether the node or its parent must name or refer to a TAN file. </para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code></para><para>Relies upon <code><link linkend="function-class-number">tan:class-number</link></code> <code><link linkend="variable-elements-that-must-always-refer-to-tan-files">$elements-that-must-always-refer-to-tan-files</link></code> <code><link linkend="variable-relationship-keywords-for-tan-files">$relationship-keywords-for-tan-files</link></code> .</para></section>
<section xml:id="function-normalize-sequence"><title><code>tan:normalize-sequence()</code></title><para><code>tan:normalize-sequence($sequence-string as xs:string?, $attribute-name as xs:string) as xs:string?</code></para><para> Input: any string representing a sequence; the name of the attribute whence the value, i.e., <code><link linkend="attribute-ref">@ref</link></code>, <code><link linkend="attribute-pos">@pos</link></code>, <code><link linkend="attribute-chars">@chars</link></code>, <code><link linkend="attribute-n">@n</link></code> </para><para> Output: the string, normalized such that items may be found by tokenizing on ' , ' and parts of ranges on ' - ' </para><para> Note, this function does nothing to analyze or convert types of numerals, and all help requests are left intact </para><para> Here we're targeting <code>tan:analyze-elements-with-numeral-attributes(</code>) template mode arabic-numerals, prelude to <code>tan:sequence-expand(</code>), <code>tan:normalize-refs(</code>) </para><para>Used by function <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link></code>() <code><link linkend="function-expand-numerical-sequence">tan:expand-numerical-sequence</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-pluck"><title><code>tan:pluck()</code></title><para><code>tan:pluck($fragment as item()*, $pluck-beyond-level as xs:integer, $keep-short-branch-leaves as xs:boolean) as item()*</code></para><para> Input: any document fragment or element; a number indicating a level in the hierarchy of the fragment; a boolean indicating whether leaf elements that fall short of the previous parameter should be included </para><para> Output: the fragment of the tree that is beyond the point indicated, and perhaps (depending upon the third parameter) with other leafs that are not quite at that level </para><para> This function was written primarily to serve <code>tan:convert-ref-to-div-fragment(</code>), to get a slice of divs that correspond to a range, without the ancestry of those divs </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-pluck">ŧ pluck</link></code> .</para></section>
<section xml:id="function-q-ref"><title><code>tan:q-ref()</code></title><para><code>tan:q-ref($elements as element()*) as xs:string*</code></para><para> Input: any elements </para><para> Output: the q-ref of each element</para><para> A q-ref is defined as a concatenated string  consisting of, for each ancestor and self, the name plus the number indicating which sibling it is of that type of element. </para><para> This function is useful when trying to correlate an unbreadmarked file (an original TAN file) against its breadcrumbed counterpart (e.g., <code><link linkend="variable-self-resolved">$self-resolved</link></code>), to check for errors. If any changes in element names, e.g., TEI - &gt; TAN-T, are made during the standard preparation process, those changes are made here as well. </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-rom-to-int"><title><code>tan:rom-to-int()</code></title><para><code>tan:rom-to-int($arg as xs:string*) as xs:integer*</code></para><para> Input: any roman numeral less than 5000 </para><para> Output: the numeral converted to an integer </para><para>Used by template <code><link linkend="template-string-to-numerals">ŧ string-to-numerals</link></code></para><para>Relies upon <code><link linkend="variable-roman-numeral-pattern">$roman-numeral-pattern</link></code> .</para></section>
<section xml:id="function-sequence-collapse"><title><code>tan:sequence-collapse()</code></title><para><code>tan:sequence-collapse($integers as xs:integer*) as xs:string?</code></para><para> Input: a sequence of integers </para><para> Output: a string that puts them in a TAN-like compact string </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-sequence-error"><title><code>tan:sequence-error()</code></title><para><emphasis>Option 1 (TAN-core-functions)</emphasis></para><para><code>tan:sequence-error($results-of-sequence-expand as xs:integer*) as element()*</code></para><para>Used by function <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link></code>() <code><link linkend="function-sequence-error">tan:sequence-error</link></code>()</para><para>Relies upon <code><link linkend="function-sequence-error">tan:sequence-error</link></code> .</para><para><emphasis>Option 2 (TAN-core-functions)</emphasis></para><para><code>tan:sequence-error($results-of-sequence-expand as xs:integer*, $message as xs:string?) as element()*</code></para><para> Input: any results of the function <code>tan:sequence-expand(</code>) </para><para> Output: error nodes, if any </para><para>Used by function <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link></code>() <code><link linkend="function-sequence-error">tan:sequence-error</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> .</para></section>
<section xml:id="function-shallow-copy"><title><code>tan:shallow-copy()</code></title><para><emphasis>Option 1 (TAN-core-functions)</emphasis></para><para><code>tan:shallow-copy($elements as element()*) as element()*</code></para><para> one-parameter version of the fuller one, below </para><para>Used by template <code><link linkend="template-dependency-expansion-terse">ŧ dependency-expansion-terse</link></code> <code><link linkend="template-dependencies-tokenized-selectively">ŧ dependencies-tokenized-selectively</link></code></para><para>Used by function <code><link linkend="function-shallow-copy">tan:shallow-copy</link></code>() <code><link linkend="function-error">tan:error</link></code>()</para><para>Relies upon <code><link linkend="function-shallow-copy">tan:shallow-copy</link></code> .</para><para><emphasis>Option 2 (TAN-core-functions)</emphasis></para><para><code>tan:shallow-copy($elements as element()*, $keep-attributes as xs:boolean) as element()*</code></para><para> Input: any document fragment; boolean indicating whether attributes should be kept </para><para> Output: a shallow copy of the fragment, perhaps with attributes </para><para>Used by template <code><link linkend="template-dependency-expansion-terse">ŧ dependency-expansion-terse</link></code> <code><link linkend="template-dependencies-tokenized-selectively">ŧ dependencies-tokenized-selectively</link></code></para><para>Used by function <code><link linkend="function-shallow-copy">tan:shallow-copy</link></code>() <code><link linkend="function-error">tan:error</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-string-to-int"><title><code>tan:string-to-int()</code></title><para><code>tan:string-to-int($string as xs:string?) as xs:integer*</code></para><para> Companion fonction to <code><link linkend="function-string-to-numerals">tan:string-to-numerals</link></code>() </para><para> Returns only those results that can be evaluated as integers </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-string-to-numerals">tan:string-to-numerals</link></code> .</para></section>
<section xml:id="function-string-to-numerals"><title><code>tan:string-to-numerals()</code></title><para><emphasis>Option 1 (TAN-core-functions)</emphasis></para><para><code>tan:string-to-numerals($string-to-analyze as xs:string?) as xs:string*</code></para><para> one-parameter version of the function below </para><para>Used by template <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-core-resolution-arabic-numerals">ŧ core-resolution-arabic-numerals</link></code></para><para>Used by function <code><link linkend="function-string-to-numerals">tan:string-to-numerals</link></code>() <code><link linkend="function-string-to-int">tan:string-to-int</link></code>()</para><para>Relies upon <code><link linkend="function-string-to-numerals">tan:string-to-numerals</link></code> .</para><para><emphasis>Option 2 (TAN-core-functions)</emphasis></para><para><code>tan:string-to-numerals($string-to-analyze as xs:string?, $ambig-is-roman as xs:boolean?, $return-only-numerals as xs:boolean?) as xs:string*</code></para><para> Input: a string thought to contain numerals of some type (e.g., Roman); a boolean indicating whether ambiguous letters should be treated as Roman numerals or letter numerals; a boolean indicating whether only numeral matches should be returned </para><para> Output: the string with parts that look like numerals converted to Arabic numerals </para><para> Does not take into account requests for help </para><para>Used by template <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-core-resolution-arabic-numerals">ŧ core-resolution-arabic-numerals</link></code></para><para>Used by function <code><link linkend="function-string-to-numerals">tan:string-to-numerals</link></code>() <code><link linkend="function-string-to-int">tan:string-to-int</link></code>()</para><para>Relies upon <code><link linkend="function-analyze-numbers-in-string">tan:analyze-numbers-in-string</link></code> .</para></section>
<section xml:id="function-tan-type"><title><code>tan:tan-type()</code></title><para><code>tan:tan-type($nodes as node()*) as xs:string*</code></para><para> Input: any nodes </para><para> Output: the names of the root elements; if not present, a zero-length string is returned </para><para>Used by function <code><link linkend="function-class-number">tan:class-number</link></code>() <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code>() <code><link linkend="function-merge-expanded-docs">tan:merge-expanded-docs</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-uri-directory"><title><code>tan:uri-directory()</code></title><para><code>tan:uri-directory($uris as xs:string*) as xs:string*</code></para><para> Input: any URIs, as strings </para><para> Output: the file path </para><para> NB, this function does not assume any URIs have been resolved </para><para>Used by variable <code><link linkend="variable-doc-parent-directory">$doc-parent-directory</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-uri-relative-to"><title><code>tan:uri-relative-to()</code></title><para><code>tan:uri-relative-to($uri-to-revise as xs:string?, $uri-to-revise-against as xs:string?) as xs:string?</code></para><para> Input: two strings representing URIs </para><para> Output: the first string resolved relative to the second string </para><para> This function looks for common paths within two absolute URIs and tries to convert the first URI as a relative path </para><para>Used by template <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code></para><para>Used by function <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-value-of"><title><code>tan:value-of()</code></title><para><code>tan:value-of($items as item()*) as xs:string?</code></para><para> Input: any sequence of items </para><para> Output: the value of each item </para><para> Proxy for &lt;xsl:value-of/&gt;. Useful as a function in XPath expressions </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-xml-to-string"><title><code>tan:xml-to-string()</code></title><para><emphasis>Option 1 (TAN-core-functions)</emphasis></para><para><code>tan:xml-to-string($fragment as item()*) as xs:string?</code></para><para>Used by template <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code></para><para>Used by function <code><link linkend="function-xml-to-string">tan:xml-to-string</link></code>()</para><para>Relies upon <code><link linkend="function-xml-to-string">tan:xml-to-string</link></code> .</para><para><emphasis>Option 2 (TAN-core-functions)</emphasis></para><para><code>tan:xml-to-string($fragment as item()*, $ignore-whitespace-text-nodes as xs:boolean) as xs:string?</code></para><para> Input: any fragment of XML; boolean indicating whether whitespace nodes should be ignored </para><para> Output: a string representation of the fragment </para><para> This function is used to represent XML fragments in a plain text message, useful in validation reports or in generating guidelines </para><para>Used by template <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code></para><para>Used by function <code><link linkend="function-xml-to-string">tan:xml-to-string</link></code>()</para><para>Relies upon <code><link linkend="template-fragment-to-text">ŧ fragment-to-text</link></code> .</para></section>
</section>
</section>
<section><title>TAN-core-errors global variables, keys, and functions summarized</title><section><title>variables</title><section xml:id="variable-errors"><title><code>$errors</code></title><para>Definition: <code>doc('TAN-errors.xml')</code></para><para>Used by variable <code><link linkend="variable-errors-to-squelch">$errors-to-squelch</link></code></para><para>Used by template <code><link linkend="template-element-to-error">ŧ element-to-error</link></code></para><para>Used by function <code><link linkend="function-error">tan:error</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-errors-to-squelch"><title><code>$errors-to-squelch</code></title><para>Definition: <code><link linkend="variable-errors">$errors</link>/tan:errors/tan:squelch[@phase = $validation-phase]/tan:error-id</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-errors">$errors</link></code> .</para></section>
<section xml:id="variable-help-trigger-regex"><title><code>$help-trigger-regex</code></title><para>Definition: <code><link linkend="function-escape">tan:escape</link>($help-trigger)</code></para><para>Used by function <code><link linkend="function-normalize-text">tan:normalize-text</link></code>() <code><link linkend="function-help-extracted">tan:help-extracted</link></code>()</para><para>Relies upon <code><link linkend="function-escape">tan:escape</link></code> .</para></section>
</section>
<section><title>functions</title><section xml:id="function-error"><title><code>tan:error()</code></title><para><emphasis>Option 1 (TAN-core-errors)</emphasis></para><para><code>tan:error($idref as xs:string) as element()?</code></para><para> one-parameter function of the master version, below </para><para>Used by variable <code><link linkend="variable-erroneously-looped-doc">$erroneously-looped-doc</link></code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-class-2-expansion-terse-pass-2">ŧ class-2-expansion-terse-pass-2</link></code> <code><link linkend="template-class-2-expansion-terse-pass-2">ŧ class-2-expansion-terse-pass-2</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-expansion-terse-no-alter <code><link linkend="template-dependency-expansion-terse">ŧ dependency-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-expansion-terse normalize-tei-space <code><link linkend="template-dependencies-tokenized-selectively">ŧ dependencies-tokenized-selectively</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-dependency-expansion-normal">ŧ dependency-expansion-normal</link></code> <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-class-2-expansion-normal">ŧ class-2-expansion-normal</link></code> <code><link linkend="template-class-2-expansion-verbose">ŧ class-2-expansion-verbose</link></code> <code><link linkend="template-dependency-expansion-terse">ŧ dependency-expansion-terse</link></code> core-expansion-terse <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code> <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code> <code><link linkend="template-core-expansion-terse-alias">ŧ core-expansion-terse-alias</link></code> dependency-expansion-terse <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-catalog-expansion-terse">ŧ catalog-expansion-terse</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> dependency-expansion-normal <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-expand-tan-key-dependencies">ŧ expand-tan-key-dependencies</link></code> core-expansion-terse <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code> <code><link linkend="template-resolve-attr-include">ŧ resolve-attr-include</link></code> <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code></para><para>Used by function <code><link linkend="function-merge-analyzed-stats">tan:merge-analyzed-stats</link></code>() <code><link linkend="function-resolve-alias-loop">tan:resolve-alias-loop</link></code>() <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link></code>() <code><link linkend="function-sequence-error">tan:sequence-error</link></code>() <code><link linkend="function-definition">tan:definition</link></code>() <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>() <code><link linkend="function-error">tan:error</link></code>() <code><link linkend="function-error">tan:error</link></code>() <code><link linkend="function-error">tan:error</link></code>() <code><link linkend="function-error-report">tan:error-report</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> .</para><para><emphasis>Option 2 (TAN-core-errors)</emphasis></para><para><code>tan:error($idref as xs:string, $diagnostic-message as item()*) as element()?</code></para><para> two-parameter function of the master version, below </para><para>Used by variable <code><link linkend="variable-erroneously-looped-doc">$erroneously-looped-doc</link></code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-class-2-expansion-terse-pass-2">ŧ class-2-expansion-terse-pass-2</link></code> <code><link linkend="template-class-2-expansion-terse-pass-2">ŧ class-2-expansion-terse-pass-2</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-expansion-terse-no-alter <code><link linkend="template-dependency-expansion-terse">ŧ dependency-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-expansion-terse normalize-tei-space <code><link linkend="template-dependencies-tokenized-selectively">ŧ dependencies-tokenized-selectively</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-dependency-expansion-normal">ŧ dependency-expansion-normal</link></code> <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-class-2-expansion-normal">ŧ class-2-expansion-normal</link></code> <code><link linkend="template-class-2-expansion-verbose">ŧ class-2-expansion-verbose</link></code> <code><link linkend="template-dependency-expansion-terse">ŧ dependency-expansion-terse</link></code> core-expansion-terse <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code> <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code> <code><link linkend="template-core-expansion-terse-alias">ŧ core-expansion-terse-alias</link></code> dependency-expansion-terse <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-catalog-expansion-terse">ŧ catalog-expansion-terse</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> dependency-expansion-normal <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-expand-tan-key-dependencies">ŧ expand-tan-key-dependencies</link></code> core-expansion-terse <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code> <code><link linkend="template-resolve-attr-include">ŧ resolve-attr-include</link></code> <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code></para><para>Used by function <code><link linkend="function-merge-analyzed-stats">tan:merge-analyzed-stats</link></code>() <code><link linkend="function-resolve-alias-loop">tan:resolve-alias-loop</link></code>() <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link></code>() <code><link linkend="function-sequence-error">tan:sequence-error</link></code>() <code><link linkend="function-definition">tan:definition</link></code>() <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>() <code><link linkend="function-error">tan:error</link></code>() <code><link linkend="function-error">tan:error</link></code>() <code><link linkend="function-error">tan:error</link></code>() <code><link linkend="function-error-report">tan:error-report</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> .</para><para><emphasis>Option 3 (TAN-core-errors)</emphasis></para><para><code>tan:error($idref as xs:string, $diagnostic-message as item()*, $fix as item()*, $fix-type as xs:string?) as element()?</code></para><para> four-parameter function of the master version, below </para><para>Used by variable <code><link linkend="variable-erroneously-looped-doc">$erroneously-looped-doc</link></code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-class-2-expansion-terse-pass-2">ŧ class-2-expansion-terse-pass-2</link></code> <code><link linkend="template-class-2-expansion-terse-pass-2">ŧ class-2-expansion-terse-pass-2</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-expansion-terse-no-alter <code><link linkend="template-dependency-expansion-terse">ŧ dependency-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-expansion-terse normalize-tei-space <code><link linkend="template-dependencies-tokenized-selectively">ŧ dependencies-tokenized-selectively</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-dependency-expansion-normal">ŧ dependency-expansion-normal</link></code> <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-class-2-expansion-normal">ŧ class-2-expansion-normal</link></code> <code><link linkend="template-class-2-expansion-verbose">ŧ class-2-expansion-verbose</link></code> <code><link linkend="template-dependency-expansion-terse">ŧ dependency-expansion-terse</link></code> core-expansion-terse <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code> <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code> <code><link linkend="template-core-expansion-terse-alias">ŧ core-expansion-terse-alias</link></code> dependency-expansion-terse <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-catalog-expansion-terse">ŧ catalog-expansion-terse</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> dependency-expansion-normal <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-expand-tan-key-dependencies">ŧ expand-tan-key-dependencies</link></code> core-expansion-terse <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code> <code><link linkend="template-resolve-attr-include">ŧ resolve-attr-include</link></code> <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code></para><para>Used by function <code><link linkend="function-merge-analyzed-stats">tan:merge-analyzed-stats</link></code>() <code><link linkend="function-resolve-alias-loop">tan:resolve-alias-loop</link></code>() <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link></code>() <code><link linkend="function-sequence-error">tan:sequence-error</link></code>() <code><link linkend="function-definition">tan:definition</link></code>() <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>() <code><link linkend="function-error">tan:error</link></code>() <code><link linkend="function-error">tan:error</link></code>() <code><link linkend="function-error">tan:error</link></code>() <code><link linkend="function-error-report">tan:error-report</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> .</para><para><emphasis>Option 4 (TAN-core-errors)</emphasis></para><para><code>tan:error($idref as xs:string, $diagnostic-message as item()*, $fix as item()*, $fix-type as xs:string?, $elements-that-caused-this-error as element()*) as element()?</code></para><para> Input: idref of an error, and optional diagnostic messages </para><para>  Output: the appropriate <code>&lt;error&gt;</code> with each diagnostic inserted as a child <code>&lt;message&gt;</code> </para><para>Used by variable <code><link linkend="variable-erroneously-looped-doc">$erroneously-looped-doc</link></code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-class-2-expansion-terse-pass-2">ŧ class-2-expansion-terse-pass-2</link></code> <code><link linkend="template-class-2-expansion-terse-pass-2">ŧ class-2-expansion-terse-pass-2</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-expansion-terse-no-alter <code><link linkend="template-dependency-expansion-terse">ŧ dependency-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-expansion-terse normalize-tei-space <code><link linkend="template-dependencies-tokenized-selectively">ŧ dependencies-tokenized-selectively</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-dependency-expansion-normal">ŧ dependency-expansion-normal</link></code> <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-class-2-expansion-normal">ŧ class-2-expansion-normal</link></code> <code><link linkend="template-class-2-expansion-verbose">ŧ class-2-expansion-verbose</link></code> <code><link linkend="template-dependency-expansion-terse">ŧ dependency-expansion-terse</link></code> core-expansion-terse <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code> <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code> <code><link linkend="template-core-expansion-terse-alias">ŧ core-expansion-terse-alias</link></code> dependency-expansion-terse <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-catalog-expansion-terse">ŧ catalog-expansion-terse</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> dependency-expansion-normal <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-expand-tan-key-dependencies">ŧ expand-tan-key-dependencies</link></code> core-expansion-terse <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code> <code><link linkend="template-resolve-attr-include">ŧ resolve-attr-include</link></code> <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code></para><para>Used by function <code><link linkend="function-merge-analyzed-stats">tan:merge-analyzed-stats</link></code>() <code><link linkend="function-resolve-alias-loop">tan:resolve-alias-loop</link></code>() <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link></code>() <code><link linkend="function-sequence-error">tan:sequence-error</link></code>() <code><link linkend="function-definition">tan:definition</link></code>() <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>() <code><link linkend="function-error">tan:error</link></code>() <code><link linkend="function-error">tan:error</link></code>() <code><link linkend="function-error">tan:error</link></code>() <code><link linkend="function-error-report">tan:error-report</link></code>()</para><para>Relies upon <code><link linkend="variable-errors">$errors</link></code> <code><link linkend="function-fix">tan:fix</link></code> <code><link linkend="function-shallow-copy">tan:shallow-copy</link></code> .</para></section>
<section xml:id="function-error-report"><title><code>tan:error-report()</code></title><para><code>tan:error-report($error as item()*) as xs:string*</code></para><para> Input: <code>&lt;error&gt;</code>s or strings corresponding to an error id </para><para> Output: a sequence of strings to be reported to the user </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> .</para></section>
<section xml:id="function-fix"><title><code>tan:fix()</code></title><para><code>tan:fix($fix as item()*, $fix-type as xs:string?) as element()?</code></para><para> Input: any items; a string representing a fix type </para><para> Ouput: a tan:fix element with <code><link linkend="attribute-type">@type</link></code> </para><para> This function is used to populate a file with material to be used by Schematron Quick Fixes </para><para>Used by template <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code></para><para>Used by function <code><link linkend="function-error">tan:error</link></code>() <code><link linkend="function-help-or-info">tan:help-or-info</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-help"><title><code>tan:help()</code></title><para><code>tan:help($diagnostic-message as item()*, $fix as item()*, $fix-type as xs:string?) as element()</code></para><para>Used by template <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code> <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code></para><para>Relies upon <code><link linkend="function-help-or-info">tan:help-or-info</link></code> .</para></section>
<section xml:id="function-help-extracted"><title><code>tan:help-extracted()</code></title><para><code>tan:help-extracted($strings-to-check as xs:string*) as element()*</code></para><para> Input: any strings </para><para> Output: one element per string, with <code><link linkend="attribute-help">@help</link></code> if help has been requested, and containing the value of the string after the help request has been removed. </para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-dependency-expansion-terse">ŧ dependency-expansion-terse</link></code> core-expansion-terse <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code> <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code></para><para>Used by function <code><link linkend="function-resolve-alias-loop">tan:resolve-alias-loop</link></code>() <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link></code>()</para><para>Relies upon <code><link linkend="variable-help-trigger-regex">$help-trigger-regex</link></code> .</para></section>
<section xml:id="function-help-or-info"><title><code>tan:help-or-info()</code></title><para><code>tan:help-or-info($diagnostic-message as item()*, $fix as item()*, $fix-type as xs:string?, $is-info as xs:boolean) as element()</code></para><para> Input: a sequence of items to populate a message, a series of items to be used in a SQFix, and a boolean value indicating whether the output element should be named info (rather than help) </para><para> Output: an element with the appropriate help or info message </para><para>Used by function <code><link linkend="function-help">tan:help</link></code>() <code><link linkend="function-info">tan:info</link></code>()</para><para>Relies upon <code><link linkend="function-fix">tan:fix</link></code> .</para></section>
<section xml:id="function-info"><title><code>tan:info()</code></title><para><code>tan:info($diagnostic-message as item()*, $fix as item()*, $fix-type as xs:string?) as element()</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-help-or-info">tan:help-or-info</link></code> .</para></section>
</section>
</section>
<section><title>TAN-core-resolve global variables, keys, and functions summarized</title><section><title>functions</title><section xml:id="function-prepend-id-or-idrefs"><title><code>tan:prepend-id-or-idrefs()</code></title><para><code>tan:prepend-id-or-idrefs($elements-with-id-or-id-refs as element(), $string-to-prepend as xs:string?) as element()*</code></para><para> Input: any elements with <code><link linkend="attribute-xmlid">@xml:id</link></code> or an attribute that points to an element with an <code><link linkend="attribute-xmlid">@xml:id</link></code> value; some string that should be prepended to every value of every attribute found</para><para> Output: the same elements, but with each value prepended with the string and a double hyphen </para><para> This function is critical for disambiguating during the inclusion process. </para><para>Used by template <code><link linkend="template-resolve-attr-include">ŧ resolve-attr-include</link></code></para><para>Relies upon <code><link linkend="template-prepend-id-or-idrefs">ŧ prepend-id-or-idrefs</link></code> .</para></section>
<section xml:id="function-resolve-doc"><title><code>tan:resolve-doc()</code></title><para><emphasis>Option 1 (TAN-core-resolve-functions)</emphasis></para><para><code>tan:resolve-doc($TAN-documents as document-node()*) as document-node()*</code></para><para> one-parameter version of the fuller one, below </para><para>Used by variable <code><link linkend="variable-self-resolved">$self-resolved</link></code> <code><link linkend="variable-inclusions-resolved">$inclusions-resolved</link></code> <code><link linkend="variable-keys-resolved">$keys-resolved</link></code> <code><link linkend="variable-sources-resolved">$sources-resolved</link></code> <code><link linkend="variable-see-alsos-resolved">$see-alsos-resolved</link></code> <code><link linkend="variable-morphologies-resolved">$morphologies-resolved</link></code></para><para>Used by template <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>()</para><para>Relies upon <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> .</para><para><emphasis>Option 2 (TAN-core-resolve-functions)</emphasis></para><para><code>tan:resolve-doc($TAN-documents as document-node()*, $leave-breadcrumbs as xs:boolean, $add-attr-to-root-element-named-what as xs:string?, $add-what-val-to-new-root-attribute as xs:string*, $restrict-inclusion-to-what-element-names as xs:string*, $doc-ids-already-checked as xs:string*) as document-node()*</code></para><para> Input: any number of TAN documents; boolean indicating whether documents should be breadcrumbed or not; optional name of an attribute and a sequence of strings to stamp in each document's root element as a way of providing another identifier for the document; a list of element names to which any inclusion should be restricted; a list of ids for documents that should not be used to generate inclusions.</para><para>      Output: those same documents, resolved, along the following steps:</para><para>           a. Stamp each document with <code>@base-uri</code> and the optional root attribute; resolve <code><link linkend="attribute-href">@href</link></code>, putting the original (if different) in <code>@orig-href</code></para><para>           b. Normalize <code><link linkend="attribute-ref">@ref</link></code> and <code><link linkend="attribute-n">@n</link></code>, converting them whenever possible to Arabic numerals, and keeping the old versions as <code>@orig-ref</code> and <code>@orig-n</code>; if <code><link linkend="attribute-n">@n</link></code> is a range or series, it will be expanded</para><para>           c. Resolve every element that has <code>@include.</code></para><para>           d. Resolve every element that has <code>@which.</code></para><para>           e. If anything happened at #3, remove any duplicate elements. </para><para> This function and the functions connected with it are among the most important in the TAN library, since they provide critical stamping (for validation and diagnosing problems) and expand abbreviated parts (to explicitly state what is implied by <code><link linkend="attribute-include">@include</link></code> and <code><link linkend="attribute-which">@which</link></code>) of a TAN file. Perhaps more importantly, it is a recursive function that is used to resolve not only the beginning of the inclusion process but its middle and endpoints as well. </para><para>Used by variable <code><link linkend="variable-self-resolved">$self-resolved</link></code> <code><link linkend="variable-inclusions-resolved">$inclusions-resolved</link></code> <code><link linkend="variable-keys-resolved">$keys-resolved</link></code> <code><link linkend="variable-sources-resolved">$sources-resolved</link></code> <code><link linkend="variable-see-alsos-resolved">$see-alsos-resolved</link></code> <code><link linkend="variable-morphologies-resolved">$morphologies-resolved</link></code></para><para>Used by template <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>()</para><para>Relies upon <code><link linkend="function-strip-duplicates">tan:strip-duplicates</link></code> <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code> <code><link linkend="function-normalize-text">tan:normalize-text</link></code> <code><link linkend="template-expand-tan-key-dependencies">ŧ expand-tan-key-dependencies</link></code> <code><link linkend="template-resolve-attr-include">ŧ resolve-attr-include</link></code> <code><link linkend="template-core-resolution-arabic-numerals">ŧ core-resolution-arabic-numerals</link></code> <code><link linkend="template-first-stamp">ŧ first-stamp</link></code> <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code> <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> <code><link linkend="function-error">tan:error</link></code> .</para></section>
<section xml:id="function-resolve-href"><title><code>tan:resolve-href()</code></title><para><code>tan:resolve-href($items-with-href-attribute as item()*) as xs:string*</code></para><para> Input: any elements that have <code><link linkend="attribute-href">@href</link></code> </para><para> Output: <code><link linkend="attribute-href">@href</link></code> values resolved, as strings </para><para>Used by function <code><link linkend="function-first-loc-available">tan:first-loc-available</link></code>() <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code>()</para><para>Relies upon <code><link linkend="template-resolve-href">ŧ resolve-href</link></code> .</para></section>
<section xml:id="function-strip-duplicates"><title><code>tan:strip-duplicates()</code></title><para><code>tan:strip-duplicates($tan-docs as document-node()*, $element-names-to-check as xs:string*) as document-node()*</code></para><para> Input: any documents, sequence of strings of element names </para><para> Output: the same documents after removing duplicate elements whose names match the second parameter. </para><para> This function is applied during document resolution, to prune duplicate elements that might have been included </para><para>Used by function <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>()</para><para>Relies upon <code><link linkend="template-strip-duplicates">ŧ strip-duplicates</link></code> .</para></section>
</section>
</section>
<section><title>TAN-core-expand global variables, keys, and functions summarized</title><section><title>functions</title><section xml:id="function-expand-doc"><title><code>tan:expand-doc()</code></title><para><emphasis>Option 1 (TAN-core-expand-functions)</emphasis></para><para><code>tan:expand-doc($tan-doc-and-dependencies as document-node()*) as document-node()*</code></para><para> one-parameter version of the fuller one below </para><para>Used by variable <code><link linkend="variable-morphologies-expanded">$morphologies-expanded</link></code> <code><link linkend="variable-self-expanded">$self-expanded</link></code> <code><link linkend="variable-keys-expanded">$keys-expanded</link></code></para><para>Used by template <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>() <code><link linkend="function-expand-doc">tan:expand-doc</link></code>()</para><para>Relies upon <code><link linkend="function-expand-doc">tan:expand-doc</link></code> .</para><para><emphasis>Option 2 (TAN-core-expand-functions)</emphasis></para><para><code>tan:expand-doc($tan-doc-and-dependencies as document-node()*, $target-phase as xs:string) as document-node()*</code></para><para> Input: a tan document, a string indicating a phase of expansion, and for class-2 documents, any dependency class-1 files </para><para> Output: the document and its dependencies expanded at the phase indicated </para><para> Because class 2 files are expanded hand-in-glove with the class 1 files they depend upon, expansion is necessarily synchronized. The original class-2 document is the first document of the result, and the expanded class-1 files follow. </para><para>Used by variable <code><link linkend="variable-morphologies-expanded">$morphologies-expanded</link></code> <code><link linkend="variable-self-expanded">$self-expanded</link></code> <code><link linkend="variable-keys-expanded">$keys-expanded</link></code></para><para>Used by template <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>() <code><link linkend="function-expand-doc">tan:expand-doc</link></code>()</para><para>Relies upon <code><link linkend="template-core-expansion-terse-alias">ŧ core-expansion-terse-alias</link></code> <code><link linkend="template-class-2-expansion-verbose">ŧ class-2-expansion-verbose</link></code> <code><link linkend="function-class-number">tan:class-number</link></code> <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code> <code><link linkend="template-class-2-expansion-normal">ŧ class-2-expansion-normal</link></code> <code><link linkend="template-dependency-expansion-normal">ŧ dependency-expansion-normal</link></code> <code><link linkend="template-reset-hierarchy">ŧ reset-hierarchy</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code> <code><link linkend="template-dependencies-tokenized-selectively">ŧ dependencies-tokenized-selectively</link></code> <code><link linkend="template-dependency-expansion-terse">ŧ dependency-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code> <code><link linkend="variable-doc-id">$doc-id</link></code> <code><link linkend="template-catalog-expansion-terse">ŧ catalog-expansion-terse</link></code> <code><link linkend="function-expand-doc">tan:expand-doc</link></code> <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> <code><link linkend="variable-sources-must-be-altered">$sources-must-be-altered</link></code> <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code> <code><link linkend="variable-morphologies-resolved">$morphologies-resolved</link></code> <code><link linkend="variable-sources-resolved">$sources-resolved</link></code> .</para></section>
<section xml:id="function-resolve-alias"><title><code>tan:resolve-alias()</code></title><para><code>tan:resolve-alias($aliases as element()*) as element()*</code></para><para> Input: one or more <code><link linkend="element-alias">&lt;alias&gt;</link></code>es </para><para> Output: those elements with children <code>&lt;idref&gt;</code>, each containing a single value that the alias stands for </para><para>Used by template <code><link linkend="template-core-expansion-terse-alias">ŧ core-expansion-terse-alias</link></code> dependency-expansion-terse</para><para>Relies upon <code><link linkend="function-resolve-alias-loop">tan:resolve-alias-loop</link></code> .</para></section>
<section xml:id="function-resolve-alias-loop"><title><code>tan:resolve-alias-loop()</code></title><para><code>tan:resolve-alias-loop($other-aliases as element()*, $idrefs-to-process as xs:string*, $alias-ids-already-processed as xs:string*) as element()*</code></para><para> Function associated with the master one, above; returns only <code>&lt;id-ref&gt;</code> and <code>&lt;error&gt;</code> children </para><para>Used by function <code><link linkend="function-resolve-alias">tan:resolve-alias</link></code>() <code><link linkend="function-resolve-alias-loop">tan:resolve-alias-loop</link></code>()</para><para>Relies upon <code><link linkend="function-help-extracted">tan:help-extracted</link></code> <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-resolve-alias-loop">tan:resolve-alias-loop</link></code> .</para></section>
<section xml:id="function-resolve-idref"><title><code>tan:resolve-idref()</code></title><para><code>tan:resolve-idref($ref-vals as xs:string*, $aliases-expanded as element()*) as xs:string*</code></para><para> Input: any strings </para><para> Output: if a string refers to the id value of an <code><link linkend="element-alias">&lt;alias&gt;</link></code>, the references to that alias, otherwise the string itself </para><para>Used by template <code><link linkend="template-class-2-expansion-terse-pass-2">ŧ class-2-expansion-terse-pass-2</link></code> <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
</section>
</section>
<section><title>TAN-core-string global variables, keys, and functions summarized</title><section><title>variables</title><section xml:id="variable-char-reg-exp"><title><code>$char-reg-exp</code></title><para>Definition: <code>'\P{M}\p{M}*'</code></para><para>Used by function <code><link linkend="function-chop-string">tan:chop-string</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
</section>
<section><title>functions</title><section xml:id="function-atomize-string"><title><code>tan:atomize-string()</code></title><para><code>tan:atomize-string($input as xs:string?) as xs:string*</code></para><para> alias for <code>tan:-chop-string(</code>) </para><para>Used by template <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code></para><para>Relies upon <code><link linkend="function-chop-string">tan:chop-string</link></code> .</para></section>
<section xml:id="function-batch-replace"><title><code>tan:batch-replace()</code></title><para><code>tan:batch-replace($string as xs:string?, $replace-elements as element()*) as xs:string?</code></para><para> Input: a string, a sequence of &lt;[ANY NAME] pattern="" replacement="" [flags=""]&gt; </para><para> Output: the string, after those replaces are processed in order </para><para>Used by function <code><link linkend="function-batch-replace">tan:batch-replace</link></code>()</para><para>Relies upon <code><link linkend="function-replace">tan:replace</link></code> <code><link linkend="function-batch-replace">tan:batch-replace</link></code> .</para></section>
<section xml:id="function-chop-string"><title><code>tan:chop-string()</code></title><para><code>tan:chop-string($input as xs:string?) as xs:string*</code></para><para> Input: any string </para><para> Output: that string chopped into a sequence of individual characters, following TAN rules (modifying characters always join their preceding base character) </para><para>Used by template <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code></para><para>Used by function <code><link linkend="function-string-length">tan:string-length</link></code>() <code><link linkend="function-atomize-string">tan:atomize-string</link></code>()</para><para>Relies upon <code><link linkend="variable-char-reg-exp">$char-reg-exp</link></code> .</para></section>
<section xml:id="function-collate"><title><code>tan:collate()</code></title><para><emphasis>Option 1 (TAN-core-string-functions)</emphasis></para><para><code>tan:collate($strings as xs:string*) as element()</code></para><para> one parameter version of full one below </para><para>Used by function <code><link linkend="function-collate">tan:collate</link></code>()</para><para>Relies upon <code><link linkend="function-collate">tan:collate</link></code> .</para><para><emphasis>Option 2 (TAN-core-string-functions)</emphasis></para><para><code>tan:collate($strings as xs:string*, $labels as xs:string*) as element()</code></para><para> Input: any number of strings </para><para> Output: an element with <code>&lt;c&gt;</code> and &lt;u w="[WITNESS NUMBERS]"&gt;, showing where there are common strings and where there are departures. At the beginning are <code>&lt;witness&gt;</code>es identifying the numbers, and providing basic statistics about how much each pair of witnesses agree. </para><para> This function was written to deal with multiple OCR results of the same page of text, to find agreement wherever possible. </para><para>Used by function <code><link linkend="function-collate">tan:collate</link></code>()</para><para>Relies upon <code><link linkend="function-diff">tan:diff</link></code> <code><link linkend="function-collate-loop-outer">tan:collate-loop-outer</link></code> <code><link linkend="template-diff-to-collation">ŧ diff-to-collation</link></code> .</para></section>
<section xml:id="function-collate-loop-inner"><title><code>tan:collate-loop-inner()</code></title><para><code>tan:collate-loop-inner($collation-so-far as element(), $string-to-process as xs:string?, $string-label as xs:string?) as element()*</code></para><para> Input: a collation element (see template mode diff-to-collation), one string to process, and the corresponding string label </para><para> Output: a series of collation elements, marking where there is commonality and differences </para><para> This inner loop returns only the children of the collation element; the outer loop handles the parent element </para><para>Used by function <code><link linkend="function-collate-loop-outer">tan:collate-loop-outer</link></code>() <code><link linkend="function-collate-loop-inner">tan:collate-loop-inner</link></code>()</para><para>Relies upon <code><link linkend="function-diff">tan:diff</link></code> <code><link linkend="function-collate-loop-inner">tan:collate-loop-inner</link></code> .</para></section>
<section xml:id="function-collate-loop-outer"><title><code>tan:collate-loop-outer()</code></title><para><code>tan:collate-loop-outer($collation-so-far as element(), $strings-to-process as xs:string*, $string-labels as xs:string*) as element()</code></para><para> Input: a collation element (see template mode diff-to-collation), some strings to process, and corresponding string labels </para><para> Output: a series of collation elements, marking where there is commonality and differences </para><para>Used by function <code><link linkend="function-collate">tan:collate</link></code>() <code><link linkend="function-collate-loop-outer">tan:collate-loop-outer</link></code>()</para><para>Relies upon <code><link linkend="function-collate-loop-inner">tan:collate-loop-inner</link></code> <code><link linkend="function-collate-loop-outer">tan:collate-loop-outer</link></code> .</para></section>
<section xml:id="function-diff"><title><code>tan:diff()</code></title><para><emphasis>Option 1 (TAN-core-string-functions)</emphasis></para><para><code>tan:diff($string-a as xs:string?, $string-b as xs:string?) as element()</code></para><para> 2-param version of fuller one below </para><para>Used by template <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code></para><para>Used by function <code><link linkend="function-diff">tan:diff</link></code>() <code><link linkend="function-collate">tan:collate</link></code>() <code><link linkend="function-collate-loop-inner">tan:collate-loop-inner</link></code>()</para><para>Relies upon <code><link linkend="function-diff">tan:diff</link></code> .</para><para><emphasis>Option 2 (TAN-core-string-functions)</emphasis></para><para><code>tan:diff($string-a as xs:string?, $string-b as xs:string?, $snap-to-word as xs:boolean) as element()</code></para><para> Input: any two strings; boolean indicating whether results should snap to nearest word </para><para> Output: an element with <code>&lt;a&gt;</code>, <code>&lt;b&gt;</code>, and <code>&lt;common&gt;</code> children showing where strings a and b match and depart </para><para> This function was written after tan:diff, intended to be a cruder and faster way to check two strings against each other, suitable for validation without hanging due to nested recursion objections. </para><para>Used by template <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code></para><para>Used by function <code><link linkend="function-diff">tan:diff</link></code>() <code><link linkend="function-collate">tan:collate</link></code>() <code><link linkend="function-collate-loop-inner">tan:collate-loop-inner</link></code>()</para><para>Relies upon <code><link linkend="function-diff-loop">tan:diff-loop</link></code> <code><link linkend="function-group-adjacent-elements">tan:group-adjacent-elements</link></code> <code><link linkend="template-snap-to-word-pass-1">ŧ snap-to-word-pass-1</link></code> .</para></section>
<section xml:id="function-diff-loop"><title><code>tan:diff-loop()</code></title><para><code>tan:diff-loop($short-string as element()?, $long-string as element()?, $start-at-beginning as xs:boolean, $check-vertically-before-horizontally as xs:boolean, $loop-counter as xs:integer) </code></para><para>Used by function <code><link linkend="function-diff">tan:diff</link></code>() <code><link linkend="function-diff-loop">tan:diff-loop</link></code>()</para><para>Relies upon <code><link linkend="function-escape">tan:escape</link></code> <code><link linkend="function-diff-loop">tan:diff-loop</link></code> .</para></section>
<section xml:id="function-escape"><title><code>tan:escape()</code></title><para><code>tan:escape($strings as xs:string*) as xs:string*</code></para><para> Input: any sequence of strings </para><para> Output: each string prepared for regular expression searches, i.e., with reserved characters escaped out. </para><para>Used by variable <code><link linkend="variable-help-trigger-regex">$help-trigger-regex</link></code></para><para>Used by template <code><link linkend="template-evaluate-conditions">ŧ evaluate-conditions</link></code> <code><link linkend="template-class-2-expansion-terse-pass-2">ŧ class-2-expansion-terse-pass-2</link></code></para><para>Used by function <code><link linkend="function-diff-loop">tan:diff-loop</link></code>()</para><para>Relies upon <code><link linkend="variable-regex-escaping-characters">$regex-escaping-characters</link></code> .</para></section>
<section xml:id="function-group-adjacent-elements"><title><code>tan:group-adjacent-elements()</code></title><para><code>tan:group-adjacent-elements($elements as element()*) as element()*</code></para><para> Input: any sequence of elements </para><para> Output: the same elements, but adjacent elements of the same name grouped together </para><para>Used by function <code><link linkend="function-diff">tan:diff</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-normalize-text"><title><code>tan:normalize-text()</code></title><para><emphasis>Option 1 (TAN-core-string-functions)</emphasis></para><para><code>tan:normalize-text($text as xs:string*) as xs:string*</code></para><para> one-parameter version of full function below </para><para>Used by template <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code> <code><link linkend="template-expand-tan-key-dependencies">ŧ expand-tan-key-dependencies</link></code> core-expansion-terse <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-resolve-attr-include">ŧ resolve-attr-include</link></code></para><para>Used by function <code><link linkend="function-feature-test-to-groups">tan:feature-test-to-groups</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>() <code><link linkend="function-normalize-text">tan:normalize-text</link></code>()</para><para>Relies upon <code><link linkend="function-normalize-text">tan:normalize-text</link></code> .</para><para><emphasis>Option 2 (TAN-core-string-functions)</emphasis></para><para><code>tan:normalize-text($text as xs:string*, $render-common as xs:boolean) as xs:string*</code></para><para> Input: any sequence of strings; a boolean indicating whether the results should be normalized further to a common form </para><para> Output: that sequence, with each item's space normalized, and removal of any help requested </para><para> A common form is one where the string is converted to lower-case, and hyphens are replaced by spaces </para><para>Used by template <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code> <code><link linkend="template-expand-tan-key-dependencies">ŧ expand-tan-key-dependencies</link></code> core-expansion-terse <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-resolve-attr-include">ŧ resolve-attr-include</link></code></para><para>Used by function <code><link linkend="function-feature-test-to-groups">tan:feature-test-to-groups</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>() <code><link linkend="function-normalize-text">tan:normalize-text</link></code>()</para><para>Relies upon <code><link linkend="variable-help-trigger-regex">$help-trigger-regex</link></code> .</para></section>
<section xml:id="function-string-length"><title><code>tan:string-length()</code></title><para><code>tan:string-length($input as xs:string?) as xs:integer</code></para><para> Input: any string </para><para> Output: the number of characters in the string, as defined by TAN (i.e., modifiers are counted with the preceding base character) </para><para>Used by template <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-analyze-string-length-pass-1">ŧ analyze-string-length-pass-1</link></code></para><para>Used by function <code><link linkend="function-analyze-leaf-div-text-length-loop">tan:analyze-leaf-div-text-length-loop</link></code>()</para><para>Relies upon <code><link linkend="function-chop-string">tan:chop-string</link></code> .</para></section>
<section xml:id="function-tokenize-text"><title><code>tan:tokenize-text()</code></title><para><emphasis>Option 1 (TAN-core-string-functions)</emphasis></para><para><code>tan:tokenize-text($text as xs:string*) as element()*</code></para><para> one-parameter version of the function below </para><para>Used by template <code><link linkend="template-tokenize-div">ŧ tokenize-div</link></code> <code><link linkend="template-dependencies-tokenized-selectively">ŧ dependencies-tokenized-selectively</link></code> <code><link linkend="template-dependency-expansion-normal">ŧ dependency-expansion-normal</link></code> <code><link linkend="template-dependency-expansion-verbose">ŧ dependency-expansion-verbose</link></code></para><para>Used by function <code><link linkend="function-tokenize-text">tan:tokenize-text</link></code>()</para><para>Relies upon <code><link linkend="function-tokenize-text">tan:tokenize-text</link></code> <code><link linkend="variable-token-definition-default">$token-definition-default</link></code> .</para><para><emphasis>Option 2 (TAN-core-string-functions)</emphasis></para><para><code>tan:tokenize-text($text as xs:string*, $token-definition as element(tan:token-definition)?, $count-toks as xs:boolean?) as element()*</code></para><para> Input: any number of strings; a <code><link linkend="element-token-definition">&lt;token-definition&gt;</link></code>; a boolean indicating whether tokens should be counted and labeled. </para><para> Output: a <code>&lt;result&gt;</code> for each string, tokenized into <code><link linkend="element-tok">&lt;tok&gt;</link></code> and <code>&lt;non-tok&gt;</code>, respectively. If the counting option is turned on, the <code>&lt;result&gt;</code> contains <code>@tok-count</code> and <code>@non-tok-count</code>, and each <code><link linkend="element-tok">&lt;tok&gt;</link></code> and <code>&lt;non-tok&gt;</code> have an <code><link linkend="attribute-n">@n</link></code> indicating which <code><link linkend="element-tok">&lt;tok&gt;</link></code> group it belongs to. </para><para>Used by template <code><link linkend="template-tokenize-div">ŧ tokenize-div</link></code> <code><link linkend="template-dependencies-tokenized-selectively">ŧ dependencies-tokenized-selectively</link></code> <code><link linkend="template-dependency-expansion-normal">ŧ dependency-expansion-normal</link></code> <code><link linkend="template-dependency-expansion-verbose">ŧ dependency-expansion-verbose</link></code></para><para>Used by function <code><link linkend="function-tokenize-text">tan:tokenize-text</link></code>()</para><para>Relies upon <code><link linkend="variable-token-definition-default">$token-definition-default</link></code> .</para></section>
</section>
</section>
<section><title>TAN-class-1 global variables, keys, and functions summarized</title><section><title>variables</title><section xml:id="variable-special-end-div-chars"><title><code>$special-end-div-chars</code></title><para>Definition: <code>(<link linkend="variable-zwj">$zwj</link>, <link linkend="variable-dhy">$dhy</link>)</code></para><para>Used by variable <code><link linkend="variable-special-end-div-chars-regex">$special-end-div-chars-regex</link></code></para><para>Used by function <code><link linkend="function-normalize-div-text">tan:normalize-div-text</link></code>()</para><para>Relies upon <code><link linkend="variable-zwj">$zwj</link></code> <code><link linkend="variable-dhy">$dhy</link></code> .</para></section>
<section xml:id="variable-special-end-div-chars-regex"><title><code>$special-end-div-chars-regex</code></title><para>Definition: <code>concat('[', string-join(<link linkend="variable-special-end-div-chars">$special-end-div-chars</link>, ''), ']$')</code></para><para>Used by function <code><link linkend="function-normalize-div-text">tan:normalize-div-text</link></code>()</para><para>Relies upon <code><link linkend="variable-special-end-div-chars">$special-end-div-chars</link></code> .</para></section>
<section xml:id="variable-tokenization-nonspace"><title><code>$tokenization-nonspace</code></title><para>Definition: <code><link linkend="variable-token-definitions-reserved">$token-definitions-reserved</link>[following-sibling::tan:name = 'nonspace']</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-token-definitions-reserved">$token-definitions-reserved</link></code> .</para></section>
</section>
<section><title>keys</title><section xml:id="key-div-via-orig-ref"><title><code>ʞ div-via-orig-ref')</code></title><para>Looks for elements matching <code>tan:div</code></para><para>Used by template <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="key-div-via-ref"><title><code>ʞ div-via-ref')</code></title><para>Looks for elements matching <code>tan:div</code></para><para>Used by template <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
</section>
<section><title>functions</title><section xml:id="function-analyze-leaf-div-string-length"><title><code>tan:analyze-leaf-div-string-length()</code></title><para><code>tan:analyze-leaf-div-string-length($document-fragment as item()*) as item()*</code></para><para> Input: any class 1 document fragment </para><para> Output: Every leaf div stamped with <code>@string-length</code> and <code>@string-pos</code>, indicating how long the text node is, and where it is relative to all other leaf text nodes, after TAN text normalization rules have been applied. </para><para> This function is useful for statistical processing, and for comparing a <code>TAN-T(</code>EI) file against an alternatively divided edition. </para><para> It has also been designed to stamp the <code>&lt;a&gt;</code> and <code>&lt;common&gt;</code> results of <code><link linkend="function-diff">tan:diff</link></code>(), to facilitate SQFs that replace a text with that of the other version. </para><para> This function does the same thing as <code><link linkend="function-analyze-string-length">tan:analyze-string-length</link></code>(), but approaches the problem with a recursive loop </para><para>Used by template <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code></para><para>Relies upon <code><link linkend="function-analyze-leaf-div-text-length-loop">tan:analyze-leaf-div-text-length-loop</link></code> .</para></section>
<section xml:id="function-analyze-leaf-div-text-length-loop"><title><code>tan:analyze-leaf-div-text-length-loop()</code></title><para><code>tan:analyze-leaf-div-text-length-loop($items-to-process as item()*, $char-count-so-far as xs:integer, $return-final-count as xs:boolean) as item()*</code></para><para> Loop function for the master one, above. </para><para>Used by function <code><link linkend="function-analyze-leaf-div-string-length">tan:analyze-leaf-div-string-length</link></code>() <code><link linkend="function-analyze-leaf-div-text-length-loop">tan:analyze-leaf-div-text-length-loop</link></code>()</para><para>Relies upon <code><link linkend="function-analyze-leaf-div-text-length-loop">tan:analyze-leaf-div-text-length-loop</link></code> <code><link linkend="function-string-length">tan:string-length</link></code> <code><link linkend="function-normalize-div-text">tan:normalize-div-text</link></code> .</para></section>
<section xml:id="function-analyze-string-length"><title><code>tan:analyze-string-length()</code></title><para><emphasis>Option 1 (TAN-class-1-functions)</emphasis></para><para><code>tan:analyze-string-length($resolved-class-1-doc-or-fragment as item()*) as item()*</code></para><para> One-parameter function of the two-parameter version below </para><para>Used by function <code><link linkend="function-analyze-string-length">tan:analyze-string-length</link></code>()</para><para>Relies upon <code><link linkend="function-analyze-string-length">tan:analyze-string-length</link></code> .</para><para><emphasis>Option 2 (TAN-class-1-functions)</emphasis></para><para><code>tan:analyze-string-length($resolved-class-1-doc-or-fragment as item()*, $mark-only-leaf-divs as xs:boolean) as item()*</code></para><para> Input: any class-1 document or fragment; an indication whether string lengths should be added only to leaf divs, or to every div. </para><para> Output: the same document, with <code>@string-length</code> and <code>@string-pos</code> added to every element </para><para> Function to calculate string lengths of each leaf elements and their relative position, so that a raw text can be segmented proportionally and given the structure of a model exemplar. NB: any <code><link linkend="variable-special-end-div-chars">$special-end-div-chars</link></code> that terminate a <code><link linkend="element-div">&lt;div&gt;</link></code> not only will not be counted, but the</para><para>         assumed space that follows will also not be counted. On the other hand, the lack of a special</para><para>         character at the end means that the nominal space that follows a div will be included in both</para><para>         the length and the position. Thus input...</para><para>         &lt;div type="m" n="1"&gt;abc&amp;#xad;&lt;/div&gt;</para><para>         &lt;div type="m" n="2"&gt;def&amp;#x200d;&lt;/div&gt;</para><para>         &lt;div type="m" n="3"&gt;ghi&lt;/div&gt;</para><para>         &lt;div type="m" n="4"&gt;xyz&lt;/div&gt;</para><para>         ...presumes a raw joined text of "abcdefghi xyz ", and so becomes output:</para><para>         &lt;div type="m" n="1" string-length="3" string-pos="1"&gt;abc&amp;#xad;&lt;/div&gt;</para><para>         &lt;div type="m" n="2" string-length="3" string-pos="4"&gt;def&amp;#x200d;&lt;/div&gt;</para><para>         &lt;div type="m" n="3" string-length="4" string-pos="7"&gt;ghi&lt;/div&gt;</para><para>         &lt;div type="m" n="4" string-length="4" string-pos="11"&gt;xyz&lt;/div&gt; </para><para> This function does the same thing as <code><link linkend="function-analyze-leaf-div-string-length">tan:analyze-leaf-div-string-length</link></code>(), but approaches the problem in a two-template cycle, instead of a loop </para><para>Used by function <code><link linkend="function-analyze-string-length">tan:analyze-string-length</link></code>()</para><para>Relies upon <code><link linkend="template-analyze-string-length-pass-1">ŧ analyze-string-length-pass-1</link></code> <code><link linkend="template-analyze-string-length-pass-2">ŧ analyze-string-length-pass-2</link></code> .</para></section>
<section xml:id="function-div-to-div-transfer"><title><code>tan:div-to-div-transfer()</code></title><para><code>tan:div-to-div-transfer($items-with-div-content-to-be-transferred as item()*, $items-whose-divs-should-be-infused-with-new-content as item()*) as item()*</code></para><para> Input: (1) any set of divs with content to be transferred into the structure of (2) another set of divs. </para><para> Output: The div structure of (2), infused with the content of (1). The content is allocated  proportionately, with preference given to punctuation, within a certain range, and then word breaks. </para><para> This function is useful for converting class-1 documents from one reference system to another. Normally the conversion is flawed, because two versions of the same work rarely synchronize, but this function provides a good estimate, or a starting point for manual correction. </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-text-join">tan:text-join</link></code> <code><link linkend="function-infuse-divs">tan:infuse-divs</link></code> .</para></section>
<section xml:id="function-infuse-divs"><title><code>tan:infuse-divs()</code></title><para><code>tan:infuse-divs($new-content-to-be-transferred as xs:string?, $items-whose-divs-should-be-infused-with-new-content as item()*) as item()*</code></para><para> Input: a string; an XML fragment that has <code><link linkend="element-div">&lt;div&gt;</link></code>s </para><para> Output: the latter, infused with the former, following infusing text proportionate to the relative quantities of text being replaced </para><para>Used by function <code><link linkend="function-div-to-div-transfer">tan:div-to-div-transfer</link></code>()</para><para>Relies upon <code><link linkend="template-analyze-string-length-pass-1">ŧ analyze-string-length-pass-1</link></code> <code><link linkend="template-analyze-string-length-pass-2">ŧ analyze-string-length-pass-2</link></code> <code><link linkend="template-infuse-tokenized-text">ŧ infuse-tokenized-text</link></code> <code><link linkend="template-strip-all-attributes-except">ŧ strip-all-attributes-except</link></code> .</para></section>
<section xml:id="function-merge-divs"><title><code>tan:merge-divs()</code></title><para><emphasis>Option 1 (TAN-class-1-functions)</emphasis></para><para><code>tan:merge-divs($expanded-class-1-fragment as item()*) as item()*</code></para><para> See fuller version below </para><para>Used by template <code><link linkend="template-reset-hierarchy">ŧ reset-hierarchy</link></code></para><para>Used by function <code><link linkend="function-merge-divs">tan:merge-divs</link></code>() <code><link linkend="function-merge-divs">tan:merge-divs</link></code>()</para><para>Relies upon <code><link linkend="function-merge-divs">tan:merge-divs</link></code> .</para><para><emphasis>Option 2 (TAN-class-1-functions)</emphasis></para><para><code>tan:merge-divs($expanded-class-1-fragment as item()*, $itemize-leaf-divs as xs:boolean) as item()*</code></para><para> See fuller version below </para><para>Used by template <code><link linkend="template-reset-hierarchy">ŧ reset-hierarchy</link></code></para><para>Used by function <code><link linkend="function-merge-divs">tan:merge-divs</link></code>() <code><link linkend="function-merge-divs">tan:merge-divs</link></code>()</para><para>Relies upon <code><link linkend="function-merge-divs">tan:merge-divs</link></code> .</para><para><emphasis>Option 3 (TAN-class-1-functions)</emphasis></para><para><code>tan:merge-divs($expanded-class-1-fragment as item()*, $itemize-leaf-divs as xs:boolean, $exclude-elements-with-duplicate-values-of-what-attribute as xs:string?, $keep-last-duplicate as xs:boolean?) as item()*</code></para><para> Input: expanded class 1 document fragment whose individual <code><link linkend="element-div">&lt;div&gt;</link></code>s are assumed to be in the proper hierarchy (result of <code>tan:normalize-text-hierarchy(</code>)); a boolean indicating whether leaf divs should be itemized; an optional string representing the name of an attribute to be checked for duplicates </para><para> Output: the fragment with the <code><link linkend="element-div">&lt;div&gt;</link></code>s grouped according to their <code>&lt;ref&gt;</code> values </para><para> If the 2nd parameter is true, for each leaf <code><link linkend="element-div">&lt;div&gt;</link></code> in a group there will be a separate &lt;div type="#version"&gt;; otherwise leaf divs will be merely copied </para><para> For merging multiple files normally the value should be true; if they are misfits from a single source, false </para><para>Used by template <code><link linkend="template-reset-hierarchy">ŧ reset-hierarchy</link></code></para><para>Used by function <code><link linkend="function-merge-divs">tan:merge-divs</link></code>() <code><link linkend="function-merge-divs">tan:merge-divs</link></code>()</para><para>Relies upon <code><link linkend="template-merge-divs">ŧ merge-divs</link></code> .</para></section>
<section xml:id="function-normalize-div-text"><title><code>tan:normalize-div-text()</code></title><para><code>tan:normalize-div-text($div-strings as xs:string*) as xs:string*</code></para><para> Input: any sequence of strings </para><para> Output: the same sequence, normalized according to TAN rules. Each item in the sequence is space normalized and then if its end matches one of the special div-end characters, ZWJ U+200D or SOFT HYPHEN U+AD, the character is removed; otherwise a space is added at the end. Zero-length strings are skipped. </para><para> This function is designed specifically for TAN's commitment to nonmixed content. That is, every TAN element contains either elements or non-whitespace text but not both, which also means that whitespace text nodes are effectively ignored. It is assumed that every TAN element is followed by a notional whitespace. </para><para>Used by template <code><link linkend="template-text-join">ŧ text-join</link></code> <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code></para><para>Used by function <code><link linkend="function-analyze-leaf-div-text-length-loop">tan:analyze-leaf-div-text-length-loop</link></code>()</para><para>Relies upon <code><link linkend="variable-special-end-div-chars-regex">$special-end-div-chars-regex</link></code> .</para></section>
<section xml:id="function-text-join"><title><code>tan:text-join()</code></title><para><code>tan:text-join($items as item()*) as xs:string?</code></para><para> Input: any document fragment of a TAN class 1 body, whether raw, resolved, or expanded  </para><para> Output: a single string that joins and normalizes the leaf div text according to TAN rules: </para><para>Used by template <code><link linkend="template-class-1-expansion-verbose">ŧ class-1-expansion-verbose</link></code> <code><link linkend="template-merge-divs">ŧ merge-divs</link></code> <code><link linkend="template-analyze-string-length-pass-1">ŧ analyze-string-length-pass-1</link></code></para><para>Used by function <code><link linkend="function-div-to-div-transfer">tan:div-to-div-transfer</link></code>()</para><para>Relies upon <code><link linkend="template-text-join">ŧ text-join</link></code> .</para></section>
<section xml:id="function-tokenize-div"><title><code>tan:tokenize-div()</code></title><para><code>tan:tokenize-div($divs as element()*, $token-definitions as element(tan:token-definition)) as element()*</code></para><para> Input: any <code><link linkend="element-div">&lt;div&gt;</link></code>s, a <code><link linkend="element-token-definition">&lt;token-definition&gt;</link></code> </para><para> Output: the <code>&lt;divs&gt;</code>s in tokenized form </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-tokenize-div">ŧ tokenize-div</link></code> .</para></section>
</section>
</section>
<section><title>TAN-class-2 global variables, keys, and functions summarized</title><section><title>variables</title><section xml:id="variable-src-ids"><title><code>$src-ids</code></title><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-head">$head</link></code> .</para></section>
</section>
<section><title>keys</title><section xml:id="key-tok-via-ref"><title><code>ʞ tok-via-ref')</code></title><para>Looks for elements matching <code>tan:tok</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:key.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
</section>
</section>
<section><title>TAN-A-div global variables, keys, and functions summarized</title><section><title>functions</title><section xml:id="function-data-type-check"><title><code>tan:data-type-check()</code></title><para><code>tan:data-type-check($item as item()?, $data-type as xs:string) as xs:boolean</code></para><para> Input: an item and a string naming a data type </para><para> Output: a boolean indicating whether the item can be cast into that data type </para><para> If the first parameter doesn't match a data type, the function returns false </para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
</section>
</section>
<section><title>TAN-A-lm global variables, keys, and functions summarized</title><section><title>variables</title><section xml:id="variable-morphologies-expanded"><title><code>$morphologies-expanded</code></title><para>Definition: <code><link linkend="function-expand-doc">tan:expand-doc</link>(<link linkend="variable-morphologies-resolved">$morphologies-resolved</link>)</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="function-expand-doc">tan:expand-doc</link></code> <code><link linkend="variable-morphologies-resolved">$morphologies-resolved</link></code> .</para></section>
</section>
</section>
<section><title>TAN-class-3 global variables, keys, and functions summarized</title><section><title>functions</title><section xml:id="function-feature-test-to-groups"><title><code>tan:feature-test-to-groups()</code></title><para><code>tan:feature-test-to-groups($attr-feature-test as xs:string?) as element()*</code></para><para> Input: any value of <code>@feature-test</code> </para><para> Output: the value converted into a series of <code><link linkend="element-group">&lt;group&gt;</link></code>ed <code><link linkend="element-item">&lt;item&gt;</link></code>s, observing the accepted syntax for this attribute </para><para> Example: "a b + c" - &gt; </para><para>               <code><link linkend="element-group">&lt;group&gt;</link></code></para><para>                  <code><link linkend="element-item">&lt;item&gt;</link></code>a&lt;/item&gt;</para><para>               &lt;/group&gt;</para><para>               <code><link linkend="element-group">&lt;group&gt;</link></code></para><para>                  <code><link linkend="element-item">&lt;item&gt;</link></code>b&lt;/item&gt;</para><para>                  <code><link linkend="element-item">&lt;item&gt;</link></code>c&lt;/item&gt;</para><para>               &lt;/group&gt;</para><para> </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-normalize-text">tan:normalize-text</link></code> .</para></section>
</section>
</section>
<section><title>TAN-extra global variables, keys, and functions summarized</title><section><title>variables</title><section xml:id="variable-namespaces-and-prefixes"><title><code>$namespaces-and-prefixes</code></title><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>Used by function <code><link linkend="function-namespace">tan:namespace</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-xpath-pattern"><title><code>$xpath-pattern</code></title><para>Definition: <code>'\{[^\}]+?\}'</code></para><para>Used by function <code><link linkend="function-evaluate">tan:evaluate</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
</section>
<section><title>functions</title><section xml:id="function-analyze-stats"><title><code>tan:analyze-stats()</code></title><para><code>tan:analyze-stats($arg as xs:anyAtomicType*) as element()?</code></para><para> Input: a sequence of numbers </para><para> Output: a single <code>&lt;stats&gt;</code> with attributes calculating the count, sum, average, max, min, variance, standard deviation, and then one child <code>&lt;d&gt;</code> per datum with the value of the datum </para><para>Used by function <code><link linkend="function-merge-analyzed-stats">tan:merge-analyzed-stats</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-blob-to-regex"><title><code>tan:blob-to-regex()</code></title><para><code>tan:blob-to-regex($globs as xs:string*) as xs:string*</code></para><para> Input: any strings that follow a blob-like syntax </para><para> Output: the strings converted to regular expressions </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-counts-to-firsts"><title><code>tan:counts-to-firsts()</code></title><para><code>tan:counts-to-firsts($seq as xs:integer*) as xs:integer*</code></para><para> Input: sequence of numbers representing counts of items.  </para><para> Output: sequence of numbers representing the first position of each item within the total count.</para><para>      E.g., (4, 12, 0, 7) - &gt; (1, 5, 17, 17)</para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-counts-to-lasts"><title><code>tan:counts-to-lasts()</code></title><para><code>tan:counts-to-lasts($seq as xs:integer*) as xs:integer*</code></para><para> Input: sequence of numbers representing counts of items. </para><para>         Output: sequence of numbers representing the last position of each item within the total count.</para><para>      E.g., (4, 12, 0, 7) - &gt; (4, 16, 16, 23)</para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-evaluate"><title><code>tan:evaluate()</code></title><para><emphasis>Option 1 (TAN-extra-functions)</emphasis></para><para><code>tan:evaluate($string-with-xpath-to-evaluate as xs:string, $context-1 as item()*) as item()*</code></para><para> 2-param version of the fuller one below </para><para>Used by function <code><link linkend="function-group-elements">tan:group-elements</link></code>() <code><link linkend="function-evaluate">tan:evaluate</link></code>()</para><para>Relies upon <code><link linkend="function-evaluate">tan:evaluate</link></code> .</para><para><emphasis>Option 2 (TAN-extra-functions)</emphasis></para><para><code>tan:evaluate($string-with-xpath-to-evaluate as xs:string, $context-1 as item()*, $context-2 as item()*) as item()*</code></para><para> Input: a string to be evaluated in light of XPath expressions; a context node </para><para> Output: the result of the string evaluated as an XPath statement against the context node </para><para>Used by function <code><link linkend="function-group-elements">tan:group-elements</link></code>() <code><link linkend="function-evaluate">tan:evaluate</link></code>()</para><para>Relies upon <code><link linkend="variable-xpath-pattern">$xpath-pattern</link></code> .</para></section>
<section xml:id="function-grc-to-int"><title><code>tan:grc-to-int()</code></title><para><code>tan:grc-to-int($greek-numerals as xs:string*) as xs:integer*</code></para><para> Input: Greek letters that represent numerals </para><para> Output: the numerical value of the letters </para><para> NB, this does not take into account the use of letters representing numbers 1000 and greater </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-letter-to-number">tan:letter-to-number</link></code> .</para></section>
<section xml:id="function-group-elements"><title><code>tan:group-elements()</code></title><para><code>tan:group-elements($elements-to-group as element()*, $group-min as xs:double?, $label-to-prepend) as element()*</code></para><para> Input: any elements that should be grouped; parameters specifying minimum size of grouping and the name of a label to prepend </para><para> Output: those elements grouped </para><para> This function was written primarily for the major alter function </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-evaluate">tan:evaluate</link></code> .</para></section>
<section xml:id="function-median"><title><code>tan:median()</code></title><para><code>tan:median($numbers as xs:double*) as xs:double?</code></para><para> Input: any sequence of numbers </para><para> Output: the median value </para><para> It is assumed that the input has already been sorted by <code>tan:numbers-sorted(</code>) vel sim </para><para>Used by function <code><link linkend="function-outliers">tan:outliers</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-merge-analyzed-stats"><title><code>tan:merge-analyzed-stats()</code></title><para><code>tan:merge-analyzed-stats($analyzed-stats as element()*, $add-stats as xs:boolean?) as element()</code></para><para> Takes a group of elements that follow the pattern that results from tan:analyze-stats and synthesizes them into a single element. If <code>$add-stats</code> is true, then they are added; if false, the sum of the 2nd - last elements is subtracted from the first; if neither true nor false, nothing happens. Will work on elements of any name, so long as they have tan:d children, with the data points to be merged. </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-analyze-stats">tan:analyze-stats</link></code> .</para></section>
<section xml:id="function-most-common-item"><title><code>tan:most-common-item()</code></title><para><code>tan:most-common-item($sequence as item()*) as item()?</code></para><para> Input: any sequence of items </para><para> Output: the one item that appears most frequently </para><para> If two or more items appear equally frequently, only the first is returned </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-namespace"><title><code>tan:namespace()</code></title><para><code>tan:namespace($prefix-or-uri as xs:string*) as xs:string*</code></para><para> Input: any strings representing a namespace prefix or uri </para><para> Output: the corresponding prefix or uri whenever a match is found in the global variable </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="variable-namespaces-and-prefixes">$namespaces-and-prefixes</link></code> .</para></section>
<section xml:id="function-no-outliers"><title><code>tan:no-outliers()</code></title><para><code>tan:no-outliers($numbers as xs:anyAtomicType*) as xs:anyAtomicType*</code></para><para> Input: any sequence of numbers </para><para> Output: the same sequence, without outliers </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-outliers">tan:outliers</link></code> .</para></section>
<section xml:id="function-normalize-xml-element-space"><title><code>tan:normalize-xml-element-space()</code></title><para><code>tan:normalize-xml-element-space($element-to-normalize as element()?) as element()?</code></para><para> Input: an element </para><para> Output: the same element, but with text node descendants with space normalized </para><para> If a text node begins with a space, and its first preceding sibling text node ends with a space, then the preceding space is dropped, otherwise it is normalized to a single space </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-normalize-xml-fragment-space">ŧ normalize-xml-fragment-space</link></code> .</para></section>
<section xml:id="function-number-sort"><title><code>tan:number-sort()</code></title><para><code>tan:number-sort($numbers as xs:anyAtomicType*) as xs:double*</code></para><para> Input: any sequence of items </para><para> Output: the same sequence, sorted with string numerals converted to numbers </para><para>Used by function <code><link linkend="function-outliers">tan:outliers</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-ordinal"><title><code>tan:ordinal()</code></title><para><code>tan:ordinal($in as xs:integer*) as xs:string*</code></para><para> Input: one or more numerals</para><para>        Output: one or more strings with the English form of the ordinal form of the input number</para><para>        E.g., (1, 4, 17)  -&gt;  ('first','fourth','17th'). </para><para>        </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-outliers"><title><code>tan:outliers()</code></title><para><code>tan:outliers($numbers as xs:anyAtomicType*) as xs:anyAtomicType*</code></para><para> Input: any sequence of numbers </para><para> Output: outliers in the sequence, </para><para>Used by function <code><link linkend="function-no-outliers">tan:no-outliers</link></code>()</para><para>Relies upon <code><link linkend="function-number-sort">tan:number-sort</link></code> <code><link linkend="function-median">tan:median</link></code> .</para></section>
<section xml:id="function-possible-bibliography-id"><title><code>tan:possible-bibliography-id()</code></title><para><code>tan:possible-bibliography-id($bibl-cit as xs:string) as xs:string</code></para><para> Input: a string with a bibliographic entry </para><para> Output: unique values of the two longest words and the first numeral that looks like a date </para><para> When working with bibliographical data, it is next to impossible to rely upon an exact match to tell whether two citations are for the same item </para><para> Many times, however, the longest word or two, plus the four-digit date, are good ways to try to find matches. </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-product"><title><code>tan:product()</code></title><para><code>tan:product($numbers as item()*) as xs:double?</code></para><para> Input: a sequence of numbers </para><para> Output: the product of those numbers </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-product-loop">tan:product-loop</link></code> .</para></section>
<section xml:id="function-product-loop"><title><code>tan:product-loop()</code></title><para><code>tan:product-loop($product-so-far as xs:double?, $numbers-to-multiply as item()*) as xs:double?</code></para><para>Used by function <code><link linkend="function-product">tan:product</link></code>() <code><link linkend="function-product-loop">tan:product-loop</link></code>()</para><para>Relies upon <code><link linkend="function-product-loop">tan:product-loop</link></code> .</para></section>
<section xml:id="function-reset-hierarchy"><title><code>tan:reset-hierarchy()</code></title><para><code>tan:reset-hierarchy($expanded-class-1-docs as document-node()*, $flag-misplaced-leaf-divs as xs:boolean?) as document-node()*</code></para><para> Input: any expanded class-1 documents whose <code><link linkend="element-div">&lt;div&gt;</link></code>s may be in the wrong place, because <code><link linkend="element-rename">&lt;rename&gt;</link></code> or <code><link linkend="element-reassign">&lt;reassign&gt;</link></code> have altered the <code>&lt;ref&gt;</code> values; a boolean indicating whether misplaced leaf divs should be flagged </para><para> Output: the same documents, with <code><link linkend="element-div">&lt;div&gt;</link></code>s restored to their proper place in the hierarchy </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-reset-hierarchy">ŧ reset-hierarchy</link></code> .</para></section>
<section xml:id="function-resolve-keyword"><title><code>tan:resolve-keyword()</code></title><para><code>tan:resolve-keyword($items as item()*, $extra-keys as document-node()*) as item()*</code></para><para> Input: any items; any extra keys </para><para> Output: the same items, but with elements with <code><link linkend="attribute-which">@which</link></code> expanded into their full form, using the predefined TAN vocabulary and the extra keys supplied </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code> .</para></section>
<section xml:id="function-syr-to-int"><title><code>tan:syr-to-int()</code></title><para><code>tan:syr-to-int($syriac-numerals as xs:string*) as xs:integer*</code></para><para> Input: Syriac letters that represent numerals </para><para> Output: the numerical value of the letters </para><para> NB, this does not take into account the use of letters representing numbers 1000 and greater </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-letter-to-number">tan:letter-to-number</link></code> .</para></section>
<section xml:id="function-true"><title><code>tan:true()</code></title><para><code>tan:true($string as xs:string*) as xs:boolean*</code></para><para> Input: a sequence of strings representing truth values </para><para> Output: the same number of booleans; if the string is some approximation of y, yes, 1, or true, then it is true, and false otherwise </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-zip-uris"><title><code>tan:zip-uris()</code></title><para><code>tan:zip-uris($uris as xs:string*) as xs:anyURI*</code></para><para> Input: any string representing a uri </para><para> Output: the same string with 'zip:' prepended if it represents a uri to a file in an archive (docx, jar, zip, etc.) </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
</section>
</section>
<section><title>TAN-function global variables, keys, and functions summarized</title><section><title>variables</title><section xml:id="variable-all-functions"><title><code>$all-functions</code></title><para>Definition: <code>collection('../collection.xml')</code></para><para>Used by function <code><link linkend="function-errors-checked-where">tan:errors-checked-where</link></code>() <code><link linkend="function-variables-checked-where">tan:variables-checked-where</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
</section>
<section><title>functions</title><section xml:id="function-errors-checked-where"><title><code>tan:errors-checked-where()</code></title><para><code>tan:errors-checked-where($error-ids as xs:string*) as element()*</code></para><para> Input: error ids </para><para> Output: the top-level templates, stylesheets, and variables that use that error code </para><para> Used primarily by schematron validation for TAN-errors.xml </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="variable-quot">$quot</link></code> <code><link linkend="variable-apos">$apos</link></code> <code><link linkend="variable-all-functions">$all-functions</link></code> .</para></section>
<section xml:id="function-variables-checked-where"><title><code>tan:variables-checked-where()</code></title><para><code>tan:variables-checked-where($error-ids as xs:string*) as element()*</code></para><para> Input: name of a variable </para><para> Output: the top-level templates, stylesheets, and variables that use that error code </para><para> Used primarily by schematron validation for TAN-errors.xml </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="variable-quot">$quot</link></code> <code><link linkend="variable-apos">$apos</link></code> <code><link linkend="variable-all-functions">$all-functions</link></code> .</para></section>
</section>
</section>
<section><title>regex-ext-tan global variables, keys, and functions summarized</title><section><title>variables</title><section xml:id="variable-hex-key"><title><code>$hex-key</code></title><para>Definition: <code>             '0',             '1',             '2',             '3',             '4',             '5',             '6',             '7',             '8',             '9',             'A',             'B',             'C',             'D',             'E',             'F'</code></para><para>Used by function <code><link linkend="function-dec-to-hex">tan:dec-to-hex</link></code>() <code><link linkend="function-hex-to-dec">tan:hex-to-dec</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-regex-escaping-characters"><title><code>$regex-escaping-characters</code></title><para>Definition: <code>'[\.\[\]\\\|\-\^\$\?\*\+\{\}\(\)]'</code></para><para>Used by function <code><link linkend="function-escape">tan:escape</link></code>() <code><link linkend="function-expand-search">tan:expand-search</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
</section>
<section><title>functions</title><section xml:id="function-codepoints-to-string"><title><code>tan:codepoints-to-string()</code></title><para><code>tan:codepoints-to-string($arg as xs:integer*) as xs:string?</code></para><para> Input: any number of integers </para><para> Output: the string value representation, but only if the integers represent valid characters in XML </para><para> Like <code>fn:codepoints-to-string(</code>), but filters out illegal XML characters </para><para>Used by function <code><link linkend="function-process-regex-escape-u">tan:process-regex-escape-u</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-dec-to-hex"><title><code>tan:dec-to-hex()</code></title><para><code>tan:dec-to-hex($in as xs:integer) as xs:string</code></para><para> Change any integer into a hexadecimal string</para><para>            Input: xs:integer </para><para>         Output: hexadecimal equivalent as a string </para><para>         E.g., 31 - &gt; '1F'</para><para>      </para><para>Used by function <code><link linkend="function-dec-to-hex">tan:dec-to-hex</link></code>()</para><para>Relies upon <code><link linkend="function-dec-to-hex">tan:dec-to-hex</link></code> <code><link linkend="variable-hex-key">$hex-key</link></code> .</para></section>
<section xml:id="function-expand-search"><title><code>tan:expand-search()</code></title><para><code>tan:expand-search($regex as xs:string?) as xs:string?</code></para><para> This function takes a string representation of a regular expression pattern and replaces every unescaped</para><para>      character with a character class that lists all Unicode characters that would recursively decompose to that base</para><para>      character.</para><para>      E.g., 'word' - &gt; '[wŵʷẁẃẅẇẉẘⓦｗ𝐰𝑤𝒘𝓌𝔀𝔴𝕨𝖜𝗐𝘄𝘸𝙬𝚠][oºòóôõöōŏőơǒǫǭȍȏȫȭȯȱᵒṍṏṑṓọỏốồổỗộớờởỡợₒℴⓞ㍵ｏ𝐨𝑜𝒐𝓸𝔬𝕠𝖔𝗈𝗼𝘰𝙤𝚘][rŕŗřȑȓʳᵣṙṛṝṟⓡ㎭㎮㎯ｒ𝐫𝑟𝒓𝓇𝓻𝔯𝕣𝖗𝗋𝗿𝘳𝙧𝚛][dďǆǳᵈḋḍḏḑḓⅆⅾⓓ㍲㍷㍸㍹㎗㏈ｄ𝐝𝑑𝒅𝒹𝓭𝔡𝕕𝖉𝖽𝗱𝘥𝙙𝚍]' </para><para>      This function is useful for cases where it is more efficient to change the search term rather than to transform</para><para>      the text to be searched into base characters.</para><para>      </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-get-ucd-decomp">tan:get-ucd-decomp</link></code> <code><link linkend="variable-regex-escaping-characters">$regex-escaping-characters</link></code> <code><link linkend="function-string-composite">tan:string-composite</link></code> <code><link linkend="template-add-square-brackets">ŧ add-square-brackets</link></code> .</para></section>
<section xml:id="function-get-ucd-decomp"><title><code>tan:get-ucd-decomp()</code></title><para><code>tan:get-ucd-decomp() </code></para><para>Used by function <code><link linkend="function-string-base">tan:string-base</link></code>() <code><link linkend="function-string-composite">tan:string-composite</link></code>() <code><link linkend="function-expand-search">tan:expand-search</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-hex-to-dec"><title><code>tan:hex-to-dec()</code></title><para><code>tan:hex-to-dec($hex as xs:string?) as item()*</code></para><para> Change any hexadecimal string into an integer</para><para>         E.g., '1F' - &gt; 31</para><para>      </para><para>Used by function <code><link linkend="function-process-regex-escape-u">tan:process-regex-escape-u</link></code>()</para><para>Relies upon <code><link linkend="variable-hex-key">$hex-key</link></code> .</para></section>
<section xml:id="function-matches"><title><code>tan:matches()</code></title><para><emphasis>Option 1 (regex-ext-tan-functions)</emphasis></para><para><code>tan:matches($input as xs:string?, $pattern as xs:string) as xs:boolean</code></para><para> two-param function of the three-param version below </para><para>Used by template <code><link linkend="template-dependency-expansion-verbose">ŧ dependency-expansion-verbose</link></code> <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code> <code><link linkend="template-class-2-expansion-normal">ŧ class-2-expansion-normal</link></code></para><para>Used by function <code><link linkend="function-matches">tan:matches</link></code>()</para><para>Relies upon <code><link linkend="function-matches">tan:matches</link></code> .</para><para><emphasis>Option 2 (regex-ext-tan-functions)</emphasis></para><para><code>tan:matches($input as xs:string?, $pattern as xs:string, $flags as xs:string) as xs:boolean</code></para><para> Parallel to <code>fn:matches(</code>), but converts TAN-exceptions into classes. See <code><link linkend="function-regex">tan:regex</link></code>() for details. </para><para>Used by template <code><link linkend="template-dependency-expansion-verbose">ŧ dependency-expansion-verbose</link></code> <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code> <code><link linkend="template-class-2-expansion-normal">ŧ class-2-expansion-normal</link></code></para><para>Used by function <code><link linkend="function-matches">tan:matches</link></code>()</para><para>Relies upon <code><link linkend="function-regex">tan:regex</link></code> .</para></section>
<section xml:id="function-process-regex-escape-u"><title><code>tan:process-regex-escape-u()</code></title><para><code>tan:process-regex-escape-u($val-inside-braces as xs:string, $unicode-db as document-node()) as xs:string?</code></para><para>Used by function <code><link linkend="function-regex">tan:regex</link></code>()</para><para>Relies upon <code><link linkend="function-hex-to-dec">tan:hex-to-dec</link></code> <code><link linkend="function-codepoints-to-string">tan:codepoints-to-string</link></code> .</para></section>
<section xml:id="function-regex"><title><code>tan:regex()</code></title><para><code>tan:regex($regex as xs:string?) as xs:string?</code></para><para> Input: string representing a regex pattern </para><para> Output: the same string, with TAN-reserved escape sequences replaced by characters class sequences</para><para>        E.g., '\u{.greek.capital.perispomeni}' - - &gt; '[ἎἏἮἯἾἿὟὮὯᾎᾏᾞᾟᾮᾯ]'</para><para>        {.latin.cedilla} - - &gt; '[ÇçĢģĶķĻļŅņŖŗŞşŢţȨȩᷗḈḉḐḑḜḝḨḩ]'</para><para>        'angle {4d-4f, 51}' - - &gt; 'angle [MNOQ]'</para><para>        </para><para>        This function grabs entire classes of Unicode characters either by their codepoint or by the parts of </para><para>        their name. It performs specially upon the form {[VALUE]}, where [VALUE] is either (1) one or</para><para>        more hexadecimal numbers joined by commas and hyphens or (2) one or more words each one prepended by a</para><para>        period or exclamation mark. In the first option, there will be returned every Unicode character that has been </para><para>        picked, filling in ranges where indicated by the hyphen. In the second option, there will be returned </para><para>        every Unicode character that has all of those words in its official Unicode name, or alias or does not have words</para><para>        that have been prepended by the exclamation mark.</para><para>        Other examples:</para><para>        </para><para>          Any word with an omega, even if not in any of the Greek blocks: '{.omega}' (useful if you</para><para>          wish to find nonstandard uses of the omega, especially in the symbol block)</para><para>          </para><para>          Every Greek word that attracts an accent from an enclitic: </para><para>          '[{.greek.oxia}{.greek.tonos}{.greek.perispomeni}]\w*[{.greek.tonos}{.greek.oxia}]'</para><para>        </para><para>Used by function <code><link linkend="function-matches">tan:matches</link></code>() <code><link linkend="function-replace">tan:replace</link></code>() <code><link linkend="function-tokenize">tan:tokenize</link></code>()</para><para>Relies upon <code><link linkend="function-process-regex-escape-u">tan:process-regex-escape-u</link></code> <code><link linkend="template-add-square-brackets">ŧ add-square-brackets</link></code> .</para></section>
<section xml:id="function-replace"><title><code>tan:replace()</code></title><para><emphasis>Option 1 (regex-ext-tan-functions)</emphasis></para><para><code>tan:replace($input as xs:string?, $pattern as xs:string, $replacement as xs:string) as xs:string</code></para><para> three-param function of the four-param version below </para><para>Used by function <code><link linkend="function-batch-replace">tan:batch-replace</link></code>() <code><link linkend="function-replace">tan:replace</link></code>()</para><para>Relies upon <code><link linkend="function-replace">tan:replace</link></code> .</para><para><emphasis>Option 2 (regex-ext-tan-functions)</emphasis></para><para><code>tan:replace($input as xs:string?, $pattern as xs:string, $replacement as xs:string, $flags as xs:string) as xs:string</code></para><para> Parallel to <code>fn:replace(</code>), but converts TAN-exceptions into classes. See <code><link linkend="function-regex">tan:regex</link></code>() for details. </para><para>Used by function <code><link linkend="function-batch-replace">tan:batch-replace</link></code>() <code><link linkend="function-replace">tan:replace</link></code>()</para><para>Relies upon <code><link linkend="function-regex">tan:regex</link></code> .</para></section>
<section xml:id="function-string-base"><title><code>tan:string-base()</code></title><para><code>tan:string-base($arg as xs:string?) as xs:string?</code></para><para> This function takes any string and replaces every character with its base Unicode character.</para><para>      E.g., ἀνθρὠπους - &gt; ανθρωπουσ</para><para>      This is useful for preparing text to be searched without respect to accents</para><para>      </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-get-ucd-decomp">tan:get-ucd-decomp</link></code> .</para></section>
<section xml:id="function-string-composite"><title><code>tan:string-composite()</code></title><para><code>tan:string-composite($arg as xs:string?) as xs:string?</code></para><para> This function is the inverse of tan:string-base, in that it replaces every character with</para><para>         those Unicode characters that use it as a base. If none exist, then the character itself is </para><para>         returned.</para><para>         E.g., 'Max' - &gt; 'MᴹḾṀṂℳⅯⓂ㎆㎒㎫㎹㎿㏁Ｍ𝐌𝑀𝑴𝓜𝔐𝕄𝕸𝖬𝗠𝘔𝙈𝙼🄼🅋🅪🅫aªàáâãäåāăąǎǟǡǻȁȃȧᵃḁẚạảấầẩẫậắằẳẵặₐ℀℁ⓐ㏂ａ𝐚𝑎𝒂𝒶𝓪𝔞𝕒𝖆𝖺𝗮𝘢𝙖𝚊xˣẋẍₓⅹⅺⅻⓧｘ𝐱𝑥𝒙𝓍𝔁𝔵𝕩𝖝𝗑𝘅𝘹𝙭𝚡'</para><para>         This is useful for preparing regex character classes to broaden a search. </para><para>      </para><para>Used by function <code><link linkend="function-expand-search">tan:expand-search</link></code>()</para><para>Relies upon <code><link linkend="function-get-ucd-decomp">tan:get-ucd-decomp</link></code> .</para></section>
<section xml:id="function-tokenize"><title><code>tan:tokenize()</code></title><para><emphasis>Option 1 (regex-ext-tan-functions)</emphasis></para><para><code>tan:tokenize($input as xs:string?, $pattern as xs:string) as xs:string*</code></para><para> two-param function of the three-param version below </para><para>Used by function <code><link linkend="function-tokenize">tan:tokenize</link></code>()</para><para>Relies upon <code><link linkend="function-tokenize">tan:tokenize</link></code> .</para><para><emphasis>Option 2 (regex-ext-tan-functions)</emphasis></para><para><code>tan:tokenize($input as xs:string?, $pattern as xs:string, $flags as xs:string) as xs:string*</code></para><para> Parallel to <code>fn:tokenize(</code>), but converts TAN-exceptions into classes. See <code><link linkend="function-regex">tan:regex</link></code>() for details. </para><para>Used by function <code><link linkend="function-tokenize">tan:tokenize</link></code>()</para><para>Relies upon <code><link linkend="function-regex">tan:regex</link></code> .</para></section>
</section>
<section><title>templates</title><section xml:id="template-prep-regex-char-class"><title><code>Ŧ prep-regex-char-class</code></title><para>No variables, keys, functions, or named templates depend upon this xsl:template.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
</section>
</section>
<section><title>TAN-schema global variables, keys, and functions summarized</title><section><title>variables</title><section xml:id="variable-rng-collection"><title><code>$rng-collection</code></title><para>Definition: <code><link linkend="variable-schema-collection">$schema-collection</link>[rng:*]</code></para><para>Used by variable <code><link linkend="variable-rng-collection-without-TEI">$rng-collection-without-TEI</link></code> <code><link linkend="variable-TAN-elements-that-take-the-attribute-which">$TAN-elements-that-take-the-attribute-which</link></code></para><para>Used by function <code><link linkend="function-get-parent-elements">tan:get-parent-elements</link></code>()</para><para>Relies upon <code><link linkend="variable-schema-collection">$schema-collection</link></code> .</para></section>
<section xml:id="variable-rng-collection-without-TEI"><title><code>$rng-collection-without-TEI</code></title><para>Definition: <code><link linkend="variable-rng-collection">$rng-collection</link>[not(matches(base-uri(.), 'TAN-TEI'))]</code></para><para>Used by variable <code><link linkend="variable-TAN-elements-that-take-the-attribute-which">$TAN-elements-that-take-the-attribute-which</link></code></para><para>Used by function <code><link linkend="function-get-parent-elements">tan:get-parent-elements</link></code>()</para><para>Relies upon <code><link linkend="variable-rng-collection">$rng-collection</link></code> .</para></section>
<section xml:id="variable-schema-collection"><title><code>$schema-collection</code></title><para>Definition: <code>collection('../../schemas/collection.xml')</code></para><para>Used by variable <code><link linkend="variable-rng-collection">$rng-collection</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-TAN-elements-that-take-the-attribute-which"><title><code>$TAN-elements-that-take-the-attribute-which</code></title><para>Definition: <code>             <link linkend="function-get-parent-elements">tan:get-parent-elements</link>(<link linkend="variable-rng-collection-without-TEI">$rng-collection-without-TEI</link>/rng:grammar/rng:define[rng:attribute/@name = 'which'])</code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code></para><para>Relies upon <code><link linkend="function-get-parent-elements">tan:get-parent-elements</link></code> <code><link linkend="variable-rng-collection-without-TEI">$rng-collection-without-TEI</link></code> .</para></section>
</section>
<section><title>functions</title><section xml:id="function-get-parent-elements"><title><code>tan:get-parent-elements()</code></title><para><code>tan:get-parent-elements($current-elements as element()*) as element()*</code></para><para> requires as input some rng: element from <code><link linkend="variable-rng-collection">$rng-collection</link></code>, oftentimes an rng:element or rng:attribute </para><para>Used by variable <code><link linkend="variable-TAN-elements-that-take-the-attribute-which">$TAN-elements-that-take-the-attribute-which</link></code></para><para>Used by function <code><link linkend="function-get-parent-elements">tan:get-parent-elements</link></code>()</para><para>Relies upon <code><link linkend="variable-rng-collection-without-TEI">$rng-collection-without-TEI</link></code> <code><link linkend="function-get-parent-elements">tan:get-parent-elements</link></code> .</para></section>
</section>
</section>
<section><title>Mode templates</title><para>Templates based on modes are frequently found across constituent
                           files, so they are collated here separately, one entry per mode.</para><section xml:id="template-all"><title><code>ŧ #all</code></title><para>6 elements: <code>TAN-class-1-functions.xsl </code><code>TAN-core-functions.xsl </code></para><para> We ignore, but retain, tails throughout </para><para>No variables, keys, functions, or named templates depend upon this xsl:template.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-add-square-brackets"><title><code>ŧ add-square-brackets</code></title><para>2 elements: <code>regex-ext-tan-functions.xsl </code></para><para>Used by function <code><link linkend="function-expand-search">tan:expand-search</link></code>() <code><link linkend="function-regex">tan:regex</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-analyze-string-length-pass-1"><title><code>ŧ analyze-string-length-pass-1</code></title><para>2 elements: <code>TAN-class-1-functions.xsl </code></para><para> To process <code><link linkend="function-diff">tan:diff</link></code>() results </para><para>Used by function <code><link linkend="function-infuse-divs">tan:infuse-divs</link></code>() <code><link linkend="function-analyze-string-length">tan:analyze-string-length</link></code>()</para><para>Relies upon <code><link linkend="function-string-length">tan:string-length</link></code> <code><link linkend="function-text-join">tan:text-join</link></code> .</para></section><section xml:id="template-analyze-string-length-pass-2"><title><code>ŧ analyze-string-length-pass-2</code></title><para>1 element: <code>TAN-class-1-functions.xsl </code></para><para>Used by function <code><link linkend="function-infuse-divs">tan:infuse-divs</link></code>() <code><link linkend="function-analyze-string-length">tan:analyze-string-length</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-catalog-expansion-terse"><title><code>ŧ catalog-expansion-terse</code></title><para>2 elements: <code>TAN-core-expand-functions.xsl </code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-duplicate-items">tan:duplicate-items</link></code> <code><link linkend="variable-duplicate-ids">$duplicate-ids</link></code> .</para></section><section xml:id="template-check-referred-doc"><title><code>ŧ check-referred-doc</code></title><para>2 elements: <code>TAN-core-expand-functions.xsl </code></para><para> Look for errors in a document referred to </para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code></para><para>Relies upon <code><link linkend="variable-keys-1st-da">$keys-1st-da</link></code> <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-class-number">tan:class-number</link></code> <code><link linkend="variable-duplicate-head-iris">$duplicate-head-iris</link></code> <code><link linkend="variable-doc-id">$doc-id</link></code> <code><link linkend="variable-head">$head</link></code> <code><link linkend="function-normalize-text">tan:normalize-text</link></code> <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code> <code><link linkend="function-dateTime-to-decimal">tan:dateTime-to-decimal</link></code> <code><link linkend="function-get-doc-hist">tan:get-doc-hist</link></code> <code><link linkend="function-definition">tan:definition</link></code> <code><link linkend="variable-empty-doc">$empty-doc</link></code> <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code> <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> <code><link linkend="variable-see-alsos-resolved">$see-alsos-resolved</link></code> <code><link linkend="variable-sources-resolved">$sources-resolved</link></code> <code><link linkend="variable-keys-resolved">$keys-resolved</link></code> <code><link linkend="variable-inclusions-resolved">$inclusions-resolved</link></code> .</para></section><section xml:id="template-class-1-expansion-verbose"><title><code>ŧ class-1-expansion-verbose</code></title><para>4 elements: <code>TAN-class-1-functions.xsl </code></para><para> Evaluate each alternatively divided edition (ade) </para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>()</para><para>Relies upon <code><link linkend="function-definition">tan:definition</link></code> <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-string-to-numerals">tan:string-to-numerals</link></code> <code><link linkend="function-analyze-numbers-in-string">tan:analyze-numbers-in-string</link></code> <code><link linkend="function-help">tan:help</link></code> <code><link linkend="variable-zwj">$zwj</link></code> <code><link linkend="function-chop-string">tan:chop-string</link></code> <code><link linkend="function-normalize-div-text">tan:normalize-div-text</link></code> <code><link linkend="function-analyze-leaf-div-string-length">tan:analyze-leaf-div-string-length</link></code> <code><link linkend="variable-see-alsos-resolved">$see-alsos-resolved</link></code> <code><link linkend="function-merge-expanded-docs">tan:merge-expanded-docs</link></code> <code><link linkend="function-expand-doc">tan:expand-doc</link></code> <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code> <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> <code><link linkend="function-string-length">tan:string-length</link></code> <code><link linkend="function-diff">tan:diff</link></code> <code><link linkend="function-text-join">tan:text-join</link></code> .</para></section><section xml:id="template-class-2-expansion-normal"><title><code>ŧ class-2-expansion-normal</code></title><para>2 elements: <code>TAN-class-2-functions.xsl </code></para><para> If there's no specific reference, it's pointing to tokens anywhere in the source </para><para>&lt;xsl:param name="dependencies" tunnel="yes"/&gt;</para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>()</para><para>Relies upon <code><link linkend="function-matches">tan:matches</link></code> <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-get-via-q-ref">tan:get-via-q-ref</link></code> .</para></section><section xml:id="template-class-2-expansion-terse"><title><code>ŧ class-2-expansion-terse</code></title><para>2 elements: <code>TAN-A-lm-functions.xsl </code><code>TAN-class-2-functions.xsl </code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="template-class-2-expansion-terse-pass-2">ŧ class-2-expansion-terse-pass-2</link></code> <code><link linkend="function-get-via-q-ref">tan:get-via-q-ref</link></code> <code><link linkend="function-help">tan:help</link></code> <code><link linkend="function-matches">tan:matches</link></code> <code><link linkend="function-fix">tan:fix</link></code> <code><link linkend="function-expand-pos-or-chars">tan:expand-pos-or-chars</link></code> <code><link linkend="function-atomize-string">tan:atomize-string</link></code> .</para></section><section xml:id="template-class-2-expansion-terse-pass-2"><title><code>ŧ class-2-expansion-terse-pass-2</code></title><para>2 elements: <code>TAN-A-lm-functions.xsl </code></para><para>Used by template <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code></para><para>Relies upon <code><link linkend="function-resolve-idref">tan:resolve-idref</link></code> <code><link linkend="template-element-to-error">ŧ element-to-error</link></code> <code><link linkend="function-conditions-hold">tan:conditions-hold</link></code> <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-escape">tan:escape</link></code> .</para></section><section xml:id="template-class-2-expansion-verbose"><title><code>ŧ class-2-expansion-verbose</code></title><para>1 element: <code>TAN-class-2-functions.xsl </code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>()</para><para>Relies upon <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code> <code><link linkend="function-error">tan:error</link></code> .</para></section><section xml:id="template-copy-of-except"><title><code>ŧ copy-of-except</code></title><para>1 element: <code>TAN-core-functions.xsl </code></para><para>Used by function <code><link linkend="function-copy-of-except">tan:copy-of-except</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-core-expansion-normal"><title><code>ŧ core-expansion-normal</code></title><para>13 elements: <code>TAN-A-div-functions.xsl </code><code>TAN-key-functions.xsl </code><code>TAN-class-1-functions.xsl </code><code>TAN-class-2-functions.xsl </code><code>TAN-core-expand-functions.xsl </code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>()</para><para>Relies upon <code><link linkend="function-xml-to-string">tan:xml-to-string</link></code> <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code> <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-normalize-text">tan:normalize-text</link></code> <code><link linkend="variable-regex-characters-not-permitted">$regex-characters-not-permitted</link></code> <code><link linkend="function-copy-of-except">tan:copy-of-except</link></code> <code><link linkend="function-duplicate-items">tan:duplicate-items</link></code> <code><link linkend="function-get-doc-hist">tan:get-doc-hist</link></code> <code><link linkend="variable-orig-self">$orig-self</link></code> <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code> .</para></section><section xml:id="template-core-expansion-terse"><title><code>ŧ core-expansion-terse</code></title><para>31 elements: <code>TAN-A-div-functions.xsl </code><code>TAN-A-lm-functions.xsl </code><code>TAN-key-functions.xsl </code><code>TAN-class-1-functions.xsl </code><code>TAN-class-2-functions.xsl </code><code>TAN-class-3-functions.xsl </code><code>TAN-core-expand-functions.xsl </code></para><para> Homogenize tei:TEI to tan:TAN-T </para><para> Makes sure the tei:body rises rootward one level, as is customary in TAN and HTML </para><para> streamlined expansion of <code><link linkend="element-div">&lt;div&gt;</link></code>s; applied to dependencies of class-2 files only when there are no more alter items to process </para><para> dependencies must be evaluated at the terse stage </para><para> In terse mode, we do only basic checks on &lt;see also&gt;. The deep checks we do for inclusions and keys are reserved for the normal mode. </para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-expansion-terse</para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-help-extracted">tan:help-extracted</link></code> <code><link linkend="function-group-elements-by-shared-node-values">tan:group-elements-by-shared-node-values</link></code> <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-dependency-expansion-terse">ŧ dependency-expansion-terse</link></code> <code><link linkend="function-normalize-text">tan:normalize-text</link></code> <code><link linkend="variable-doc-namespace">$doc-namespace</link></code> <code><link linkend="variable-primary-agent">$primary-agent</link></code> <code><link linkend="function-duplicate-items">tan:duplicate-items</link></code> <code><link linkend="variable-official-urn-namespaces">$official-urn-namespaces</link></code> <code><link linkend="variable-duplicate-head-iris">$duplicate-head-iris</link></code> <code><link linkend="function-must-refer-to-external-tan-file">tan:must-refer-to-external-tan-file</link></code> <code><link linkend="function-definition">tan:definition</link></code> <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code> <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> <code><link linkend="variable-see-alsos-resolved">$see-alsos-resolved</link></code> <code><link linkend="variable-previous-TAN-versions">$previous-TAN-versions</link></code> <code><link linkend="variable-elements-that-refer-to-textual-items">$elements-that-refer-to-textual-items</link></code> <code><link linkend="variable-separator-hierarchy">$separator-hierarchy</link></code> <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link></code> <code><link linkend="variable-empty-element">$empty-element</link></code> <code><link linkend="variable-doc-id">$doc-id</link></code> <code><link linkend="variable-TAN-namespace">$TAN-namespace</link></code> <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code> <code><link linkend="variable-TAN-elements-that-take-the-attribute-which">$TAN-elements-that-take-the-attribute-which</link></code> <code><link linkend="function-data-type-check">tan:data-type-check</link></code> .</para></section><section xml:id="template-core-expansion-terse-alias"><title><code>ŧ core-expansion-terse-alias</code></title><para>2 elements: <code>TAN-core-expand-functions.xsl </code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>()</para><para>Relies upon <code><link linkend="function-resolve-alias">tan:resolve-alias</link></code> <code><link linkend="function-error">tan:error</link></code> .</para></section><section xml:id="template-core-expansion-terse-attributes"><title><code>ŧ core-expansion-terse-attributes</code></title><para>3 elements: <code>TAN-class-1-functions.xsl </code><code>TAN-core-expand-functions.xsl </code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>()</para><para>Relies upon <code><link linkend="variable-now">$now</link></code> <code><link linkend="function-help-extracted">tan:help-extracted</link></code> <code><link linkend="function-dateTime-to-decimal">tan:dateTime-to-decimal</link></code> <code><link linkend="function-error">tan:error</link></code> <code><link linkend="variable-doc-uri">$doc-uri</link></code> <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link></code> <code><link linkend="function-uri-relative-to">tan:uri-relative-to</link></code> <code><link linkend="variable-all-ids">$all-ids</link></code> <code><link linkend="variable-duplicate-ids">$duplicate-ids</link></code> <code><link linkend="function-duplicate-items">tan:duplicate-items</link></code> <code><link linkend="function-help">tan:help</link></code> <code><link linkend="function-resolve-idref">tan:resolve-idref</link></code> <code><link linkend="variable-head">$head</link></code> <code><link linkend="variable-id-idrefs">$id-idrefs</link></code> .</para></section><section xml:id="template-core-expansion-verbose"><title><code>ŧ core-expansion-verbose</code></title><para>1 element: <code>TAN-core-expand-functions.xsl </code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>()</para><para>Relies upon <code><link linkend="function-base-uri">tan:base-uri</link></code> <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> <code><link linkend="function-expand-doc">tan:expand-doc</link></code> <code><link linkend="function-error">tan:error</link></code> .</para></section><section xml:id="template-core-resolution-arabic-numerals"><title><code>ŧ core-resolution-arabic-numerals</code></title><para>3 elements: <code>TAN-class-1-functions.xsl </code><code>TAN-core-resolve-functions.xsl </code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>()</para><para>Relies upon <code><link linkend="variable-attributes-that-take-non-arabic-numerals">$attributes-that-take-non-arabic-numerals</link></code> <code><link linkend="function-string-to-numerals">tan:string-to-numerals</link></code> .</para></section><section xml:id="template-dependencies-tokenized-selectively"><title><code>ŧ dependencies-tokenized-selectively</code></title><para>3 elements: <code>TAN-class-1-functions.xsl </code></para><para>&lt;xsl:param name="class-2-doc" tunnel="yes" as="<code>document-node(</code>)?"/&gt;</para><para>&lt;xsl:param name="src-id" tunnel="yes"/&gt;</para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-tokenize-text">tan:tokenize-text</link></code> <code><link linkend="function-duplicate-items">tan:duplicate-items</link></code> <code><link linkend="function-shallow-copy">tan:shallow-copy</link></code> <code><link linkend="variable-separator-hierarchy">$separator-hierarchy</link></code> <code><link linkend="function-expand-pos-or-chars">tan:expand-pos-or-chars</link></code> .</para></section><section xml:id="template-dependency-expansion-normal"><title><code>ŧ dependency-expansion-normal</code></title><para>3 elements: <code>TAN-class-1-functions.xsl </code><code>TAN-core-expand-functions.xsl </code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-tokenize-text">tan:tokenize-text</link></code> .</para></section><section xml:id="template-dependency-expansion-terse"><title><code>ŧ dependency-expansion-terse</code></title><para>8 elements: <code>TAN-class-1-functions.xsl </code><code>TAN-class-3-functions.xsl </code><code>TAN-core-expand-functions.xsl </code></para><para> Homogenize tei:TEI to tan:TAN-T </para><para> Makes sure the tei:body rises rootward one level, as is customary in TAN and HTML </para><para> This template serves to make adjustments declared in the <code><link linkend="element-alter">&lt;alter&gt;</link></code> of a class 2 file upon a dependency class 1 file. </para><para> In the course of <code><link linkend="element-alter">&lt;alter&gt;</link></code> adjustments, errors may be detected that should be reported to the dependent class 2 file. In those cases, the specific instruction is copied along with its <code>@q</code> value, and the error is embedded inside. That way when the normalized source file is returned to the class 2 file, the specific error can be matched with the specific instruction in the <code><link linkend="element-alter">&lt;alter&gt;</link></code>. </para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-expansion-terse</para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="template-dependency-expansion-terse-no-alter">ŧ dependency-expansion-terse-no-alter</link></code> <code><link linkend="variable-doc-id">$doc-id</link></code> <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> <code><link linkend="template-dependency-expansion-terse">ŧ dependency-expansion-terse</link></code> <code><link linkend="function-resolve-alias">tan:resolve-alias</link></code> <code><link linkend="function-help-extracted">tan:help-extracted</link></code> <code><link linkend="function-duplicate-items">tan:duplicate-items</link></code> <code><link linkend="variable-empty-element">$empty-element</link></code> <code><link linkend="function-shallow-copy">tan:shallow-copy</link></code> <code><link linkend="variable-separator-hierarchy">$separator-hierarchy</link></code> <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link></code> .</para></section><section xml:id="template-dependency-expansion-terse-no-alter"><title><code>ŧ dependency-expansion-terse-no-alter</code></title><para>1 element: <code>TAN-class-1-functions.xsl </code></para><para> streamlined expansion of <code><link linkend="element-div">&lt;div&gt;</link></code>s; applied to dependencies of class-2 files only when there are no more alter items to process </para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-expansion-terse <code><link linkend="template-dependency-expansion-terse">ŧ dependency-expansion-terse</link></code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>()</para><para>Relies upon <code><link linkend="variable-empty-element">$empty-element</link></code> <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link></code> <code><link linkend="variable-separator-hierarchy">$separator-hierarchy</link></code> <code><link linkend="function-error">tan:error</link></code> .</para></section><section xml:id="template-dependency-expansion-verbose"><title><code>ŧ dependency-expansion-verbose</code></title><para>4 elements: <code>TAN-class-1-functions.xsl </code></para><para>No variables, keys, functions, or named templates depend upon this xsl:template.</para><para>Relies upon <code><link linkend="function-matches">tan:matches</link></code> <code><link linkend="function-tokenize-text">tan:tokenize-text</link></code> .</para></section><section xml:id="template-diff-to-collation"><title><code>ŧ diff-to-collation</code></title><para>4 elements: <code>TAN-core-string-functions.xsl </code></para><para>Used by function <code><link linkend="function-collate">tan:collate</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-divs-excluding-what-qs"><title><code>ŧ divs-excluding-what-qs</code></title><para>1 element: <code>TAN-class-2-functions.xsl </code></para><para>Used by template <code><link linkend="template-reset-hierarchy">ŧ reset-hierarchy</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-element-to-error"><title><code>ŧ element-to-error</code></title><para>1 element: <code>TAN-core-errors.xsl </code></para><para> This template turns any simple element (e.g., <code><link linkend="element-report">&lt;report&gt;</link></code>, <code><link linkend="element-assert">&lt;assert&gt;</link></code>, <code><link linkend="element-comment">&lt;comment&gt;</link></code>, <code><link linkend="element-change">&lt;change&gt;</link></code>) into an error report </para><para>Used by template <code><link linkend="template-class-2-expansion-terse-pass-2">ŧ class-2-expansion-terse-pass-2</link></code></para><para>Relies upon <code><link linkend="variable-errors">$errors</link></code> .</para></section><section xml:id="template-evaluate-conditions"><title><code>ŧ evaluate-conditions</code></title><para>6 elements: <code>TAN-A-lm-functions.xsl </code><code>TAN-core-functions.xsl </code></para><para>Used by function <code><link linkend="function-condition-evaluation-loop">tan:condition-evaluation-loop</link></code>()</para><para>Relies upon <code><link linkend="function-escape">tan:escape</link></code> .</para></section><section xml:id="template-expand-tan-key-dependencies"><title><code>ŧ expand-tan-key-dependencies</code></title><para>3 elements: <code>TAN-core-expand-functions.xsl </code><code>TAN-core-resolve-functions.xsl </code></para><para> The first-stamp mode ensures that when a document is handed over to a variable, the original document URI is not lost. It also provides (1) the breadcrumbing service, so that errors occurring downstream, in an inclusion or TAN-key file can be diagnosed; (2) the option for <code><link linkend="attribute-src">@src</link></code> to be imprinted on the root element, so that a class 1 TAN file can be tethered to a class 2 file that uses it as a source; (3) the conversion of <code><link linkend="attribute-href">@href</link></code> to an absolute URI, resolved against the document's base.</para><para>Used by variable <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-expansion-terse</para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>()</para><para>Relies upon <code><link linkend="function-normalize-text">tan:normalize-text</link></code> <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-base-uri">tan:base-uri</link></code> .</para></section><section xml:id="template-first-stamp"><title><code>ŧ first-stamp</code></title><para>2 elements: <code>TAN-core-resolve-functions.xsl </code></para><para> The first-stamp mode ensures that when a document is handed over to a variable, the original document URI is not lost. It also provides (1) the breadcrumbing service, so that errors occurring downstream, in an inclusion or TAN-key file can be diagnosed; (2) the option for <code><link linkend="attribute-src">@src</link></code> to be imprinted on the root element, so that a class 1 TAN file can be tethered to a class 2 file that uses it as a source; (3) the conversion of <code><link linkend="attribute-href">@href</link></code> to an absolute URI, resolved against the document's base.</para><para>Used by variable <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code></para><para>Used by function <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>()</para><para>Relies upon <code><link linkend="function-base-uri">tan:base-uri</link></code> .</para></section><section xml:id="template-fragment-to-text"><title><code>ŧ fragment-to-text</code></title><para>5 elements: <code>TAN-core-functions.xsl </code></para><para>Used by function <code><link linkend="function-xml-to-string">tan:xml-to-string</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-infuse-tokenized-div"><title><code>ŧ infuse-tokenized-div</code></title><para>1 element: <code>TAN-class-1-functions.xsl </code></para><para>No variables, keys, functions, or named templates depend upon this xsl:template.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-infuse-tokenized-text"><title><code>ŧ infuse-tokenized-text</code></title><para>1 element: <code>TAN-class-1-functions.xsl </code></para><para>Used by function <code><link linkend="function-infuse-divs">tan:infuse-divs</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-merge-divs"><title><code>ŧ merge-divs</code></title><para>3 elements: <code>TAN-class-1-functions.xsl </code></para><para> Special feature to itemize leaf divs, to differentiate them in a merge from <code><link linkend="element-div">&lt;div&gt;</link></code>s of other versions </para><para>Used by function <code><link linkend="function-merge-divs">tan:merge-divs</link></code>() <code><link linkend="function-merge-expanded-docs">tan:merge-expanded-docs</link></code>()</para><para>Relies upon <code><link linkend="function-group-elements-by-shared-node-values">tan:group-elements-by-shared-node-values</link></code> <code><link linkend="function-text-join">tan:text-join</link></code> <code><link linkend="variable-separator-hierarchy">$separator-hierarchy</link></code> <code><link linkend="template-strip-duplicate-children-by-attribute-value">ŧ strip-duplicate-children-by-attribute-value</link></code> .</para></section><section xml:id="template-merge-expanded-docs-prep"><title><code>ŧ merge-expanded-docs-prep</code></title><para>3 elements: <code>TAN-class-1-functions.xsl </code></para><para>Used by function <code><link linkend="function-merge-expanded-docs">tan:merge-expanded-docs</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-no-misfit-divs-or-anchors"><title><code>ŧ no-misfit-divs-or-anchors</code></title><para>1 element: <code>TAN-class-2-functions.xsl </code></para><para>Used by template <code><link linkend="template-only-misfit-divs-and-anchors">ŧ only-misfit-divs-and-anchors</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-normalize-tei-space"><title><code>ŧ normalize-tei-space</code></title><para>1 element: <code>TAN-class-1-functions.xsl </code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-expansion-terse</para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> .</para></section><section xml:id="template-normalize-xml-fragment-space"><title><code>ŧ normalize-xml-fragment-space</code></title><para>1 element: <code>TAN-extra-functions.xsl </code></para><para>Used by function <code><link linkend="function-normalize-xml-element-space">tan:normalize-xml-element-space</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-only-misfit-divs"><title><code>ŧ only-misfit-divs</code></title><para>1 element: <code>TAN-class-2-functions.xsl </code></para><para>Used by template <code><link linkend="template-reset-hierarchy">ŧ reset-hierarchy</link></code></para><para>Relies upon <code><link linkend="variable-separator-hierarchy">$separator-hierarchy</link></code> .</para></section><section xml:id="template-only-misfit-divs-and-anchors"><title><code>ŧ only-misfit-divs-and-anchors</code></title><para>1 element: <code>TAN-class-2-functions.xsl </code></para><para>Used by template <code><link linkend="template-reset-hierarchy">ŧ reset-hierarchy</link></code></para><para>Relies upon <code><link linkend="template-no-misfit-divs-or-anchors">ŧ no-misfit-divs-or-anchors</link></code> .</para></section><section xml:id="template-pluck"><title><code>ŧ pluck</code></title><para>3 elements: <code>TAN-core-functions.xsl </code></para><para>Used by function <code><link linkend="function-pluck">tan:pluck</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-prepend-id-or-idrefs"><title><code>ŧ prepend-id-or-idrefs</code></title><para>1 element: <code>TAN-core-resolve-functions.xsl </code></para><para>Used by function <code><link linkend="function-prepend-id-or-idrefs">tan:prepend-id-or-idrefs</link></code>()</para><para>Relies upon <code><link linkend="variable-id-idrefs">$id-idrefs</link></code> .</para></section><section xml:id="template-reconstruct-div-hierarchy"><title><code>ŧ reconstruct-div-hierarchy</code></title><para>1 element: <code>TAN-class-2-functions.xsl </code></para><para>Used by template <code><link linkend="template-reset-hierarchy">ŧ reset-hierarchy</link></code></para><para>Relies upon <code><link linkend="variable-separator-hierarchy">$separator-hierarchy</link></code> .</para></section><section xml:id="template-reset-hierarchy"><title><code>ŧ reset-hierarchy</code></title><para>1 element: <code>TAN-class-2-functions.xsl </code></para><para>&lt;xsl:param name="test" tunnel="yes" select="<code>false(</code>)"/&gt;</para><para>Used by function <code><link linkend="function-reset-hierarchy">tan:reset-hierarchy</link></code>() <code><link linkend="function-expand-doc">tan:expand-doc</link></code>()</para><para>Relies upon <code><link linkend="function-merge-divs">tan:merge-divs</link></code> <code><link linkend="template-only-misfit-divs">ŧ only-misfit-divs</link></code> <code><link linkend="template-only-misfit-divs-and-anchors">ŧ only-misfit-divs-and-anchors</link></code> <code><link linkend="template-reconstruct-div-hierarchy">ŧ reconstruct-div-hierarchy</link></code> <code><link linkend="template-divs-excluding-what-qs">ŧ divs-excluding-what-qs</link></code> .</para></section><section xml:id="template-resolve-attr-include"><title><code>ŧ resolve-attr-include</code></title><para>1 element: <code>TAN-core-resolve-functions.xsl </code></para><para>Used by function <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>()</para><para>Relies upon <code><link linkend="function-normalize-text">tan:normalize-text</link></code> <code><link linkend="function-prepend-id-or-idrefs">tan:prepend-id-or-idrefs</link></code> <code><link linkend="function-error">tan:error</link></code> .</para></section><section xml:id="template-resolve-href"><title><code>ŧ resolve-href</code></title><para>1 element: <code>TAN-core-resolve-functions.xsl </code></para><para>Used by variable <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code></para><para>Used by function <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>() <code><link linkend="function-resolve-href">tan:resolve-href</link></code>()</para><para>Relies upon <code><link linkend="function-base-uri">tan:base-uri</link></code> .</para></section><section xml:id="template-resolve-keyword"><title><code>ŧ resolve-keyword</code></title><para>1 element: <code>TAN-core-resolve-functions.xsl </code></para><para>Used by function <code><link linkend="function-resolve-keyword">tan:resolve-keyword</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>()</para><para>Relies upon <code><link linkend="function-help-extracted">tan:help-extracted</link></code> <code><link linkend="function-glossary">tan:glossary</link></code> <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-help">tan:help</link></code> .</para></section><section xml:id="template-snap-to-word-pass-1"><title><code>ŧ snap-to-word-pass-1</code></title><para>2 elements: <code>TAN-core-string-functions.xsl </code></para><para>Used by function <code><link linkend="function-diff">tan:diff</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-string-to-numerals"><title><code>ŧ string-to-numerals</code></title><para>1 element: <code>TAN-core-functions.xsl </code></para><para>Used by function <code><link linkend="function-analyze-numbers-in-string">tan:analyze-numbers-in-string</link></code>()</para><para>Relies upon <code><link linkend="function-aaa-to-int">tan:aaa-to-int</link></code> <code><link linkend="function-letter-to-number">tan:letter-to-number</link></code> <code><link linkend="variable-n-type-pattern">$n-type-pattern</link></code> <code><link linkend="variable-n-type">$n-type</link></code> <code><link linkend="variable-separator-hierarchy-minor">$separator-hierarchy-minor</link></code> <code><link linkend="function-rom-to-int">tan:rom-to-int</link></code> .</para></section><section xml:id="template-strip-all-attributes-except"><title><code>ŧ strip-all-attributes-except</code></title><para>1 element: <code>TAN-core-functions.xsl </code></para><para>Used by function <code><link linkend="function-infuse-divs">tan:infuse-divs</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-strip-duplicate-children-by-attribute-value"><title><code>ŧ strip-duplicate-children-by-attribute-value</code></title><para>1 element: <code>TAN-core-functions.xsl </code></para><para>Used by template <code><link linkend="template-merge-divs">ŧ merge-divs</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-strip-duplicates"><title><code>ŧ strip-duplicates</code></title><para>1 element: <code>TAN-core-resolve-functions.xsl </code></para><para>Used by function <code><link linkend="function-strip-duplicates">tan:strip-duplicates</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-strip-specific-attributes"><title><code>ŧ strip-specific-attributes</code></title><para>1 element: <code>TAN-core-functions.xsl </code></para><para>No variables, keys, functions, or named templates depend upon this xsl:template.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-strip-text"><title><code>ŧ strip-text</code></title><para>1 element: <code>TAN-extra-functions.xsl </code></para><para>No variables, keys, functions, or named templates depend upon this xsl:template.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-text-join"><title><code>ŧ text-join</code></title><para>3 elements: <code>TAN-class-1-functions.xsl </code></para><para>Used by template <code><link linkend="template-text-join">ŧ text-join</link></code></para><para>Used by function <code><link linkend="function-text-join">tan:text-join</link></code>()</para><para>Relies upon <code><link linkend="function-normalize-div-text">tan:normalize-div-text</link></code> <code><link linkend="template-text-join">ŧ text-join</link></code> .</para></section><section xml:id="template-text-only"><title><code>ŧ text-only</code></title><para>1 element: <code>TAN-extra-functions.xsl </code></para><para>No variables, keys, functions, or named templates depend upon this xsl:template.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-tokenize-div"><title><code>ŧ tokenize-div</code></title><para>1 element: <code>TAN-class-1-functions.xsl </code></para><para>Used by function <code><link linkend="function-tokenize-div">tan:tokenize-div</link></code>()</para><para>Relies upon <code><link linkend="function-tokenize-text">tan:tokenize-text</link></code> .</para></section></section></chapter>