<?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 162 global variables, 9 keys (ʞ = key), 215 functions, and 117 templates (Ŧ = named template; ŧ = template mode) defined in the TAN function library, are the following:</para><para>Dependencies refer exclusively to components of the TAN function library, both the
               core validation procedures and the extra functions. A variable, function, or template
               listed as not being relied upon may have dependencies in the files in the
               subdirectory <code>applications</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><para>ŧ #all </para>
<para><code><link linkend="function-aaa-to-int">tan:aaa-to-int</link>()</code> <code><link linkend="function-acronym">tan:acronym</link>()</code> <code><link linkend="function-add-attribute">tan:add-attribute</link>()</code> <code><link linkend="template-add-collation-pos-offset">ŧ add-collation-pos-offset</link></code> <code><link linkend="template-add-tok-pos">ŧ add-tok-pos</link></code> <code><link linkend="function-adjust-diff">tan:adjust-diff</link>()</code> <code><link linkend="function-all-conditions-hold">tan:all-conditions-hold</link>()</code> <code><link linkend="function-all-conditions-hold-evaluation-loop">tan:all-conditions-hold-evaluation-loop</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-ids-not-in-inclusions">$all-ids-not-in-inclusions</link></code> <code><link linkend="variable-all-selector">$all-selector</link></code> <code><link linkend="variable-all-vocabularies">$all-vocabularies</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">rgx:analyze-string</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-annotations-1st-da">$annotations-1st-da</link></code> <code><link linkend="variable-annotations-resolved">$annotations-resolved</link></code> <code><link linkend="variable-apos">$apos</link></code> <code><link linkend="variable-applications-collection">$applications-collection</link></code> <code><link linkend="variable-applications-uri-collection">$applications-uri-collection</link></code> <code><link linkend="template-apply-inclusions-and-adjust-vocabulary">ŧ apply-inclusions-and-adjust-vocabulary</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="function-attr">tan:attr</link>()</code> <code><link linkend="function-attribute-vocabulary">tan:attribute-vocabulary</link>()</code> <code><link linkend="key-attrs-by-name">ʞ attrs-by-name</link></code> </para>
<para><code><link linkend="variable-base-marker-regex">$base-marker-regex</link></code> <code><link linkend="function-base-uri">tan:base-uri</link>()</code> <code><link linkend="variable-base64-key">$base64-key</link></code> <code><link linkend="function-base64-to-bin">tan:base64-to-bin</link>()</code> <code><link linkend="function-base64-to-dec">tan:base64-to-dec</link>()</code> <code><link linkend="function-batch-replace">tan:batch-replace</link>()</code> <code><link linkend="function-batch-replace-advanced">tan:batch-replace-advanced</link>()</code> <code><link linkend="template-batch-replace-advanced">ŧ batch-replace-advanced</link></code> <code><link linkend="function-best-unicode-version">rgx:best-unicode-version</link>()</code> <code><link linkend="function-blend-alpha-value">tan:blend-alpha-value</link>()</code> <code><link linkend="function-blend-color-channel-value">tan:blend-color-channel-value</link>()</code> <code><link linkend="function-blend-colors">tan:blend-colors</link>()</code> <code><link linkend="variable-body">$body</link></code> <code><link linkend="function-build-char-replacement-guide">rgx:build-char-replacement-guide</link>()</code> <code><link linkend="template-build-grouping-key">ŧ build-grouping-key</link></code> <code><link linkend="template-build-morpheus-ana">ŧ build-morpheus-ana</link></code> <code><link linkend="template-build-morpheus-lex">ŧ build-morpheus-lex</link></code> <code><link linkend="function-build-parent-ref-tree">tan:build-parent-ref-tree</link>()</code> </para>
<para><code><link linkend="template-catalog-expansion-terse">ŧ catalog-expansion-terse</link></code> <code><link linkend="function-catalog-uris">tan:catalog-uris</link>()</code> <code><link linkend="function-catalogs">tan:catalogs</link>()</code> <code><link linkend="function-cfn">tan:cfn</link>()</code> <code><link linkend="function-cfne">tan:cfne</link>()</code> <code><link linkend="variable-char-reg-exp">$char-reg-exp</link></code> <code><link linkend="variable-characters-allowed-in-ucd-names-regex">$characters-allowed-in-ucd-names-regex</link></code> <code><link linkend="variable-characters-to-escape-when-converting-string-to-regex">$characters-to-escape-when-converting-string-to-regex</link></code> <code><link linkend="template-check-and-expand-ranges">ŧ check-and-expand-ranges</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-claims-morpheus">ŧ claims-morpheus</link></code> <code><link linkend="template-claims-morpheus-desc">ŧ claims-morpheus-desc</link></code> <code><link linkend="template-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</link></code> <code><link linkend="template-class-1-expansion-verbose-pass-2">ŧ class-1-expansion-verbose-pass-2</link></code> <code><link linkend="template-class-1-expansion-verbose-pass-3">ŧ class-1-expansion-verbose-pass-3</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-for-validation">ŧ class-2-expansion-terse-for-validation</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-clean-reset-divs-1">ŧ clean-reset-divs-1</link></code> <code><link linkend="template-clean-reset-divs-2">ŧ clean-reset-divs-2</link></code> <code><link linkend="template-clean-up-collation-pass-1">ŧ clean-up-collation-pass-1</link></code> <code><link linkend="template-clean-up-collation-pass-2">ŧ clean-up-collation-pass-2</link></code> <code><link linkend="variable-close-group-symbols-regex">$close-group-symbols-regex</link></code> <code><link linkend="function-codepoints-to-string">rgx: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-collate-pair-of-sequences">tan:collate-pair-of-sequences</link>()</code> <code><link linkend="function-collate-sequence-loop">tan:collate-sequence-loop</link>()</code> <code><link linkend="function-collate-sequences">tan:collate-sequences</link>()</code> <code><link linkend="function-collation-to-strings">tan:collation-to-strings</link>()</code> <code><link linkend="template-collation-to-strings">ŧ collation-to-strings</link></code> <code><link linkend="function-collection">tan:collection</link>()</code> <code><link linkend="function-commas-and-ands">tan:commas-and-ands</link>()</code> <code><link linkend="function-common-end-string">tan:common-end-string</link>()</code> <code><link linkend="function-common-start-or-end-string">tan:common-start-or-end-string</link>()</code> <code><link linkend="function-common-start-string">tan:common-start-string</link>()</code> <code><link linkend="variable-composite-marker-regex">$composite-marker-regex</link></code> <code><link linkend="function-copy-indentation">tan:copy-indentation</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-ad-hoc-pre-pass">ŧ core-expansion-ad-hoc-pre-pass</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-attributes">ŧ core-expansion-terse-attributes</link></code> <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code> <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code> <code><link linkend="function-counts-to-lasts">tan:counts-to-lasts</link>()</code> <code><link linkend="template-cut-faulty-hrefs">ŧ cut-faulty-hrefs</link></code> </para>
<para><code><link linkend="function-data-type-check">tan:data-type-check</link>()</code> <code><link linkend="variable-datatypes-that-require-unit-specification">$datatypes-that-require-unit-specification</link></code> <code><link linkend="function-dateTime-to-decimal">tan:dateTime-to-decimal</link>()</code> <code><link linkend="function-dec-to-bin">tan:dec-to-bin</link>()</code> <code><link linkend="function-dec-to-hex">rgx:dec-to-hex</link>()</code> <code><link linkend="function-dec-to-n">rgx:dec-to-n</link>()</code> <code><link linkend="variable-default-ucd-decomp-db">$default-ucd-decomp-db</link></code> <code><link linkend="variable-default-ucd-decomp-simple-db">$default-ucd-decomp-simple-db</link></code> <code><link linkend="variable-default-ucd-names-db">$default-ucd-names-db</link></code> <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code> <code><link linkend="template-dependency-adjustments-pass-2">ŧ dependency-adjustments-pass-2</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> <code><link linkend="variable-dhy">$dhy</link></code> <code><link linkend="function-diff">tan:diff</link>()</code> <code><link linkend="function-diff-cache">tan:diff-cache</link>()</code> <code><link linkend="function-diff-inner-loop">tan:diff-inner-loop</link>()</code> <code><link linkend="function-diff-outer-loop">tan:diff-outer-loop</link>()</code> <code><link linkend="function-diff-to-collation">tan:diff-to-collation</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-ref">ʞ div-via-ref</link></code> <code><link linkend="key-divs-to-reset">ʞ divs-to-reset</link></code> <code><link linkend="variable-doc-catalog-uris">$doc-catalog-uris</link></code> <code><link linkend="variable-doc-catalogs">$doc-catalogs</link></code> <code><link linkend="variable-doc-class">$doc-class</link></code> <code><link linkend="variable-doc-filename">$doc-filename</link></code> <code><link linkend="variable-doc-history">$doc-history</link></code> <code><link linkend="variable-doc-id">$doc-id</link></code> <code><link linkend="function-doc-id-namespace">tan:doc-id-namespace</link>()</code> <code><link linkend="variable-doc-id-namespace">$doc-id-namespace</link></code> <code><link linkend="variable-doc-is-error-test">$doc-is-error-test</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-doc-vocabulary">$doc-vocabulary</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> <code><link linkend="function-duplicate-values">tan:duplicate-values</link>()</code> </para>
<para><code><link linkend="function-element-fingerprint">tan:element-fingerprint</link>()</code> <code><link linkend="template-element-fingerprint">ŧ element-fingerprint</link></code> <code><link linkend="template-element-to-error">ŧ element-to-error</link></code> <code><link linkend="function-element-vocabulary">tan:element-vocabulary</link>()</code> <code><link linkend="key-elements-by-name">ʞ elements-by-name</link></code> <code><link linkend="variable-elements-supported-by-TAN-vocabulary-files">$elements-supported-by-TAN-vocabulary-files</link></code> <code><link linkend="key-elements-with-attrs-named">ʞ elements-with-attrs-named</link></code> <code><link linkend="function-ellipses">tan:ellipses</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-english-articles">$english-articles</link></code> <code><link linkend="variable-english-prepositions">$english-prepositions</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-codes">tan:error-codes</link>()</code> <code><link linkend="variable-error-markers">$error-markers</link></code> <code><link linkend="function-error-report">tan:error-report</link>()</code> <code><link linkend="variable-error-tests">$error-tests</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">rgx:escape</link>()</code> <code><link linkend="variable-escapes-in-regex">$escapes-in-regex</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-doc-test">tan:expand-doc-test</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="template-expand-reassigns">ŧ expand-reassigns</link></code> <code><link linkend="template-expand-standard-tan-voc">ŧ expand-standard-tan-voc</link></code> <code><link linkend="variable-extra-vocabulary-files">$extra-vocabulary-files</link></code> </para>
<para><code><link linkend="function-fill">tan:fill</link>()</code> <code><link linkend="function-first-loc-available">tan:first-loc-available</link>()</code> <code><link linkend="function-first-loc-available-loop">tan:first-loc-available-loop</link>()</code> <code><link linkend="template-first-stamp-shallow-copy">ŧ first-stamp-shallow-copy</link></code> <code><link linkend="template-first-stamp-shallow-skip">ŧ first-stamp-shallow-skip</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="key-get-ana">ʞ get-ana</link></code> <code><link linkend="function-get-and-resolve-dependency">tan:get-and-resolve-dependency</link>()</code> <code><link linkend="function-get-chars-by-name">rgx:get-chars-by-name</link>()</code> <code><link linkend="function-get-doc-history">tan:get-doc-history</link>()</code> <code><link linkend="template-get-doc-history">ŧ get-doc-history</link></code> <code><link linkend="template-get-IRI-name">ŧ get-IRI-name</link></code> <code><link linkend="function-get-parent-elements">tan:get-parent-elements</link>()</code> <code><link linkend="function-get-ucd-decomp-db">rgx:get-ucd-decomp-db</link>()</code> <code><link linkend="function-get-ucd-decomp-simple-db">rgx:get-ucd-decomp-simple-db</link>()</code> <code><link linkend="function-get-ucd-names-db">rgx:get-ucd-names-db</link>()</code> <code><link linkend="template-get-undefined-idrefs">ŧ get-undefined-idrefs</link></code> <code><link linkend="function-get-via-q-ref">tan:get-via-q-ref</link>()</code> <code><link linkend="function-giant-diff">tan:giant-diff</link>()</code> <code><link linkend="function-glob-to-regex">tan:glob-to-regex</link>()</code> <code><link linkend="function-grc-to-int">tan:grc-to-int</link>()</code> <code><link linkend="variable-grc-tokens-without-accents">$grc-tokens-without-accents</link></code> <code><link linkend="variable-greek-hundreds-regex">$greek-hundreds-regex</link></code> <code><link linkend="variable-greek-letter-numeral-pattern">$greek-letter-numeral-pattern</link></code> <code><link linkend="variable-greek-tens-regex">$greek-tens-regex</link></code> <code><link linkend="variable-greek-unit-regex">$greek-unit-regex</link></code> <code><link linkend="function-group-divs">tan:group-divs</link>()</code> <code><link linkend="function-group-divs-by-ref">tan:group-divs-by-ref</link>()</code> <code><link linkend="function-group-elements">tan:group-elements</link>()</code> <code><link linkend="function-group-elements-by-IRI">tan:group-elements-by-IRI</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">rgx:hex-to-dec</link>()</code> </para>
<para><code><link linkend="variable-id-idrefs">$id-idrefs</link></code> <code><link linkend="template-imitate-validation">ŧ imitate-validation</link></code> <code><link linkend="template-imprint-adjustment-action">ŧ imprint-adjustment-action</link></code> <code><link linkend="function-imprint-adjustment-locator">tan:imprint-adjustment-locator</link>()</code> <code><link linkend="template-imprint-vocabulary">ŧ imprint-vocabulary</link></code> <code><link linkend="variable-inclusions-resolved">$inclusions-resolved</link></code> <code><link linkend="template-indent-items">ŧ indent-items</link></code> <code><link linkend="function-indent-value">tan:indent-value</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-end-check">ŧ infuse-tokenized-div-end-check</link></code> <code><link linkend="template-infuse-tokenized-text">ŧ infuse-tokenized-text</link></code> <code><link linkend="template-infuse-tokenized-text-cleanup">ŧ infuse-tokenized-text-cleanup</link></code> <code><link linkend="function-initial-upper-case">tan:initial-upper-case</link>()</code> <code><link linkend="function-insert-as-first-child">tan:insert-as-first-child</link>()</code> <code><link linkend="function-insert-as-last-child">tan:insert-as-last-child</link>()</code> <code><link linkend="template-insert-content">ŧ insert-content</link></code> <code><link linkend="function-int-to-aaa">tan:int-to-aaa</link>()</code> <code><link linkend="function-int-to-grc">tan:int-to-grc</link>()</code> <code><link linkend="function-integers-to-sequence">tan:integers-to-sequence</link>()</code> <code><link linkend="template-integers-to-sequence">ŧ integers-to-sequence</link></code> <code><link linkend="variable-internet-available">$internet-available</link></code> <code><link linkend="function-is-valid-uri">tan:is-valid-uri</link>()</code> <code><link linkend="variable-iso-639-3">$iso-639-3</link></code> <code><link linkend="key-item-via-node-name">ʞ item-via-node-name</link></code> <code><link linkend="template-itemize-lms">ŧ itemize-lms</link></code> </para>
<para><code><link linkend="function-lang-catalog">tan:lang-catalog</link>()</code> <code><link linkend="function-lang-code">tan:lang-code</link>()</code> <code><link linkend="function-lang-name">tan:lang-name</link>()</code> <code><link linkend="variable-languages-supported">$languages-supported</link></code> <code><link linkend="function-last-change-agent">tan:last-change-agent</link>()</code> <code><link linkend="variable-latin-letter-numeral-pattern">$latin-letter-numeral-pattern</link></code> <code><link linkend="function-lengths-to-positions">tan:lengths-to-positions</link>()</code> <code><link linkend="function-letter-to-number">tan:letter-to-number</link>()</code> <code><link linkend="function-lm-data">tan:lm-data</link>()</code> <code><link linkend="variable-local-catalog">$local-catalog</link></code> <code><link linkend="variable-local-TAN-collection">$local-TAN-collection</link></code> <code><link linkend="variable-local-TAN-voc-collection">$local-TAN-voc-collection</link></code> <code><link linkend="function-longest-ascending-subsequence">tan:longest-ascending-subsequence</link>()</code> </para>
<para><code><link linkend="template-mark-dependencies-for-validation">ŧ mark-dependencies-for-validation</link></code> <code><link linkend="template-mark-dependencies-for-validation-skip-divs">ŧ mark-dependencies-for-validation-skip-divs</link></code> <code><link linkend="template-mark-dependencies-pass-1">ŧ mark-dependencies-pass-1</link></code> <code><link linkend="template-mark-dependencies-pass-2">ŧ mark-dependencies-pass-2</link></code> <code><link linkend="template-mark-dependencies-pass-2-for-validation">ŧ mark-dependencies-pass-2-for-validation</link></code> <code><link linkend="template-mark-reassigns">ŧ mark-reassigns</link></code> <code><link linkend="template-mark-tok-chars">ŧ mark-tok-chars</link></code> <code><link linkend="template-mark-tok-pos">ŧ mark-tok-pos</link></code> <code><link linkend="function-matches">rgx: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-anas">tan:merge-anas</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-tan-doc-leaf-divs">ŧ merge-tan-doc-leaf-divs</link></code> <code><link linkend="template-merge-tan-docs">ŧ merge-tan-docs</link></code> <code><link linkend="variable-model-1st-da">$model-1st-da</link></code> <code><link linkend="variable-model-resolved">$model-resolved</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="variable-most-common-indentations">$most-common-indentations</link></code> <code><link linkend="function-most-common-item">tan:most-common-item</link>()</code> <code><link linkend="function-most-common-item-count">tan:most-common-item-count</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="function-n-to-dec">rgx:n-to-dec</link>()</code> <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="variable-name-marker-regex">$name-marker-regex</link></code> <code><link linkend="variable-names-of-attributes-that-are-case-indifferent">$names-of-attributes-that-are-case-indifferent</link></code> <code><link linkend="variable-names-of-attributes-that-may-take-multiple-space-delimited-values">$names-of-attributes-that-may-take-multiple-space-delimited-values</link></code> <code><link linkend="variable-names-of-attributes-that-permit-keyword-last">$names-of-attributes-that-permit-keyword-last</link></code> <code><link linkend="variable-names-of-attributes-that-take-idrefs">$names-of-attributes-that-take-idrefs</link></code> <code><link linkend="variable-names-of-elements-that-describe-text-bearers">$names-of-elements-that-describe-text-bearers</link></code> <code><link linkend="variable-names-of-elements-that-describe-text-creators">$names-of-elements-that-describe-text-creators</link></code> <code><link linkend="variable-names-of-elements-that-describe-textual-entities">$names-of-elements-that-describe-textual-entities</link></code> <code><link linkend="variable-names-of-elements-that-make-adjustments">$names-of-elements-that-make-adjustments</link></code> <code><link linkend="variable-names-of-elements-that-must-always-refer-to-tan-files">$names-of-elements-that-must-always-refer-to-tan-files</link></code> <code><link linkend="variable-names-of-elements-that-take-idrefs">$names-of-elements-that-take-idrefs</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="variable-nested-phrase-close-marker-regex">$nested-phrase-close-marker-regex</link></code> <code><link linkend="function-nested-phrase-loop">tan:nested-phrase-loop</link>()</code> <code><link linkend="variable-nested-phrase-marker-regex">$nested-phrase-marker-regex</link></code> <code><link linkend="variable-nested-phrase-markers">$nested-phrase-markers</link></code> <code><link linkend="function-no-outliers">tan:no-outliers</link>()</code> <code><link linkend="function-node-before">tan:node-before</link>()</code> <code><link linkend="function-node-type">tan:node-type</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-name">tan:normalize-name</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-objects-target-what-elements-names">$objects-target-what-elements-names</link></code> <code><link linkend="variable-official-urn-namespaces">$official-urn-namespaces</link></code> <code><link linkend="function-open-file">tan:open-file</link>()</code> <code><link linkend="variable-open-group-symbols-regex">$open-group-symbols-regex</link></code> <code><link linkend="function-ordinal">tan:ordinal</link>()</code> <code><link linkend="variable-orig-self">$orig-self</link></code> <code><link linkend="variable-orig-self-validated">$orig-self-validated</link></code> <code><link linkend="function-outliers">tan:outliers</link>()</code> </para>
<para><code><link linkend="function-parse-flags">rgx:parse-flags</link>()</code> <code><link linkend="function-parse-regex">rgx:parse-regex</link>()</code> <code><link linkend="function-parse-urls">tan:parse-urls</link>()</code> <code><link linkend="function-path">tan:path</link>()</code> <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="variable-predecessors-1st-da">$predecessors-1st-da</link></code> <code><link linkend="variable-predecessors-resolved">$predecessors-resolved</link></code> <code><link linkend="template-prefix-attr-include">ŧ prefix-attr-include</link></code> <code><link linkend="template-prep-div-refs-pass-1">ŧ prep-div-refs-pass-1</link></code> <code><link linkend="template-prep-div-refs-pass-2">ŧ prep-div-refs-pass-2</link></code> <code><link linkend="template-prepend-line-break">ŧ prepend-line-break</link></code> <code><link linkend="variable-previous-TAN-versions">$previous-TAN-versions</link></code> <code><link linkend="variable-primary-agents">$primary-agents</link></code> <code><link linkend="template-process-appended-div">ŧ process-appended-div</link></code> <code><link linkend="template-process-merged-div">ŧ process-merged-div</link></code> <code><link linkend="function-process-regex-escape-u">rgx: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="variable-quot">$quot</link></code> </para>
<para><code><link linkend="variable-redivisions-1st-da">$redivisions-1st-da</link></code> <code><link linkend="variable-redivisions-resolved">$redivisions-resolved</link></code> <code><link linkend="function-regex">rgx:regex</link>()</code> <code><link linkend="variable-regex-characters-not-permitted">$regex-characters-not-permitted</link></code> <code><link linkend="function-regex-is-valid">rgx:regex-is-valid</link>()</code> <code><link linkend="variable-regex-name-space-characters">$regex-name-space-characters</link></code> <code><link linkend="function-remove-duplicate-siblings">tan:remove-duplicate-siblings</link>()</code> <code><link linkend="template-remove-duplicate-siblings">ŧ remove-duplicate-siblings</link></code> <code><link linkend="template-remove-first-token">ŧ remove-first-token</link></code> <code><link linkend="template-remove-inclusions">ŧ remove-inclusions</link></code> <code><link linkend="function-replace">rgx:replace</link>()</code> <code><link linkend="function-replace-by-char-name">rgx:replace-by-char-name</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-reset-hierarchy-loop">tan:reset-hierarchy-loop</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-critical-dependencies">ŧ resolve-critical-dependencies</link></code> <code><link linkend="template-resolve-critical-dependencies-loop">ŧ resolve-critical-dependencies-loop</link></code> <code><link linkend="function-resolve-doc">tan:resolve-doc</link>()</code> <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</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="template-resolve-numerals">ŧ resolve-numerals</link></code> <code><link linkend="function-revise-hrefs">tan:revise-hrefs</link>()</code> <code><link linkend="template-revise-hrefs">ŧ revise-hrefs</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-schema-uri-collection">$schema-uri-collection</link></code> <code><link linkend="function-search-for-entities">tan:search-for-entities</link>()</code> <code><link linkend="function-search-for-persons">tan:search-for-persons</link>()</code> <code><link linkend="function-search-for-scripta">tan:search-for-scripta</link>()</code> <code><link linkend="function-search-morpheus">tan:search-morpheus</link>()</code> <code><link linkend="function-search-results-to-claims">tan:search-results-to-claims</link>()</code> <code><link linkend="function-search-results-to-IRI-name-pattern">tan:search-results-to-IRI-name-pattern</link>()</code> <code><link linkend="variable-search-services">$search-services</link></code> <code><link linkend="function-search-wikipedia">tan:search-wikipedia</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="template-selective-shallow-skip">ŧ selective-shallow-skip</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-sequence-to-tree">tan:sequence-to-tree</link>()</code> <code><link linkend="template-sequence-to-tree">ŧ sequence-to-tree</link></code> <code><link linkend="function-shallow-copy">tan:shallow-copy</link>()</code> <code><link linkend="template-shallow-copy">ŧ shallow-copy</link></code> <code><link linkend="variable-shy">$shy</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-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="function-stamp-q-id">tan:stamp-q-id</link>()</code> <code><link linkend="template-stamp-q-id">ŧ stamp-q-id</link></code> <code><link linkend="template-stamp-with-src-attr">ŧ stamp-with-src-attr</link></code> <code><link linkend="variable-stated-validation-phase">$stated-validation-phase</link></code> <code><link linkend="function-string-base">rgx:string-base</link>()</code> <code><link linkend="function-string-length">tan:string-length</link>()</code> <code><link linkend="function-string-to-components">rgx:string-to-components</link>()</code> <code><link linkend="function-string-to-composites">rgx:string-to-composites</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-dependencies-to-markers">ŧ strip-dependencies-to-markers</link></code> <code><link linkend="template-strip-divs-to-reset">ŧ strip-divs-to-reset</link></code> <code><link linkend="template-strip-duplicate-children-by-attribute-value">ŧ strip-duplicate-children-by-attribute-value</link></code> <code><link linkend="template-strip-for-validation">ŧ strip-for-validation</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="variable-subjects-target-what-elements-names">$subjects-target-what-elements-names</link></code> <code><link linkend="variable-successors-1st-da">$successors-1st-da</link></code> <code><link linkend="variable-successors-resolved">$successors-resolved</link></code> <code><link linkend="function-syr-to-int">tan:syr-to-int</link>()</code> <code><link linkend="variable-syriac-hundreds-regex">$syriac-hundreds-regex</link></code> <code><link linkend="variable-syriac-letter-numeral-pattern">$syriac-letter-numeral-pattern</link></code> <code><link linkend="variable-syriac-tens-regex">$syriac-tens-regex</link></code> <code><link linkend="variable-syriac-unit-regex">$syriac-unit-regex</link></code> </para>
<para><code><link linkend="variable-tag-urn-regex-pattern">$tag-urn-regex-pattern</link></code> <code><link linkend="function-takes-idrefs">tan:takes-idrefs</link>()</code> <code><link linkend="template-tan-a-lm-expansion-terse">ŧ tan-a-lm-expansion-terse</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-target-element-names">tan:target-element-names</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="function-title-case">tan:title-case</link>()</code> <code><link linkend="template-title-case">ŧ title-case</link></code> <code><link linkend="variable-today-iso">$today-iso</link></code> <code><link linkend="key-tok-via-val">ʞ tok-via-val</link></code> <code><link linkend="variable-token-definition-default">$token-definition-default</link></code> <code><link linkend="variable-token-definition-letters-and-punctuation">$token-definition-letters-and-punctuation</link></code> <code><link linkend="variable-token-definition-letters-only">$token-definition-letters-only</link></code> <code><link linkend="variable-token-definition-nonspace">$token-definition-nonspace</link></code> <code><link linkend="variable-token-definitions-reserved">$token-definitions-reserved</link></code> <code><link linkend="function-tokenize">rgx: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-tree-to-sequence">tan:tree-to-sequence</link>()</code> <code><link linkend="template-tree-to-sequence">ŧ tree-to-sequence</link></code> <code><link linkend="function-trim-long-text">tan:trim-long-text</link>()</code> <code><link linkend="template-trim-long-text">ŧ trim-long-text</link></code> <code><link linkend="template-trim-or-add-text">ŧ trim-or-add-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-feature-vocabulary">$TAN-feature-vocabulary</link></code> <code><link linkend="variable-TAN-id-namespace">$TAN-id-namespace</link></code> <code><link linkend="variable-TAN-namespace">$TAN-namespace</link></code> <code><link linkend="variable-TAN-version">$TAN-version</link></code> <code><link linkend="variable-TAN-version-is-under-development">$TAN-version-is-under-development</link></code> <code><link linkend="variable-TAN-vocabularies">$TAN-vocabularies</link></code> <code><link linkend="variable-TAN-vocabularies-vocabulary">$TAN-vocabularies-vocabulary</link></code> <code><link linkend="variable-TAN-vocabulary-files">$TAN-vocabulary-files</link></code> <code><link linkend="variable-TEI-namespace">$TEI-namespace</link></code> </para>
<para><code><link linkend="variable-u-item-delimiter-regex">$u-item-delimiter-regex</link></code> <code><link linkend="variable-unicode-versions-supported">$unicode-versions-supported</link></code> <code><link linkend="function-unique-char">tan:unique-char</link>()</code> <code><link linkend="template-unmark-tokens">ŧ unmark-tokens</link></code> <code><link linkend="function-uri-directory">tan:uri-directory</link>()</code> <code><link linkend="function-uri-is-relative">tan:uri-is-relative</link>()</code> <code><link linkend="function-uri-is-resolved">tan:uri-is-resolved</link>()</code> <code><link linkend="function-uri-relative-to">tan:uri-relative-to</link>()</code> <code><link linkend="template-uri-relative-to">ŧ uri-relative-to</link></code> <code><link linkend="function-url-is-local">tan:url-is-local</link>()</code> <code><link linkend="variable-url-regex">$url-regex</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> <code><link linkend="function-vertical-stops">tan:vertical-stops</link>()</code> <code><link linkend="variable-vocabularies-resolved">$vocabularies-resolved</link></code> <code><link linkend="function-vocabulary">tan:vocabulary</link>()</code> <code><link linkend="template-vocabulary-all-vals">ŧ vocabulary-all-vals</link></code> <code><link linkend="template-vocabulary-by-id">ŧ vocabulary-by-id</link></code> <code><link linkend="template-vocabulary-by-name">ŧ vocabulary-by-name</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> <code><link linkend="variable-zwsp">$zwsp</link></code> </para>
<section xml:id="vkft-TAN-core"><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><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="variable-head">$head</link>/(* except (tan:inclusion | tan:vocabulary | tan:tan-vocabulary))//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><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>key('attrs-by-name', ('id', 'xml:id'), <link linkend="variable-self-resolved">$self-resolved</link>)</code></para><para>Used by variable <code><link linkend="variable-all-ids-not-in-inclusions">$all-ids-not-in-inclusions</link></code>, <code><link linkend="variable-duplicate-ids">$duplicate-ids</link></code>.</para><para>Used by template <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>.</para><para>Relies upon <code><link linkend="variable-self-resolved">$self-resolved</link></code>.</para></section>
<section xml:id="variable-all-ids-not-in-inclusions"><title><code>$all-ids-not-in-inclusions</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="variable-all-ids">$all-ids</link>[not(ancestor-or-self::tan:inclusion)]</code></para><para>Used by variable <code><link linkend="variable-duplicate-ids">$duplicate-ids</link></code>.</para><para>Relies upon <code><link linkend="variable-all-ids">$all-ids</link></code>.</para></section>
<section xml:id="variable-all-selector"><title><code>$all-selector</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>'*'</code></para><para>Used by template <code><link linkend="template-dependency-adjustments-pass-2">ŧ dependency-adjustments-pass-2</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-adjustments-pass-1.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-all-vocabularies"><title><code>$all-vocabularies</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>(<link linkend="variable-vocabularies-resolved">$vocabularies-resolved</link>, <link linkend="variable-TAN-vocabularies">$TAN-vocabularies</link>)</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-TAN-vocabularies">$TAN-vocabularies</link></code>, <code><link linkend="variable-vocabularies-resolved">$vocabularies-resolved</link></code>.</para></section>
<section xml:id="variable-alphabet-numeral-key"><title><code>$alphabet-numeral-key</code></title><para><emphasis>TAN-core-functions</emphasis></para><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><emphasis>TAN-core-functions</emphasis></para><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><emphasis>TAN-core-functions</emphasis></para><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-letter-to-number">tan:letter-to-number</link>()</code>, <code><link linkend="function-ara-to-int">tan:ara-to-int</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><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>          if (<link linkend="variable-doc-namespace">$doc-namespace</link> = <link linkend="variable-TAN-namespace">$TAN-namespace</link>) then             <link linkend="variable-self-resolved">$self-resolved</link>/*/(tan:body, tei:text/tei:body)          else             //*:body</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-TAN-namespace">$TAN-namespace</link></code>, <code><link linkend="variable-doc-namespace">$doc-namespace</link></code>, <code><link linkend="variable-self-resolved">$self-resolved</link></code>.</para></section>
<section xml:id="variable-dhy"><title><code>$dhy</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>­</code></para><para>Used by variable <code><link linkend="variable-special-end-div-chars">$special-end-div-chars</link></code>, <code><link linkend="variable-shy">$shy</link></code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-doc-catalog-uris"><title><code>$doc-catalog-uris</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="function-catalog-uris">tan:catalog-uris</link>(/)</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="function-catalog-uris">tan:catalog-uris</link>()</code>.</para></section>
<section xml:id="variable-doc-catalogs"><title><code>$doc-catalogs</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="function-catalogs">tan:catalogs</link>(/, $validation-phase = 'verbose')</code></para><para>Used by variable <code><link linkend="variable-local-catalog">$local-catalog</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-catalogs">tan:catalogs</link>()</code>.</para></section>
<section xml:id="variable-doc-class"><title><code>$doc-class</code></title><para><emphasis>TAN-core-functions</emphasis></para><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="variable-self-resolved">$self-resolved</link></code>, <code><link linkend="function-class-number">tan:class-number</link>()</code>.</para></section>
<section xml:id="variable-doc-id"><title><code>$doc-id</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>/*/<link linkend="attribute-id">@id</link></code></para><para>Used by variable <code><link linkend="variable-doc-is-error-test">$doc-is-error-test</link></code>.</para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-adjustments-pass-1, <code><link linkend="template-resolve-critical-dependencies-loop">ŧ resolve-critical-dependencies-loop</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-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</link></code>.</para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>, <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-doc-id-namespace"><title><code>$doc-id-namespace</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="function-doc-id-namespace">tan:doc-id-namespace</link>(<link linkend="variable-self-resolved">$self-resolved</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-self-resolved">$self-resolved</link></code>, <code><link linkend="function-doc-id-namespace">tan:doc-id-namespace</link>()</code>.</para></section>
<section xml:id="variable-doc-is-error-test"><title><code>$doc-is-error-test</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>matches(<link linkend="variable-doc-id">$doc-id</link>, '^tag:textalign.net,\d+:error-test')</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-namespace"><title><code>$doc-namespace</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>namespace-uri(/*)</code></para><para>Used by variable <code><link linkend="variable-body">$body</link></code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-doc-parent-directory"><title><code>$doc-parent-directory</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="function-uri-directory">tan:uri-directory</link>(string(<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="variable-doc-uri">$doc-uri</link></code>, <code><link linkend="function-uri-directory">tan:uri-directory</link>()</code>.</para></section>
<section xml:id="variable-doc-type"><title><code>$doc-type</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>name(/*)</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-doc-uri"><title><code>$doc-uri</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>base-uri(/*)</code></para><para>Used by variable <code><link linkend="variable-local-TAN-collection">$local-TAN-collection</link></code>, <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-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code>.</para><para>Used by function <code><link linkend="function-catalog-uris">tan:catalog-uris</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-doc-vocabulary"><title><code>$doc-vocabulary</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="function-vocabulary">tan:vocabulary</link>((), (), (<link linkend="variable-head">$head</link>, <link linkend="variable-self-resolved">$self-resolved</link>/(tan:TAN-A, tan:TAN-voc)/tan:body))</code></para><para>Used by function <code><link linkend="function-vocabulary">tan:vocabulary</link>()</code>.</para><para>Relies upon <code><link linkend="variable-head">$head</link></code>, <code><link linkend="variable-self-resolved">$self-resolved</link></code>, <code><link linkend="function-vocabulary">tan:vocabulary</link>()</code>.</para></section>
<section xml:id="variable-duplicate-head-iris"><title><code>$duplicate-head-iris</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="function-duplicate-items">tan:duplicate-items</link>(<link linkend="variable-all-head-iris">$all-head-iris</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>Relies upon <code><link linkend="variable-all-head-iris">$all-head-iris</link></code>, <code><link linkend="function-duplicate-items">tan:duplicate-items</link>()</code>.</para></section>
<section xml:id="variable-duplicate-ids"><title><code>$duplicate-ids</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="function-duplicate-items">tan:duplicate-items</link>(<link linkend="variable-all-ids-not-in-inclusions">$all-ids-not-in-inclusions</link>)</code></para><para>Used by template <code><link linkend="template-catalog-expansion-terse">ŧ catalog-expansion-terse</link></code>, <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>.</para><para>Relies upon <code><link linkend="variable-all-ids-not-in-inclusions">$all-ids-not-in-inclusions</link></code>, <code><link linkend="function-duplicate-items">tan:duplicate-items</link>()</code>.</para></section>
<section xml:id="variable-elements-supported-by-TAN-vocabulary-files"><title><code>$elements-supported-by-TAN-vocabulary-files</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>          ('bitext-relation', 'div-type', 'feature', 'group-type', 'license', 'modal', 'normalization',          'reuse-type', 'role', 'token-definition', 'verb', 'vocabulary')</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-empty-doc"><title><code>$empty-doc</code></title><para><emphasis>TAN-core-functions</emphasis></para><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>Used by function <code><link linkend="function-get-and-resolve-dependency">tan:get-and-resolve-dependency</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><emphasis>TAN-core-functions</emphasis></para><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>Used by template <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</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>Used by function <code><link linkend="function-giant-diff">tan:giant-diff</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><emphasis>TAN-core-functions</emphasis></para><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-extra-vocabulary-files"><title><code>$extra-vocabulary-files</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>          for $i in <link linkend="variable-TAN-vocabularies-vocabulary">$TAN-vocabularies-vocabulary</link>/tan:TAN-voc/tan:body/tan:item[tan:location]          return             <link linkend="function-get-1st-doc">tan:get-1st-doc</link>($i)</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-TAN-vocabularies-vocabulary">$TAN-vocabularies-vocabulary</link></code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>.</para></section>
<section xml:id="variable-greek-hundreds-regex"><title><code>$greek-hundreds-regex</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>'[ρ-ωΡ-ΩϠϡ]'</code></para><para>Used by variable <code><link linkend="variable-greek-letter-numeral-pattern">$greek-letter-numeral-pattern</link></code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-greek-letter-numeral-pattern"><title><code>$greek-letter-numeral-pattern</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>concat('͵',  <link linkend="variable-greek-unit-regex">$greek-unit-regex</link>,  '?(', <link linkend="variable-greek-hundreds-regex">$greek-hundreds-regex</link>, '?',  <link linkend="variable-greek-tens-regex">$greek-tens-regex</link>,  '?',  <link linkend="variable-greek-unit-regex">$greek-unit-regex</link>,  '|',  <link linkend="variable-greek-unit-regex">$greek-unit-regex</link>,  '?', <link linkend="variable-greek-hundreds-regex">$greek-hundreds-regex</link>, '?',         <link linkend="variable-greek-tens-regex">$greek-tens-regex</link>,  <link linkend="variable-greek-unit-regex">$greek-unit-regex</link>,  '?|',  <link linkend="variable-greek-unit-regex">$greek-unit-regex</link>, '?', <link linkend="variable-greek-hundreds-regex">$greek-hundreds-regex</link>, <link linkend="variable-greek-tens-regex">$greek-tens-regex</link>,  '?', <link linkend="variable-greek-unit-regex">$greek-unit-regex</link>, '?)ʹ?')</code></para><para>Used by variable <code><link linkend="variable-nonlatin-letter-numeral-pattern">$nonlatin-letter-numeral-pattern</link></code>.</para><para>Relies upon <code><link linkend="variable-greek-hundreds-regex">$greek-hundreds-regex</link></code>, <code><link linkend="variable-greek-tens-regex">$greek-tens-regex</link></code>, <code><link linkend="variable-greek-unit-regex">$greek-unit-regex</link></code>.</para></section>
<section xml:id="variable-greek-tens-regex"><title><code>$greek-tens-regex</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>'[ι-πΙ-ΠϘϙϞϟ]'</code></para><para>Used by variable <code><link linkend="variable-greek-letter-numeral-pattern">$greek-letter-numeral-pattern</link></code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-greek-unit-regex"><title><code>$greek-unit-regex</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>'[α-θΑ-ΘϛϚ]'</code></para><para>Used by variable <code><link linkend="variable-greek-letter-numeral-pattern">$greek-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><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>          if (exists(/*/tan:head)) then             <link linkend="variable-self-resolved">$self-resolved</link>/*/tan:head          else             /*/*:head</code></para><para>Used by variable <code><link linkend="variable-annotations-1st-da">$annotations-1st-da</link></code>, <code><link linkend="variable-see-alsos-1st-da">$see-alsos-1st-da</link></code>, <code><link linkend="variable-predecessors-1st-da">$predecessors-1st-da</link></code>, <code><link linkend="variable-successors-1st-da">$successors-1st-da</link></code>, <code><link linkend="variable-redivisions-1st-da">$redivisions-1st-da</link></code>, <code><link linkend="variable-model-1st-da">$model-1st-da</link></code>, <code><link linkend="variable-source-ids">$source-ids</link></code>, <code><link linkend="variable-all-head-iris">$all-head-iris</link></code>, <code><link linkend="variable-primary-agents">$primary-agents</link></code>, <code><link linkend="variable-vocabularies-resolved">$vocabularies-resolved</link></code>, <code><link linkend="variable-doc-vocabulary">$doc-vocabulary</link></code>, <code><link linkend="variable-sources-resolved">$sources-resolved</link></code>, <code><link linkend="variable-morphologies-resolved">$morphologies-resolved</link></code>, <code><link linkend="variable-src-ids">$src-ids</link></code>.</para><para>Used by function <code><link linkend="function-diff-outer-loop">tan:diff-outer-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><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>doc('TAN-idrefs.xml')</code></para><para>Used by variable <code><link linkend="variable-subjects-target-what-elements-names">$subjects-target-what-elements-names</link></code>, <code><link linkend="variable-objects-target-what-elements-names">$objects-target-what-elements-names</link></code>, <code><link linkend="variable-names-of-attributes-that-take-idrefs">$names-of-attributes-that-take-idrefs</link></code>, <code><link linkend="variable-names-of-elements-that-take-idrefs">$names-of-elements-that-take-idrefs</link></code>.</para><para>Used by function <code><link linkend="function-target-element-names">tan:target-element-names</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-inclusions-resolved"><title><code>$inclusions-resolved</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="function-get-and-resolve-dependency">tan:get-and-resolve-dependency</link>(/*/tan:head/tan:inclusion)</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-get-and-resolve-dependency">tan:get-and-resolve-dependency</link>()</code>.</para></section>
<section xml:id="variable-internet-available"><title><code>$internet-available</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>Used by template <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>, <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code>.</para><para>Used by function <code><link linkend="function-search-for-entities">tan:search-for-entities</link>()</code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>, <code><link linkend="function-first-loc-available-loop">tan:first-loc-available-loop</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-latin-letter-numeral-pattern"><title><code>$latin-letter-numeral-pattern</code></title><para><emphasis>TAN-core-functions</emphasis></para><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-local-catalog"><title><code>$local-catalog</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="variable-doc-catalogs">$doc-catalogs</link>[1]</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-doc-catalogs">$doc-catalogs</link></code>.</para></section>
<section xml:id="variable-morphologies-resolved"><title><code>$morphologies-resolved</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>          for $i in <link linkend="variable-head">$head</link>/tan:vocabulary-key/tan:morphology          return             <link linkend="function-resolve-doc">tan:resolve-doc</link>(<link linkend="function-get-1st-doc">tan:get-1st-doc</link>($i), true(), <link linkend="function-attr">tan:attr</link>('morphology', ($i/<link linkend="attribute-xmlid">@xml:id</link>, '1')[1]))</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-head">$head</link></code>, <code><link linkend="function-attr">tan:attr</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>.</para></section>
<section xml:id="variable-n-type"><title><code>$n-type</code></title><para><emphasis>TAN-core-functions</emphasis></para><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><emphasis>TAN-core-functions</emphasis></para><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><emphasis>TAN-core-functions</emphasis></para><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-latin-letter-numeral-pattern">$latin-letter-numeral-pattern</link></code>, <code><link linkend="variable-nonlatin-letter-numeral-pattern">$nonlatin-letter-numeral-pattern</link></code>, <code><link linkend="variable-roman-numeral-pattern">$roman-numeral-pattern</link></code>.</para></section>
<section xml:id="variable-names-of-attributes-that-are-case-indifferent"><title><code>$names-of-attributes-that-are-case-indifferent</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>('code', 'n', 'ref', 'affects-element', 'affects-attribute', 'item-type', 'in-lang')</code></para><para>Used by template <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>.</para><para>Used by function <code><link linkend="function-normalize-sequence">tan:normalize-sequence</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-names-of-attributes-that-may-take-multiple-space-delimited-values"><title><code>$names-of-attributes-that-may-take-multiple-space-delimited-values</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="variable-names-of-attributes-that-take-idrefs">$names-of-attributes-that-take-idrefs</link>, ('n', 'affects-element', 'affects-attribute', 'item-type')</code></para><para>Used by template <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>.</para><para>Used by function <code><link linkend="function-normalize-sequence">tan:normalize-sequence</link>()</code>.</para><para>Relies upon <code><link linkend="variable-names-of-attributes-that-take-idrefs">$names-of-attributes-that-take-idrefs</link></code>.</para></section>
<section xml:id="variable-names-of-attributes-that-permit-keyword-last"><title><code>$names-of-attributes-that-permit-keyword-last</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>('pos', 'chars', 'm-has-how-many-features')</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-names-of-attributes-that-take-idrefs"><title><code>$names-of-attributes-that-take-idrefs</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="variable-id-idrefs">$id-idrefs</link>/tan:id-idrefs/tan:id/tan:idrefs/@attribute</code></para><para>Used by variable <code><link linkend="variable-names-of-attributes-that-may-take-multiple-space-delimited-values">$names-of-attributes-that-may-take-multiple-space-delimited-values</link></code>.</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-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>.</para><para>Relies upon <code><link linkend="variable-id-idrefs">$id-idrefs</link></code>.</para></section>
<section xml:id="variable-names-of-elements-that-describe-text-bearers"><title><code>$names-of-elements-that-describe-text-bearers</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>('scriptum', 'work', 'version', 'source')</code></para><para>Used by variable <code><link linkend="variable-names-of-elements-that-describe-textual-entities">$names-of-elements-that-describe-textual-entities</link></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-names-of-elements-that-describe-text-creators"><title><code>$names-of-elements-that-describe-text-creators</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>('person', 'organization')</code></para><para>Used by variable <code><link linkend="variable-names-of-elements-that-describe-textual-entities">$names-of-elements-that-describe-textual-entities</link></code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-names-of-elements-that-describe-textual-entities"><title><code>$names-of-elements-that-describe-textual-entities</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="variable-names-of-elements-that-describe-text-creators">$names-of-elements-that-describe-text-creators</link>, <link linkend="variable-names-of-elements-that-describe-text-bearers">$names-of-elements-that-describe-text-bearers</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-names-of-elements-that-describe-text-bearers">$names-of-elements-that-describe-text-bearers</link></code>, <code><link linkend="variable-names-of-elements-that-describe-text-creators">$names-of-elements-that-describe-text-creators</link></code>.</para></section>
<section xml:id="variable-names-of-elements-that-make-adjustments"><title><code>$names-of-elements-that-make-adjustments</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>('skip', 'rename', 'equate', 'reassign')</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-names-of-elements-that-must-always-refer-to-tan-files"><title><code>$names-of-elements-that-must-always-refer-to-tan-files</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>('morphology', 'inclusion', 'vocabulary', 'redivision', 'model', 'successor', 'predecessor', 'annotation')</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-names-of-elements-that-take-idrefs"><title><code>$names-of-elements-that-take-idrefs</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="variable-id-idrefs">$id-idrefs</link>/tan:id-idrefs/tan:id/tan:idrefs/@element</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-id-idrefs">$id-idrefs</link></code>.</para></section>
<section xml:id="variable-nonlatin-letter-numeral-pattern"><title><code>$nonlatin-letter-numeral-pattern</code></title><para><emphasis>TAN-core-functions</emphasis></para><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><emphasis>TAN-core-functions</emphasis></para><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-to-elements">ŧ core-expansion-terse-attributes-to-elements</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><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>       ('3gpp',       '3gpp2',       'adid',       'alert',       'bbf',       'broadband-forum-org',       'cablelabs',       'ccsds',       'cgi',       'clei',       'dgiwg',       'dslforum-org',       'dvb',       'ebu',       'eidr',       'epc',       'epcglobal',       'etsi',       'eurosystem',       'example',       'fdc',       'fipa',       'geant',       'globus',       'gsma',       'hbbtv',       'ieee',       'ietf',       'iptc',       'isan',       'isbn',       'iso',       'issn',       'itu',       'ivis',       'liberty',       'mace',       'mef',       'mpeg',       'mrn',       'nato',       'nbn',       'nena',       'newsml',       'nfc',       'nzl',       'oasis',       'ogc',       'ogf',       'oid',       'oipf',       'oma',       'onf',       '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><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>/</code></para><para>Used by variable <code><link linkend="variable-doc-history">$doc-history</link></code>, <code><link linkend="variable-orig-self-validated">$orig-self-validated</link></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><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>('1 dev', '2018')</code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-adjustments-pass-1, <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-agents"><title><code>$primary-agents</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="variable-head">$head</link>/tan:file-resp</code></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 xml:id="variable-quot"><title><code>$quot</code></title><para><emphasis>TAN-core-functions</emphasis></para><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><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>[  - ]</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-normalize-text">tan:normalize-text</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-regex-name-space-characters"><title><code>$regex-name-space-characters</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>[_-]</code></para><para>Used by function <code><link linkend="function-normalize-text">tan:normalize-text</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-roman-numeral-pattern"><title><code>$roman-numeral-pattern</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>'m{0,4}(cm|cd|d?c{0,3})(xc|xl|l?x{0,3})(im|ic|il|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-self-expanded"><title><code>$self-expanded</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="function-expand-doc">tan:expand-doc</link>(<link linkend="variable-self-resolved">$self-resolved</link>)</code></para><para>Used by template <code><link linkend="template-imitate-validation">ŧ imitate-validation</link></code>.</para><para>Relies upon <code><link linkend="variable-self-resolved">$self-resolved</link></code>, <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>.</para></section>
<section xml:id="variable-self-resolved"><title><code>$self-resolved</code></title><para><emphasis>TAN-core-functions</emphasis></para><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>, <code><link linkend="variable-all-ids">$all-ids</link></code>, <code><link linkend="variable-doc-id-namespace">$doc-id-namespace</link></code>, <code><link linkend="variable-doc-vocabulary">$doc-vocabulary</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><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>' '</code></para><para>Used by template <code><link linkend="template-merge-tan-docs">ŧ merge-tan-docs</link></code>, <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code>, <code><link linkend="template-check-and-expand-ranges">ŧ check-and-expand-ranges</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code>, <code><link linkend="template-string-to-numerals">ŧ string-to-numerals</link></code>, <code><link linkend="template-process-appended-div">ŧ process-appended-div</link></code>, <code><link linkend="template-merge-tan-docs">ŧ merge-tan-docs</link></code> merge-tan-doc-leaf-divs, <code><link linkend="template-merge-divs">ŧ merge-divs</link></code>.</para><para>Used by function <code><link linkend="function-build-parent-ref-tree">tan:build-parent-ref-tree</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><emphasis>TAN-core-functions</emphasis></para><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><emphasis>TAN-core-functions</emphasis></para><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-shy"><title><code>$shy</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="variable-dhy">$dhy</link></code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-dhy">$dhy</link></code>.</para></section>
<section xml:id="variable-source-ids"><title><code>$source-ids</code></title><para><emphasis>TAN-core-functions</emphasis></para><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>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 xml:id="variable-sources-resolved"><title><code>$sources-resolved</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>          for $i in <link linkend="variable-head">$head</link>/tan:source          return             <link linkend="function-resolve-doc">tan:resolve-doc</link>(<link linkend="function-get-1st-doc">tan:get-1st-doc</link>($i), true(), <link linkend="function-attr">tan:attr</link>('src', ($i/<link linkend="attribute-xmlid">@xml:id</link>, '1')[1]))</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="variable-head">$head</link></code>, <code><link linkend="function-attr">tan:attr</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>.</para></section>
<section xml:id="variable-stated-validation-phase"><title><code>$stated-validation-phase</code></title><para><emphasis>TAN-core-functions</emphasis></para><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-hundreds-regex"><title><code>$syriac-hundreds-regex</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>'ܬ?[ܩܪܫܬ]|[ܢܣܥܦܨ]'</code></para><para>Used by variable <code><link linkend="variable-syriac-letter-numeral-pattern">$syriac-letter-numeral-pattern</link></code>.</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><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>concat(<link linkend="variable-syriac-unit-regex">$syriac-unit-regex</link>, '?\p{Mc}?(', <link linkend="variable-syriac-hundreds-regex">$syriac-hundreds-regex</link>, '\p{Mc})?\p{Mc}?', <link linkend="variable-syriac-tens-regex">$syriac-tens-regex</link>, '?\p{Mc}?', <link linkend="variable-syriac-unit-regex">$syriac-unit-regex</link>, '\p{Mc}?|',        <link linkend="variable-syriac-unit-regex">$syriac-unit-regex</link>, '?\p{Mc}?(', <link linkend="variable-syriac-hundreds-regex">$syriac-hundreds-regex</link>, '\p{Mc})?\p{Mc}?', <link linkend="variable-syriac-tens-regex">$syriac-tens-regex</link>, '\p{Mc}?', <link linkend="variable-syriac-unit-regex">$syriac-unit-regex</link>, '?\p{Mc}?|',        <link linkend="variable-syriac-unit-regex">$syriac-unit-regex</link>, '?\p{Mc}?(', <link linkend="variable-syriac-hundreds-regex">$syriac-hundreds-regex</link>, '\p{Mc})\p{Mc}?', <link linkend="variable-syriac-tens-regex">$syriac-tens-regex</link>, '?\p{Mc}?', <link linkend="variable-syriac-unit-regex">$syriac-unit-regex</link>, '?\p{Mc}?')</code></para><para>Used by variable <code><link linkend="variable-nonlatin-letter-numeral-pattern">$nonlatin-letter-numeral-pattern</link></code>.</para><para>Relies upon <code><link linkend="variable-syriac-hundreds-regex">$syriac-hundreds-regex</link></code>, <code><link linkend="variable-syriac-tens-regex">$syriac-tens-regex</link></code>, <code><link linkend="variable-syriac-unit-regex">$syriac-unit-regex</link></code>.</para></section>
<section xml:id="variable-syriac-tens-regex"><title><code>$syriac-tens-regex</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>'[ܝܟܠܡܢܣܥܦܨ]'</code></para><para>Used by variable <code><link linkend="variable-syriac-letter-numeral-pattern">$syriac-letter-numeral-pattern</link></code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-syriac-unit-regex"><title><code>$syriac-unit-regex</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>'[ܐܒܓܕܗܘܙܚܛ]'</code></para><para>Used by variable <code><link linkend="variable-syriac-letter-numeral-pattern">$syriac-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><emphasis>TAN-core-functions</emphasis></para><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><emphasis>TAN-core-functions</emphasis></para><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-id-namespace"><title><code>$TAN-id-namespace</code></title><para><emphasis>TAN-core-functions</emphasis></para><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-namespace"><title><code>$TAN-namespace</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>'tag:textalign.net,2015:ns'</code></para><para>Used by variable <code><link linkend="variable-body">$body</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-resolve-doc-loop">tan:resolve-doc-loop</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><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>2020</code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-adjustments-pass-1, <code><link linkend="template-resolve-critical-dependencies-loop">ŧ resolve-critical-dependencies-loop</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="variable-TAN-version-is-under-development"><title><code>$TAN-version-is-under-development</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>false()</code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-adjustments-pass-1, <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-vocabularies"><title><code>$TAN-vocabularies</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>Used by variable <code><link linkend="variable-TAN-feature-vocabulary">$TAN-feature-vocabulary</link></code>, <code><link linkend="variable-all-vocabularies">$all-vocabularies</link></code>, <code><link linkend="variable-TAN-vocabularies-vocabulary">$TAN-vocabularies-vocabulary</link></code>, <code><link linkend="variable-extra-vocabulary-files">$extra-vocabulary-files</link></code>, <code><link linkend="variable-token-definitions-reserved">$token-definitions-reserved</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">ŧ core-expansion-terse</link></code>, <code><link linkend="template-resolve-critical-dependencies-loop">ŧ resolve-critical-dependencies-loop</link></code>, <code><link linkend="template-first-stamp-shallow-copy">ŧ first-stamp-shallow-copy</link></code>.</para><para>Relies upon <code><link linkend="variable-TAN-vocabulary-files">$TAN-vocabulary-files</link></code>, <code><link linkend="template-expand-standard-tan-voc">ŧ expand-standard-tan-voc</link></code>.</para></section>
<section xml:id="variable-TAN-vocabularies-vocabulary"><title><code>$TAN-vocabularies-vocabulary</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="variable-TAN-vocabularies">$TAN-vocabularies</link>[tan:TAN-voc/tan:body[<link linkend="attribute-affects-element">@affects-element</link> = 'vocabulary']]</code></para><para>Used by variable <code><link linkend="variable-extra-vocabulary-files">$extra-vocabulary-files</link></code>.</para><para>Relies upon <code><link linkend="variable-TAN-vocabularies">$TAN-vocabularies</link></code>.</para></section>
<section xml:id="variable-TAN-vocabulary-files"><title><code>$TAN-vocabulary-files</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>collection('../../vocabularies/collection.xml')</code></para><para>Used by variable <code><link linkend="variable-TAN-vocabularies">$TAN-vocabularies</link></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-TEI-namespace"><title><code>$TEI-namespace</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>'<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.tei-c.org/ns/1.0'">http://www.tei-c.org/ns/1.0'</link></code></para><para>Used by function <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>.</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><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="variable-token-definitions-reserved">$token-definitions-reserved</link>[1]</code></para><para>Used by template <code><link linkend="template-dependency-adjustments-pass-2">ŧ dependency-adjustments-pass-2</link></code>, <code><link linkend="template-mark-dependencies-pass-1">ŧ mark-dependencies-pass-1</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</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-definitions-reserved">$token-definitions-reserved</link></code>.</para></section>
<section xml:id="variable-token-definition-letters-and-punctuation"><title><code>$token-definition-letters-and-punctuation</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="variable-token-definitions-reserved">$token-definitions-reserved</link>[../tan:name = 'letters and punctuation']</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 xml:id="variable-token-definition-letters-only"><title><code>$token-definition-letters-only</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="variable-token-definitions-reserved">$token-definitions-reserved</link>[../tan:name = 'letters only']</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 xml:id="variable-token-definition-nonspace"><title><code>$token-definition-nonspace</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="variable-token-definitions-reserved">$token-definitions-reserved</link>[../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 xml:id="variable-token-definitions-reserved"><title><code>$token-definitions-reserved</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="variable-TAN-vocabularies">$TAN-vocabularies</link>//tan:token-definition</code></para><para>Used by variable <code><link linkend="variable-token-definition-letters-only">$token-definition-letters-only</link></code>, <code><link linkend="variable-token-definition-letters-and-punctuation">$token-definition-letters-and-punctuation</link></code>, <code><link linkend="variable-token-definition-nonspace">$token-definition-nonspace</link></code>, <code><link linkend="variable-token-definition-default">$token-definition-default</link></code>.</para><para>Relies upon <code><link linkend="variable-TAN-vocabularies">$TAN-vocabularies</link></code>.</para></section>
<section xml:id="variable-validation-phase-names"><title><code>$validation-phase-names</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code>('terse', 'normal', 'verbose')</code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-vocabularies-resolved"><title><code>$vocabularies-resolved</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Definition: <code><link linkend="function-get-and-resolve-dependency">tan:get-and-resolve-dependency</link>(<link linkend="variable-head">$head</link>/(tan:vocabulary, tan:key[tan:location]))</code></para><para>Used by variable <code><link linkend="variable-all-vocabularies">$all-vocabularies</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="variable-head">$head</link></code>, <code><link linkend="function-get-and-resolve-dependency">tan:get-and-resolve-dependency</link>()</code>.</para></section>
<section xml:id="variable-zwj"><title><code>$zwj</code></title><para><emphasis>TAN-core-functions</emphasis></para><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-infuse-tokenized-div-end-check">ŧ infuse-tokenized-div-end-check</link></code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-zwsp"><title><code>$zwsp</code></title><para><emphasis>TAN-core-functions</emphasis></para><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>
<section><title>Keys</title><section xml:id="key-attrs-by-name"><title><code>ʞ attrs-by-name</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Looks for elements matching <code>@*</code></para><para>Used by variable <code><link linkend="variable-all-ids">$all-ids</link></code>.</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-expand-doc">tan:expand-doc</link>()</code>, <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="key-elements-by-name"><title><code>ʞ elements-by-name</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Looks for elements matching <code>*</code></para><para>Used by template <code><link linkend="template-apply-inclusions-and-adjust-vocabulary">ŧ apply-inclusions-and-adjust-vocabulary</link></code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="key-elements-with-attrs-named"><title><code>ʞ elements-with-attrs-named</code></title><para><emphasis>TAN-core-functions</emphasis></para><para>Looks for elements matching <code>*</code></para><para>Used by function <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="key-item-via-node-name"><title><code>ʞ item-via-node-name</code></title><para><emphasis>TAN-core-functions</emphasis></para><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>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><emphasis>TAN-core-functions</emphasis></para><para>Looks for elements matching <code>*</code></para><para>Used by template <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code> class-2-expansion-terse-for-validation.</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><emphasis>TAN-core-functions</emphasis></para><para><code>tan:aaa-to-int($arg as xs:string*) as xs:integer*</code></para><programlisting>Input: any numerals in the supported letter numeral system </programlisting><programlisting>Output: the integer equivalent </programlisting><programlisting>Sequence goes a, b, c, ... z, aa, bb, ..., aaa, bbb, .... E.g., 'ccc' - &gt; 55 </programlisting><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-all-conditions-hold"><title><code>tan:all-conditions-hold()</code></title><para><emphasis>Option 1 (TAN-core-functions)</emphasis></para><para><code>tan:all-conditions-hold($element-with-condition-attributes as element()?, $context-to-evaluate-against as item()*) as xs:boolean?</code></para><programlisting>2-param version of the master one, below </programlisting><para>Used by template <code><link linkend="template-tan-a-lm-expansion-terse">ŧ tan-a-lm-expansion-terse</link></code>.</para><para>Used by function <code><link linkend="function-all-conditions-hold">tan:all-conditions-hold</link>()</code>.</para><para>Relies upon <code><link linkend="function-all-conditions-hold">tan:all-conditions-hold</link>()</code>.</para><para><emphasis>Option 2 (TAN-core-functions)</emphasis></para><para><code>tan:all-conditions-hold($element-with-condition-attributes as element()?, $context-to-evaluate-against as item()*, $evaluation-sequence as xs:string*, $default-value as xs:boolean) as xs:boolean</code></para><programlisting>Input: a TAN element with attributes that should be checked for their truth value; a 
context against which to check the values; an optional sequence of strings indicates the 
names of elements that should be processed and in what order; a boolean indicating what 
value to return by default </programlisting><programlisting>Output: true, if every condition holds; false otherwise </programlisting><programlisting>If no conditions are found, the output reverts to the default </programlisting><para>Used by template <code><link linkend="template-tan-a-lm-expansion-terse">ŧ tan-a-lm-expansion-terse</link></code>.</para><para>Used by function <code><link linkend="function-all-conditions-hold">tan:all-conditions-hold</link>()</code>.</para><para>Relies upon <code><link linkend="function-all-conditions-hold-evaluation-loop">tan:all-conditions-hold-evaluation-loop</link>()</code>.</para></section>
<section xml:id="function-all-conditions-hold-evaluation-loop"><title><code>tan:all-conditions-hold-evaluation-loop()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:all-conditions-hold-evaluation-loop($elements-with-condition-attributes-to-be-evaluated as element()*, $context-to-evaluate-against as item()*, $current-value as xs:boolean) as xs:boolean</code></para><programlisting>Companion function to the one above, indicating whether every condition holds </programlisting><programlisting>This loop function iterates through elements with condition attributes and checks 
each against the context; if a false is found, the loop ends returning false; if no 
conditions are found the default value is returned; otherwise it returns true </programlisting><programlisting>We use a loop function to avoid evaluating conditions that might be time-consuming </programlisting><para>Used by function <code><link linkend="function-all-conditions-hold">tan:all-conditions-hold</link>()</code>, <code><link linkend="function-all-conditions-hold-evaluation-loop">tan:all-conditions-hold-evaluation-loop</link>()</code>.</para><para>Relies upon <code><link linkend="function-all-conditions-hold-evaluation-loop">tan:all-conditions-hold-evaluation-loop</link>()</code>, <code><link linkend="template-evaluate-conditions">ŧ evaluate-conditions</link></code>.</para></section>
<section xml:id="function-analyze-numbers-in-string"><title><code>tan:analyze-numbers-in-string()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:analyze-numbers-in-string($string-to-analyze as xs:string, $ambig-is-roman as xs:boolean?, $n-alias-items as element()*) as element()*</code></para><programlisting>Companion function to <code><link linkend="function-string-to-numerals">tan:string-to-numerals</link>()</code>, to analyze the string as an XML 
fragment </programlisting><para>Used by template <code><link linkend="template-class-1-expansion-verbose-pass-2">ŧ class-1-expansion-verbose-pass-2</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</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><emphasis>TAN-core-functions</emphasis></para><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><programlisting>Input: elements from <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link>()</code> </programlisting><programlisting>Output: each <code>&lt;ref&gt;</code> is supplied with any missing, and calculable, <code>&lt;n&gt;</code>s </programlisting><programlisting>This function takes a string such as "1.3-5, 8, 4.2-3" and converts it to "1.3, 1.5, 
1.8, 4.2, 4.3" </programlisting><programlisting>If the function moves from one <code>&lt;ref&gt;</code> to one with greater than or equal number of <code>&lt;n&gt;</code>s, 
the new one becomes the context; otherwise, the new <code>&lt;ref&gt;</code> attracts from the context any 
missing <code>&lt;n&gt;</code>s at its head </programlisting><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><programlisting>two-parameter version of the fuller function below </programlisting><para>Used by template <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code>, <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</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><programlisting>three-parameter version of the fuller function below </programlisting><para>Used by template <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code>, <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</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 3 (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, $ambig-is-roman as xs:boolean?) as element()</code></para><programlisting>Input: any string representing a sequence; the name of the attribute that held the 
sequence (default 'ref'); should ranges should be expanded?; are ambiguous numerals roman? </programlisting><programlisting>Output: <code>&lt;analysis&gt;</code> with an expansion of the sequence placed in children elements 
that have the name of the second parameter (with <code>@attr</code>); those children have <code><link linkend="attribute-from">@from</link></code> or <code><link linkend="attribute-to">@to</link></code> 
if part of a range. </programlisting><programlisting>If a sequence has a numerical value no numerals other than Arabic should be used. That 
means <code><link linkend="attribute-pos">@pos</link></code> and <code><link linkend="attribute-chars">@chars</link></code> in their original state, but also if <code><link linkend="attribute-n">@n</link></code>, then it needs to have been 
normalized to Arabic numerals before entering this function </programlisting><programlisting>The exception is <code><link linkend="attribute-ref">@ref</link></code>, which cannot be accurately converted to Arabic numerals 
before being studied in the context of a class 1 source </programlisting><programlisting>This function expands only those <code>@refs</code> that are situated within an <code><link linkend="element-adjustments">&lt;adjustments&gt;</link></code>, 
which needs to be calculated before being applied to a class 1 source. </programlisting><programlisting>If this function is asked to expand ranges within a <code><link linkend="attribute-ref">@ref</link></code> sequence, it will do so under 
the strict assumption that all ranges consist of numerically calculable sibling <code>@ns</code> 
that share the same mother reference. </programlisting><programlisting>Matt 1 4-7 is ok. These are not: Matt-Mark, Matt 1:3-Matt 2, Matt 1:3-4:7 </programlisting><programlisting>If a request for help is detected, the flag will be removed and <code><link linkend="attribute-help">@help</link></code> will be inserted 
in the appropriate child element. </programlisting><programlisting>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' </programlisting><programlisting>This function normalizes input numerals and strings. </programlisting><para>Used by template <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code>, <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</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-ref-loop">tan:analyze-ref-loop</link>()</code>, <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link>()</code>, <code><link linkend="function-help-extracted">tan:help-extracted</link>()</code>, <code><link linkend="function-normalize-sequence">tan:normalize-sequence</link>()</code>, <code><link linkend="function-string-to-numerals">tan:string-to-numerals</link>()</code>, <code><link linkend="template-check-and-expand-ranges">ŧ check-and-expand-ranges</link></code>.</para></section>
<section xml:id="function-ara-to-int"><title><code>tan:ara-to-int()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:ara-to-int($arabic-indic-numerals as xs:string*) as xs:integer*</code></para><programlisting>Input: Arabic-indic numerals </programlisting><programlisting>Output: Integer values, if the input conforms to the correct pattern </programlisting><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-attr"><title><code>tan:attr()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:attr($attribute-name as xs:string?, $attribute-value as xs:string?) as attribute()?</code></para><programlisting>Input: two strings </programlisting><programlisting>Output: an attribute by the name of the first string, with the value of the second </programlisting><para>Used by variable <code><link linkend="variable-annotations-resolved">$annotations-resolved</link></code>, <code><link linkend="variable-see-alsos-resolved">$see-alsos-resolved</link></code>, <code><link linkend="variable-predecessors-resolved">$predecessors-resolved</link></code>, <code><link linkend="variable-successors-resolved">$successors-resolved</link></code>, <code><link linkend="variable-redivisions-resolved">$redivisions-resolved</link></code>, <code><link linkend="variable-model-resolved">$model-resolved</link></code>, <code><link linkend="variable-sources-resolved">$sources-resolved</link></code>, <code><link linkend="variable-morphologies-resolved">$morphologies-resolved</link></code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-attribute-vocabulary"><title><code>tan:attribute-vocabulary()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:attribute-vocabulary($attributes as attribute()*) as element()*</code></para><programlisting>Input: attributes, assumed to be still tethered to their resolved document context </programlisting><programlisting>Output: the vocabulary items for that element's attributes (<code><link linkend="attribute-which">@which</link></code>, etc.) </programlisting><programlisting>See full <code><link linkend="function-vocabulary">tan:vocabulary</link>()</code> function below </programlisting><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-element-vocabulary">tan:element-vocabulary</link>()</code>, <code><link linkend="function-attribute-vocabulary">tan:attribute-vocabulary</link>()</code>.</para><para>Relies upon <code><link linkend="function-attribute-vocabulary">tan:attribute-vocabulary</link>()</code>, <code><link linkend="function-base-uri">tan:base-uri</link>()</code>, <code><link linkend="function-distinct-items">tan:distinct-items</link>()</code>, <code><link linkend="function-normalize-name">tan:normalize-name</link>()</code>, <code><link linkend="function-shallow-copy">tan:shallow-copy</link>()</code>, <code><link linkend="function-takes-idrefs">tan:takes-idrefs</link>()</code>, <code><link linkend="function-target-element-names">tan:target-element-names</link>()</code>, <code><link linkend="function-vocabulary">tan:vocabulary</link>()</code>, <code><link linkend="template-remove-inclusions">ŧ remove-inclusions</link></code>.</para></section>
<section xml:id="function-base-uri"><title><code>tan:base-uri()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:base-uri($any-node as node()?) as xs:anyURI</code></para><programlisting>Input: any node </programlisting><programlisting>Output: the base uri of the node's document </programlisting><programlisting>An explicit <code>@xml:base</code> has the highest priority over any native <code>base-uri()</code>. If the 
node is a fragment and has no declared or detected base uri, the <code>static-base-uri()</code> will be 
returned </programlisting><para>Used by template <code><link linkend="template-resolve-critical-dependencies-loop">ŧ resolve-critical-dependencies-loop</link></code>, <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code>, <code><link linkend="template-uri-relative-to">ŧ uri-relative-to</link></code>, <code><link linkend="template-resolve-href">ŧ resolve-href</link></code> expand-standard-tan-voc, <code><link linkend="template-resolve-href">ŧ resolve-href</link></code> first-stamp-shallow-copy.</para><para>Used by function <code><link linkend="function-lm-data">tan:lm-data</link>()</code>, <code><link linkend="function-resolve-href">tan:resolve-href</link>()</code>, <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>, <code><link linkend="function-collection">tan:collection</link>()</code>, <code><link linkend="function-catalog-uris">tan:catalog-uris</link>()</code>, <code><link linkend="function-attribute-vocabulary">tan:attribute-vocabulary</link>()</code>, <code><link linkend="function-cfn">tan:cfn</link>()</code>, <code><link linkend="function-cfne">tan:cfne</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-catalog-uris"><title><code>tan:catalog-uris()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:catalog-uris($input-node as node()?) as xs:string*</code></para><programlisting>Input: a node from an XML file </programlisting><programlisting>Output: URLs for locally available TAN catalog files, beginning with the immediate 
subdirectory and proceeding rootward </programlisting><para>Used by variable <code><link linkend="variable-doc-catalog-uris">$doc-catalog-uris</link></code>.</para><para>Used by function <code><link linkend="function-catalogs">tan:catalogs</link>()</code>.</para><para>Relies upon <code><link linkend="function-base-uri">tan:base-uri</link>()</code>.</para></section>
<section xml:id="function-catalogs"><title><code>tan:catalogs()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:catalogs($input-node as node()?, $strip-bad-hrefs as xs:boolean) as document-node()*</code></para><programlisting>Input: a node from an XML file; a boolean indicating whether bad <code>@hrefs</code> should be 
stripped </programlisting><programlisting>Output: the TAN catalog documents available, beginning with the most local path and 
proceeding rootward </programlisting><para>Used by variable <code><link linkend="variable-doc-catalogs">$doc-catalogs</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-verbose">ŧ core-expansion-verbose</link></code>.</para><para>Relies upon <code><link linkend="function-catalog-uris">tan:catalog-uris</link>()</code>, <code><link linkend="function-is-valid-uri">tan:is-valid-uri</link>()</code>, <code><link linkend="template-cut-faulty-hrefs">ŧ cut-faulty-hrefs</link></code>.</para></section>
<section xml:id="function-cfn"><title><code>tan:cfn()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:cfn($item as item()*) as xs:string*</code></para><programlisting>Input: any items </programlisting><programlisting>Output: the Current File Name, without extension, of the host document node of each 
item, or of the input string if detected as a uri </programlisting><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-cfne"><title><code>tan:cfne()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:cfne($item as item()*) as xs:string*</code></para><programlisting>Input: any items </programlisting><programlisting>Output: the Current File Name, with Extension, of the host document node of each 
item, or of the input string if detected as a uri </programlisting><para>Used by variable <code><link linkend="variable-doc-filename">$doc-filename</link></code>.</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><emphasis>TAN-core-functions</emphasis></para><para><code>tan:class-number($nodes as node()*) as xs:integer*</code></para><programlisting>Input: any nodes of a TAN document </programlisting><programlisting>Output: one integer per node, specifying the TAN class for the file, based on the name 
of the root element. If no match is found in the root element, 0 is returned </programlisting><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-must-refer-to-external-tan-file">tan:must-refer-to-external-tan-file</link>()</code>, <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>, <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>.</para><para>Relies upon <code><link linkend="variable-tan-classes">$tan-classes</link></code>, <code><link linkend="function-tan-type">tan:tan-type</link>()</code>.</para></section>
<section xml:id="function-collate-pair-of-sequences"><title><code>tan:collate-pair-of-sequences()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:collate-pair-of-sequences($string-sequence-1 as xs:string*, $string-sequence-2 as xs:string*) as element()*</code></para><programlisting>Input: two sequences of strings </programlisting><programlisting>Output: an element sequence that collates the two sequences as a single sequence, 
attempting to preserve the longest common subsequence. </programlisting><programlisting>This function has been written for two different scenarios: 1. <code><link linkend="attribute-n">@n</link></code> values in two sets 
of <code><link linkend="element-div">&lt;div&gt;</link></code>s that must be collated; 2. pre-processing two long strings that need to be 
compared. Although the primary context are two sets of unique string-sequences, one could 
imagine situations where one or both input strings have repetition, in which case it is best 
to retain information about the sequence. Hence the output is a sequence of elements, 
with <code>@p1</code>, <code>@p2</code>, or both signifying the position of the original input. Hence the 
transformation is lossless, and the original input can be reconstructed if needed. </programlisting><para>Used by function <code><link linkend="function-collate-pair-of-sequences">tan:collate-pair-of-sequences</link>()</code>, <code><link linkend="function-collate-sequence-loop">tan:collate-sequence-loop</link>()</code>, <code><link linkend="function-diff">tan:diff</link>()</code>.</para><para>Relies upon <code><link linkend="function-collate-pair-of-sequences">tan:collate-pair-of-sequences</link>()</code>, <code><link linkend="function-longest-ascending-subsequence">tan:longest-ascending-subsequence</link>()</code>.</para></section>
<section xml:id="function-collate-sequence-loop"><title><code>tan:collate-sequence-loop()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:collate-sequence-loop($elements-with-elements as element()*, $results-so-far as xs:string*) as xs:string*</code></para><programlisting>This companion function to <code><link linkend="function-collate-sequences">tan:collate-sequences</link>()</code> takes a pair of sequences and 
merges them. </programlisting><para>Used by function <code><link linkend="function-collate-sequences">tan:collate-sequences</link>()</code>, <code><link linkend="function-collate-sequence-loop">tan:collate-sequence-loop</link>()</code>.</para><para>Relies upon <code><link linkend="function-collate-pair-of-sequences">tan:collate-pair-of-sequences</link>()</code>, <code><link linkend="function-collate-sequence-loop">tan:collate-sequence-loop</link>()</code>.</para></section>
<section xml:id="function-collate-sequences"><title><code>tan:collate-sequences()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:collate-sequences($elements-with-elements as element()*) as xs:string*</code></para><programlisting>Input: a series of elements with child elements that have text nodes, representing 
sequences of string sequences </programlisting><programlisting>Output: a series of strings representing the sequences, collated </programlisting><para>Used by function <code><link linkend="function-group-divs">tan:group-divs</link>()</code>, <code><link linkend="function-collate-sequences">tan:collate-sequences</link>()</code>.</para><para>Relies upon <code><link linkend="function-collate-sequence-loop">tan:collate-sequence-loop</link>()</code>, <code><link linkend="function-collate-sequences">tan:collate-sequences</link>()</code>.</para></section>
<section xml:id="function-collection"><title><code>tan:collection()</code></title><para><emphasis>Option 1 (TAN-core-functions)</emphasis></para><para><code>tan:collection($catalog-docs as document-node()*) as document-node()*</code></para><programlisting>One-parameter version of the master one, below </programlisting><para>Used by template <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code>.</para><para>Used by function <code><link linkend="function-collection">tan:collection</link>()</code>.</para><para>Relies upon <code><link linkend="function-collection">tan:collection</link>()</code>.</para><para><emphasis>Option 2 (TAN-core-functions)</emphasis></para><para><code>tan:collection($catalog-docs as document-node()*, $root-names as xs:string*, $id-matches as xs:string?, $href-matches as xs:string?) as document-node()*</code></para><programlisting>Input: one or more catalog.tan.xml files; filtering parameters </programlisting><programlisting>Output: documents that are available </programlisting><para>Used by template <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code>.</para><para>Used by function <code><link linkend="function-collection">tan:collection</link>()</code>.</para><para>Relies upon <code><link linkend="function-base-uri">tan:base-uri</link>()</code>, <code><link linkend="function-error">tan:error</link>()</code>.</para></section>
<section xml:id="function-copy-indentation"><title><code>tan:copy-indentation()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:copy-indentation($items-to-indent as item()*, $model-element as element()) as item()*</code></para><programlisting>Input: items that should be indented; an element whose indentation should be 
imitated </programlisting><programlisting>Output: the items, indented according to the pattern </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-indent-value">tan:indent-value</link>()</code>, <code><link linkend="template-indent-items">ŧ indent-items</link></code>.</para></section>
<section xml:id="function-copy-of"><title><code>tan:copy-of()</code></title><para><emphasis>Option 1 (TAN-core-functions)</emphasis></para><para><code>tan:copy-of($doc-fragment as item()*) as item()*</code></para><programlisting>1-parameter version of function below </programlisting><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><para><emphasis>Option 2 (TAN-core-functions)</emphasis></para><para><code>tan:copy-of($doc-fragment as item()*, $exclude-elements-beyond-what-depth as xs:integer?) as item()*</code></para><programlisting>Input: any document fragment, and an optional integer specifying the depth of copy 
requested </programlisting><programlisting>Output: a copy of the fragment to the depth specified </programlisting><programlisting>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 </programlisting><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><programlisting>short version of the full function, below </programlisting><para>Used by template <code><link linkend="template-mark-reassigns">ŧ mark-reassigns</link></code>, <code><link linkend="template-apply-inclusions-and-adjust-vocabulary">ŧ apply-inclusions-and-adjust-vocabulary</link></code>, <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code>, <code><link linkend="template-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</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><programlisting>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 </programlisting><programlisting>Output: the same fragment, altered </programlisting><programlisting>This function was written primarily to service the merge of TAN-A sources, where 
realigned divs could be extracted from their source documents </programlisting><para>Used by template <code><link linkend="template-mark-reassigns">ŧ mark-reassigns</link></code>, <code><link linkend="template-apply-inclusions-and-adjust-vocabulary">ŧ apply-inclusions-and-adjust-vocabulary</link></code>, <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code>, <code><link linkend="template-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</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><emphasis>TAN-core-functions</emphasis></para><para><code>tan:dateTime-to-decimal($time-or-dateTime as item()*) as xs:decimal*</code></para><programlisting>Input: any xs:date or xs:dateTime </programlisting><programlisting>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. </programlisting><programlisting>Example: (2015-05-10) - &gt; 0.2015051 </programlisting><programlisting>If input is not castable as a date or dateTime, 0 is returned </programlisting><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-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>, <code><link linkend="template-get-doc-history">ŧ get-doc-history</link></code>.</para><para>Used by function <code><link linkend="function-most-recent-dateTime">tan:most-recent-dateTime</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-distinct-items"><title><code>tan:distinct-items()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:distinct-items($items as item()*) as item()*</code></para><programlisting>Input: any sequence of items </programlisting><programlisting>Output: Those items that are not deeply equal to any other item in the sequence </programlisting><programlisting>This function is parallel to <code>distinct-values()</code>, but handles non-string input </programlisting><para>Used by template <code><link linkend="template-merge-tan-docs">ŧ merge-tan-docs</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>Used by function <code><link linkend="function-merge-anas">tan:merge-anas</link>()</code>, <code><link linkend="function-vocabulary">tan:vocabulary</link>()</code>, <code><link linkend="function-attribute-vocabulary">tan:attribute-vocabulary</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-doc-id-namespace"><title><code>tan:doc-id-namespace()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:doc-id-namespace($TAN-doc as item()?) as xs:string?</code></para><programlisting>Input: an item from a TAN file </programlisting><programlisting>Output: the namespace of the doc's <code><link linkend="attribute-id">@id</link></code> </programlisting><para>Used by variable <code><link linkend="variable-doc-id-namespace">$doc-id-namespace</link></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="function-duplicate-items"><title><code>tan:duplicate-items()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:duplicate-items($sequence as item()*) as item()*</code></para><programlisting>Input: any sequence of items </programlisting><programlisting>Output: those items that appear in the sequence more than once </programlisting><programlisting>This function parallels the standard <code>fn:distinct-values()</code> </programlisting><para>Used by variable <code><link linkend="variable-duplicate-ids">$duplicate-ids</link></code>, <code><link linkend="variable-duplicate-head-iris">$duplicate-head-iris</link></code>.</para><para>Used by template <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code>, <code><link linkend="template-dependency-adjustments-pass-2">ŧ dependency-adjustments-pass-2</link></code>, <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code> class-2-expansion-terse-for-validation, <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-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code> core-expansion-terse.</para><para>Used by function <code><link linkend="function-duplicate-values">tan:duplicate-values</link>()</code>, <code><link linkend="function-group-elements-by-shared-node-values">tan:group-elements-by-shared-node-values</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-duplicate-values"><title><code>tan:duplicate-values()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:duplicate-values($sequence as item()*) as item()*</code></para><programlisting>synonym for <code><link linkend="function-duplicate-items">tan:duplicate-items</link>()</code> </programlisting><para>Used by template <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>.</para><para>Relies upon <code><link linkend="function-duplicate-items">tan:duplicate-items</link>()</code>.</para></section>
<section xml:id="function-element-fingerprint"><title><code>tan:element-fingerprint()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:element-fingerprint($element as element()*) as xs:string*</code></para><programlisting>Input: any elements </programlisting><programlisting>Output: for each element the string value of its name, its namespace, its 
attributes, and all descendant nodes </programlisting><programlisting>This function is useful for determining whether any number of elements are deeply 
equal </programlisting><programlisting>The built-in function <code>deep-equal()</code> works for pairs of elements; this looks for a way 
to evaluate sequences of elements </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-element-fingerprint">ŧ element-fingerprint</link></code>.</para></section>
<section xml:id="function-element-vocabulary"><title><code>tan:element-vocabulary()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:element-vocabulary($element as element()*) as element()*</code></para><programlisting>Input: elements, assumed to be tethered to their resolved document context </programlisting><programlisting>Output: the vocabulary items for that element's attributes (<code><link linkend="attribute-which">@which</link></code>, etc.) </programlisting><programlisting>See full <code><link linkend="function-vocabulary">tan:vocabulary</link>()</code> function below </programlisting><para>Used by template <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code>, <code><link linkend="template-apply-inclusions-and-adjust-vocabulary">ŧ apply-inclusions-and-adjust-vocabulary</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code>.</para><para>Used by function <code><link linkend="function-get-and-resolve-dependency">tan:get-and-resolve-dependency</link>()</code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>.</para><para>Relies upon <code><link linkend="function-attribute-vocabulary">tan:attribute-vocabulary</link>()</code>.</para></section>
<section xml:id="function-expand-numerical-sequence"><title><code>tan:expand-numerical-sequence()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:expand-numerical-sequence($selector as xs:string?, $max as xs:integer?) as xs:integer*</code></para><programlisting>Input: a string representing a TAN selector (used by <code><link linkend="attribute-pos">@pos</link></code>, <code><link linkend="attribute-chars">@chars</link></code>), and an integer 
defining the value of 'last' </programlisting><programlisting>Output: a sequence of numbers representing the positions selected, unsorted, and 
retaining duplicate values. Example: ("2 - 4, last-5 - last, 36", 50) -&gt; (2, 3, 4, 45, 46, 47, 48, 
49, 50, 36) Errors will be flagged as follows: 0 = value that falls below 1; -1 = value that 
surpasses the value of <code>$max</code>; -2 = ranges that call for negative steps, e.g., '4 - 2'. </programlisting><programlisting>This function assumes that all numerals are Arabic. </programlisting><para>Used by template <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>, <code><link linkend="template-check-and-expand-ranges">ŧ check-and-expand-ranges</link></code>, <code><link linkend="template-mark-dependencies-pass-2-for-validation">ŧ mark-dependencies-pass-2-for-validation</link></code>, <code><link linkend="template-evaluate-conditions">ŧ evaluate-conditions</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><emphasis>TAN-core-functions</emphasis></para><para><code>tan:expand-pos-or-chars($elements as element()*, $max as xs:integer?) as xs:integer*</code></para><programlisting>Input: any elements that are <code>&lt;pos&gt;</code> or <code>&lt;chars&gt;</code>; an integer value for 'max' </programlisting><programlisting>Output: the elements converted to integers they represent </programlisting><programlisting>Because the results are normally positive integers, the following should be 
treated as error codes: 0 = value that falls below 1; -1 = value that cannot be converted to an 
integer; -2 = ranges that call for negative steps, e.g., '4 - 2'. </programlisting><para>Used by template <code><link linkend="template-expand-reassigns">ŧ expand-reassigns</link></code>, <code><link linkend="template-mark-tok-pos">ŧ mark-tok-pos</link></code>, <code><link linkend="template-mark-dependencies-pass-2">ŧ mark-dependencies-pass-2</link></code>, <code><link linkend="template-mark-tok-chars">ŧ mark-tok-chars</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><emphasis>TAN-core-functions</emphasis></para><para><code>tan:first-loc-available($element-with-href-in-self-or-descendants as element()?) as xs:string?</code></para><programlisting>Input: An element that is or contains one or more tan:location elements </programlisting><programlisting>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. </programlisting><para>Used by function <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>, <code><link linkend="function-first-loc-available-loop">tan:first-loc-available-loop</link>()</code>.</para><para>Relies upon <code><link linkend="function-first-loc-available-loop">tan:first-loc-available-loop</link>()</code>.</para></section>
<section xml:id="function-first-loc-available-loop"><title><code>tan:first-loc-available-loop()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:first-loc-available-loop($href-attributes as attribute()*, $loop-counter as xs:integer) as xs:string?</code></para><para>Used by function <code><link linkend="function-first-loc-available">tan:first-loc-available</link>()</code>, <code><link linkend="function-first-loc-available-loop">tan:first-loc-available-loop</link>()</code>.</para><para>Relies upon <code><link linkend="variable-internet-available">$internet-available</link></code>, <code><link linkend="function-first-loc-available">tan:first-loc-available</link>()</code>, <code><link linkend="function-first-loc-available-loop">tan:first-loc-available-loop</link>()</code>, <code><link linkend="function-url-is-local">tan:url-is-local</link>()</code>.</para></section>
<section xml:id="function-get-1st-doc"><title><code>tan:get-1st-doc()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:get-1st-doc($TAN-elements as element()*) as document-node()*</code></para><programlisting>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-vocabulary">&lt;vocabulary&gt;</link></code> </programlisting><programlisting>Output: the first document available for each element, plus any relevant error 
messages. </programlisting><para>Used by variable <code><link linkend="variable-annotations-1st-da">$annotations-1st-da</link></code>, <code><link linkend="variable-see-alsos-1st-da">$see-alsos-1st-da</link></code>, <code><link linkend="variable-predecessors-1st-da">$predecessors-1st-da</link></code>, <code><link linkend="variable-successors-1st-da">$successors-1st-da</link></code>, <code><link linkend="variable-redivisions-1st-da">$redivisions-1st-da</link></code>, <code><link linkend="variable-model-1st-da">$model-1st-da</link></code>, <code><link linkend="variable-extra-vocabulary-files">$extra-vocabulary-files</link></code>, <code><link linkend="variable-sources-resolved">$sources-resolved</link></code>, <code><link linkend="variable-morphologies-resolved">$morphologies-resolved</link></code>.</para><para>Used by template <code><link linkend="template-resolve-critical-dependencies-loop">ŧ resolve-critical-dependencies-loop</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</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-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</link></code>, <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code>.</para><para>Used by function <code><link linkend="function-get-and-resolve-dependency">tan:get-and-resolve-dependency</link>()</code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>.</para><para>Relies upon <code><link linkend="variable-internet-available">$internet-available</link></code>, <code><link linkend="function-base-uri">tan:base-uri</link>()</code>, <code><link linkend="function-class-number">tan:class-number</link>()</code>, <code><link linkend="function-element-vocabulary">tan:element-vocabulary</link>()</code>, <code><link linkend="function-error">tan:error</link>()</code>, <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>, <code><link linkend="function-resolve-href">tan:resolve-href</link>()</code>, <code><link linkend="function-shallow-copy">tan:shallow-copy</link>()</code>, <code><link linkend="function-tan-type">tan:tan-type</link>()</code>, <code><link linkend="function-uri-relative-to">tan:uri-relative-to</link>()</code>, <code><link linkend="function-url-is-local">tan:url-is-local</link>()</code>, <code><link linkend="function-xml-to-string">tan:xml-to-string</link>()</code>, <code><link linkend="template-resolve-href">ŧ resolve-href</link></code>.</para></section>
<section xml:id="function-get-doc-history"><title><code>tan:get-doc-history()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:get-doc-history($TAN-doc as document-node()*) as element()*</code></para><programlisting>Input: any TAN document </programlisting><programlisting>Output: a sequence of elements with <code><link linkend="attribute-when">@when</link></code>, <code><link linkend="attribute-ed-when">@ed-when</link></code>, <code><link linkend="attribute-accessed-when">@accessed-when</link></code>, 
<code><link linkend="attribute-claim-when">@claim-when</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 </programlisting><para>Used by variable <code><link linkend="variable-doc-history">$doc-history</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-normal">ŧ core-expansion-normal</link></code>.</para><para>Used by function <code><link linkend="function-last-change-agent">tan:last-change-agent</link>()</code>.</para><para>Relies upon <code><link linkend="template-get-doc-history">ŧ get-doc-history</link></code>.</para></section>
<section xml:id="function-get-via-q-ref"><title><code>tan:get-via-q-ref()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:get-via-q-ref($q-ref as xs:string*, $q-reffed-document as document-node()*) as node()*</code></para><programlisting>Input: any number of q-refs, any number of q-reffed documents </programlisting><programlisting>Output: the elements corresponding to the q-refs </programlisting><programlisting>This function is used by the core validation routine, mainly to find errors in 
expanded output </programlisting><para>Used by template <code><link linkend="template-imitate-validation">ŧ imitate-validation</link></code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-group-divs-by-ref"><title><code>tan:group-divs-by-ref()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:group-divs-by-ref($elements-to-group as element()*) as element()*</code></para><programlisting>One-parameter version of the fuller one below. </programlisting><para>Used by template <code><link linkend="template-merge-tan-docs">ŧ merge-tan-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>.</para></section>
<section xml:id="function-group-elements-by-IRI"><title><code>tan:group-elements-by-IRI()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:group-elements-by-IRI($elements-to-group as element()*) as element()*</code></para><programlisting>One-parameter version of the fuller one below. </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-group-elements-by-shared-node-values">tan:group-elements-by-shared-node-values</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><programlisting>One-parameter version of the fuller one below. </programlisting><para>Used by template <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-group-elements-by-shared-node-values">tan:group-elements-by-shared-node-values</link>()</code>, <code><link linkend="function-group-elements-by-IRI">tan:group-elements-by-IRI</link>()</code>, <code><link linkend="function-group-divs-by-ref">tan:group-divs-by-ref</link>()</code>, <code><link linkend="function-group-divs">tan:group-divs</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><programlisting>Two-parameter version of the fuller one below </programlisting><para>Used by template <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-group-elements-by-shared-node-values">tan:group-elements-by-shared-node-values</link>()</code>, <code><link linkend="function-group-elements-by-IRI">tan:group-elements-by-IRI</link>()</code>, <code><link linkend="function-group-divs-by-ref">tan:group-divs-by-ref</link>()</code>, <code><link linkend="function-group-divs">tan:group-divs</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 3 (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?, $group-by-shallow-node-value as xs:boolean) as element()*</code></para><programlisting>Input: a sequence of elements; an optional string representing the name of children 
in the elements </programlisting><programlisting>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 </programlisting><programlisting>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 </programlisting><programlisting>Transitivity is assumed. 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 directly share children values. </programlisting><para>Used by template <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-group-elements-by-shared-node-values">tan:group-elements-by-shared-node-values</link>()</code>, <code><link linkend="function-group-elements-by-IRI">tan:group-elements-by-IRI</link>()</code>, <code><link linkend="function-group-divs-by-ref">tan:group-divs-by-ref</link>()</code>, <code><link linkend="function-group-divs">tan:group-divs</link>()</code>.</para><para>Relies upon <code><link linkend="function-duplicate-items">tan:duplicate-items</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>, <code><link linkend="template-build-grouping-key">ŧ build-grouping-key</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><emphasis>TAN-core-functions</emphasis></para><para><code>tan:group-elements-by-shared-node-values-loop($items-to-group as element()*, $groups-so-far as element()*, $loop-count as xs:integer) as element()*</code></para><programlisting>supporting loop for the function above </programlisting><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-indent-value"><title><code>tan:indent-value()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:indent-value($elements as element()*) as xs:integer*</code></para><programlisting>Input: elements </programlisting><programlisting>Output: the length of their indentation </programlisting><para>Used by function <code><link linkend="function-copy-indentation">tan:copy-indentation</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-insert-as-first-child"><title><code>tan:insert-as-first-child()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:insert-as-first-child($items-to-be-changed as item()*, $items-to-insert-as-first-child as item()*, $names-of-elements-to-receive-action as xs:string*) as item()*</code></para><programlisting>Input: items to be changed; items to be inserted; strings representing the names of 
the elements that should receive the insertion </programlisting><programlisting>Output: the first items, with the second items inserted in the appropriate place </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-insert-content">ŧ insert-content</link></code>.</para></section>
<section xml:id="function-insert-as-last-child"><title><code>tan:insert-as-last-child()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:insert-as-last-child($items-to-be-changed as item()*, $items-to-insert-as-last-child as item()*, $names-of-elements-to-receive-action as xs:string*) as item()*</code></para><programlisting>Input: items to be changed; items to be inserted; strings representing the names of 
the elements that should receive the insertion </programlisting><programlisting>Output: the first items, with the second items inserted in the appropriate place </programlisting><programlisting>This function was written in service to a 2019 version of <code><link linkend="function-vocabulary">tan:vocabulary</link>()</code>, to allow 
deeply nested vocabulary items to receive select insertions </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-insert-content">ŧ insert-content</link></code>.</para></section>
<section xml:id="function-is-valid-uri"><title><code>tan:is-valid-uri()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:is-valid-uri($uri-to-check as xs:string?) as xs:boolean?</code></para><programlisting>Input: a string </programlisting><programlisting>Output: a boolean indicating whether the string is syntactically a valid uri </programlisting><programlisting>This assumes not only absolute but relative uris will be checked, which means that a 
wide variety of characters could be fed in, but not ones disallowed in pathnames, and the 
string must not be zero length. </programlisting><para>Used by template <code><link linkend="template-first-stamp-shallow-copy">ŧ first-stamp-shallow-copy</link></code>, <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code>, <code><link linkend="template-resolve-critical-dependencies-loop">ŧ resolve-critical-dependencies-loop</link></code>.</para><para>Used by function <code><link linkend="function-uri-relative-to">tan:uri-relative-to</link>()</code>, <code><link linkend="function-catalogs">tan:catalogs</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-last-change-agent"><title><code>tan:last-change-agent()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:last-change-agent($TAN-doc as document-node()*) as element()*</code></para><programlisting>Input: any TAN document </programlisting><programlisting>Output: the <code><link linkend="element-person">&lt;person&gt;</link></code>, <code><link linkend="element-organization">&lt;organization&gt;</link></code>, or <code><link linkend="element-algorithm">&lt;algorithm&gt;</link></code> who made the last change </programlisting><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-adjustments-pass-1, <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-get-doc-history">tan:get-doc-history</link>()</code>, <code><link linkend="function-vocabulary">tan:vocabulary</link>()</code>.</para></section>
<section xml:id="function-letter-to-number"><title><code>tan:letter-to-number()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:letter-to-number($numerical-letters as xs:anyAtomicType*) as xs:integer*</code></para><programlisting>Input: any sequence of strings that represent alphabetic numerals </programlisting><programlisting>Output: those numerals </programlisting><programlisting>Works only for letter patterns that have been defined; anything else produces null 
results </programlisting><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-alphabet-numeral-key">$alphabet-numeral-key</link></code>, <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>.</para></section>
<section xml:id="function-merge-expanded-docs"><title><code>tan:merge-expanded-docs()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:merge-expanded-docs($expanded-docs as document-node()*) as document-node()?</code></para><programlisting>Input: Any TAN documents that have been expanded at least tersely </programlisting><programlisting>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. </programlisting><programlisting>Templates will be placed in the appropriate function file, e.g., class 1 merge 
templates are in TAN-class-1-functions.xsl </programlisting><programlisting>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-adjustments">&lt;adjustments&gt;</link></code> have already been performed. </programlisting><programlisting>Class 2 merging: TBD </programlisting><programlisting>Class 3 merging: TBD </programlisting><programlisting>NB: Class 1 files must have their hierarchies in proper order; use reset-hierarchy 
beforehand if you're unsure </programlisting><para>Used by template <code><link linkend="template-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</link></code>.</para><para>Relies upon <code><link linkend="template-merge-tan-docs">ŧ merge-tan-docs</link></code>.</para></section>
<section xml:id="function-most-common-item-count"><title><code>tan:most-common-item-count()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:most-common-item-count($sequence as item()*) as xs:integer?</code></para><programlisting>Input: any sequence of items </programlisting><programlisting>Output: the count of the first item that appears most frequently </programlisting><programlisting>If two or more items appear equally frequently, only the first is returned </programlisting><programlisting>Written to help group <code>&lt;u&gt;</code> elements in <code><link linkend="function-collate">tan:collate</link>()</code> </programlisting><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="function-most-recent-dateTime"><title><code>tan:most-recent-dateTime()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:most-recent-dateTime($dateTimes as item()*) as item()?</code></para><programlisting>Input: a series of ISO-compliant date or dateTimes </programlisting><programlisting>Output: the most recent one </programlisting><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><emphasis>TAN-core-functions</emphasis></para><para><code>tan:must-refer-to-external-tan-file($node as node()) as xs:boolean</code></para><programlisting>Input: node in a TAN document. </programlisting><programlisting>Output: boolean value indicating whether the node or its parent must name or refer to 
a TAN file. </programlisting><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code>.</para><para>Relies upon <code><link linkend="variable-names-of-elements-that-must-always-refer-to-tan-files">$names-of-elements-that-must-always-refer-to-tan-files</link></code>, <code><link linkend="function-class-number">tan:class-number</link>()</code>.</para></section>
<section xml:id="function-node-before"><title><code>tan:node-before()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:node-before($node-sequence-1 as node()+, $node-sequence-2 as node()+) as xs:boolean</code></para><programlisting>Input: two sequences of nodes </programlisting><programlisting>Output: a boolean indicating whether one of the nodes in the first sequence precedes 
all the nodes of the second </programlisting><para>Used by template <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code> class-2-expansion-terse-for-validation.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-normalize-sequence"><title><code>tan:normalize-sequence()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:normalize-sequence($sequence-string as xs:string?, $attribute-name as xs:string) as xs:string*</code></para><programlisting>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> </programlisting><programlisting>Output: the string, normalized and sequenced into items; items that are ranges will 
have the beginning and end points separated by ' - ' </programlisting><programlisting>Note, this function does not analyze or convert types of numerals, and all help 
requests are left intact; the function is most effective if numerals have been converted to 
Arabic ahead of time </programlisting><programlisting>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> </programlisting><para>Used by function <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link>()</code>, <code><link linkend="function-normalize-sequence">tan:normalize-sequence</link>()</code>, <code><link linkend="function-expand-numerical-sequence">tan:expand-numerical-sequence</link>()</code>.</para><para>Relies upon <code><link linkend="variable-names-of-attributes-that-are-case-indifferent">$names-of-attributes-that-are-case-indifferent</link></code>, <code><link linkend="variable-names-of-attributes-that-may-take-multiple-space-delimited-values">$names-of-attributes-that-may-take-multiple-space-delimited-values</link></code>, <code><link linkend="function-normalize-sequence">tan:normalize-sequence</link>()</code>.</para></section>
<section xml:id="function-ordinal"><title><code>tan:ordinal()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:ordinal($in as xs:integer*) as xs:string*</code></para><programlisting>Input: one or more numerals </programlisting><programlisting>Output: one or more strings with the English form of the ordinal form of the input 
number </programlisting><programlisting>Example: (1, 4, 17) -&gt; ('first', 'fourth', '17th') </programlisting><para>Used by template <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code> class-2-expansion-terse-for-validation.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-path"><title><code>tan:path()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:path($nodes as node()*) as xs:string*</code></para><programlisting>Input: any nodes </programlisting><programlisting>Output: the path of each node </programlisting><para>Used by template <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code>, <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</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><emphasis>TAN-core-functions</emphasis></para><para><code>tan:pluck($fragment as item()*, $pluck-beyond-level as xs:integer, $keep-short-branch-leaves as xs:boolean) as item()*</code></para><programlisting>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 </programlisting><programlisting>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 </programlisting><programlisting>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 </programlisting><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-rom-to-int"><title><code>tan:rom-to-int()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:rom-to-int($arg as xs:string*) as xs:integer*</code></para><programlisting>Input: any roman numeral less than 5000 </programlisting><programlisting>Output: the numeral converted to an integer </programlisting><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><emphasis>TAN-core-functions</emphasis></para><para><code>tan:sequence-collapse($integers as xs:integer*) as xs:string?</code></para><programlisting>Input: a sequence of integers </programlisting><programlisting>Output: a string that puts them in a TAN-like compact string </programlisting><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 template <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>, <code><link linkend="template-check-and-expand-ranges">ŧ check-and-expand-ranges</link></code>, <code><link linkend="template-mark-dependencies-pass-2-for-validation">ŧ mark-dependencies-pass-2-for-validation</link></code>, <code><link linkend="template-mark-dependencies-pass-2">ŧ mark-dependencies-pass-2</link></code>.</para><para>Used by function <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><programlisting>Input: any results of the function <code>tan:sequence-expand()</code> </programlisting><programlisting>Output: error nodes, if any </programlisting><para>Used by template <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>, <code><link linkend="template-check-and-expand-ranges">ŧ check-and-expand-ranges</link></code>, <code><link linkend="template-mark-dependencies-pass-2-for-validation">ŧ mark-dependencies-pass-2-for-validation</link></code>, <code><link linkend="template-mark-dependencies-pass-2">ŧ mark-dependencies-pass-2</link></code>.</para><para>Used by function <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($items as item()*) as item()*</code></para><programlisting>one-parameter version of the fuller one, below </programlisting><para>Used by template <code><link linkend="template-dependency-adjustments-pass-2">ŧ dependency-adjustments-pass-2</link></code>, <code><link linkend="template-mark-dependencies-pass-1">ŧ mark-dependencies-pass-1</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-adjustments-pass-1, <code><link linkend="template-resolve-critical-dependencies-loop">ŧ resolve-critical-dependencies-loop</link></code>, <code><link linkend="template-mark-dependencies-for-validation">ŧ mark-dependencies-for-validation</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-class-1-expansion-verbose-pass-2">ŧ class-1-expansion-verbose-pass-2</link></code>, <code><link linkend="template-mark-reassigns">ŧ mark-reassigns</link></code>, <code><link linkend="template-resolve-href">ŧ resolve-href</link></code> expand-standard-tan-voc, <code><link linkend="template-first-stamp-shallow-skip">ŧ first-stamp-shallow-skip</link></code>, <code><link linkend="template-tan-a-lm-expansion-terse">ŧ tan-a-lm-expansion-terse</link></code>.</para><para>Used by function <code><link linkend="function-shallow-copy">tan:shallow-copy</link>()</code>, <code><link linkend="function-attribute-vocabulary">tan:attribute-vocabulary</link>()</code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</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($items as item()*, $depth as xs:integer) as item()*</code></para><programlisting>Input: any document fragment; boolean indicating whether attributes should be 
kept </programlisting><programlisting>Output: a shallow copy of the fragment, perhaps with attributes </programlisting><para>Used by template <code><link linkend="template-dependency-adjustments-pass-2">ŧ dependency-adjustments-pass-2</link></code>, <code><link linkend="template-mark-dependencies-pass-1">ŧ mark-dependencies-pass-1</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-adjustments-pass-1, <code><link linkend="template-resolve-critical-dependencies-loop">ŧ resolve-critical-dependencies-loop</link></code>, <code><link linkend="template-mark-dependencies-for-validation">ŧ mark-dependencies-for-validation</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-class-1-expansion-verbose-pass-2">ŧ class-1-expansion-verbose-pass-2</link></code>, <code><link linkend="template-mark-reassigns">ŧ mark-reassigns</link></code>, <code><link linkend="template-resolve-href">ŧ resolve-href</link></code> expand-standard-tan-voc, <code><link linkend="template-first-stamp-shallow-skip">ŧ first-stamp-shallow-skip</link></code>, <code><link linkend="template-tan-a-lm-expansion-terse">ŧ tan-a-lm-expansion-terse</link></code>.</para><para>Used by function <code><link linkend="function-shallow-copy">tan:shallow-copy</link>()</code>, <code><link linkend="function-attribute-vocabulary">tan:attribute-vocabulary</link>()</code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>, <code><link linkend="function-error">tan:error</link>()</code>.</para><para>Relies upon <code><link linkend="template-shallow-copy">ŧ shallow-copy</link></code>.</para></section>
<section xml:id="function-stamp-q-id"><title><code>tan:stamp-q-id()</code></title><para><emphasis>Option 1 (TAN-core-functions)</emphasis></para><para><code>tan:stamp-q-id($items-to-stamp as item()*) as item()*</code></para><programlisting>1-param version of the full one below </programlisting><para>Used by template <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>.</para><para>Used by function <code><link linkend="function-stamp-q-id">tan:stamp-q-id</link>()</code>.</para><para>Relies upon <code><link linkend="function-stamp-q-id">tan:stamp-q-id</link>()</code>.</para><para><emphasis>Option 2 (TAN-core-functions)</emphasis></para><para><code>tan:stamp-q-id($items-to-stamp as item()*, $stamp-shallowly as xs:boolean) as item()*</code></para><programlisting>Input: any XML fragments </programlisting><programlisting>Output: the fragments with <code>@q</code> added to each element via <code>generate-id()</code> </programlisting><para>Used by template <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>.</para><para>Used by function <code><link linkend="function-stamp-q-id">tan:stamp-q-id</link>()</code>.</para><para>Relies upon <code><link linkend="template-stamp-q-id">ŧ stamp-q-id</link></code>.</para></section>
<section xml:id="function-string-to-int"><title><code>tan:string-to-int()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:string-to-int($string as xs:string?) as xs:integer*</code></para><programlisting>Companion fonction to <code><link linkend="function-string-to-numerals">tan:string-to-numerals</link>()</code> </programlisting><programlisting>Returns only those results that can be evaluated as integers </programlisting><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><programlisting>one-parameter version of the function below </programlisting><para>Used by template <code><link linkend="template-check-and-expand-ranges">ŧ check-and-expand-ranges</link></code>, <code><link linkend="template-resolve-numerals">ŧ resolve-numerals</link></code>, <code><link linkend="template-class-1-expansion-verbose-pass-2">ŧ class-1-expansion-verbose-pass-2</link></code>.</para><para>Used by function <code><link linkend="function-string-to-numerals">tan:string-to-numerals</link>()</code>, <code><link linkend="function-analyze-sequence">tan:analyze-sequence</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?, $n-alias-items as element()*) as xs:string*</code></para><programlisting>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 </programlisting><programlisting>Output: the string with parts that look like numerals converted to Arabic numerals </programlisting><programlisting>Does not take into account requests for help </programlisting><para>Used by template <code><link linkend="template-check-and-expand-ranges">ŧ check-and-expand-ranges</link></code>, <code><link linkend="template-resolve-numerals">ŧ resolve-numerals</link></code>, <code><link linkend="template-class-1-expansion-verbose-pass-2">ŧ class-1-expansion-verbose-pass-2</link></code>.</para><para>Used by function <code><link linkend="function-string-to-numerals">tan:string-to-numerals</link>()</code>, <code><link linkend="function-analyze-sequence">tan:analyze-sequence</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-takes-idrefs"><title><code>tan:takes-idrefs()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:takes-idrefs($attributes as attribute()+) as xs:boolean+</code></para><programlisting>Input: any attributes </programlisting><programlisting>Output: booleans, whether it takes idrefs or not </programlisting><para>Used by function <code><link linkend="function-attribute-vocabulary">tan:attribute-vocabulary</link>()</code>.</para><para>Relies upon <code><link linkend="function-target-element-names">tan:target-element-names</link>()</code>.</para></section>
<section xml:id="function-tan-type"><title><code>tan:tan-type()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:tan-type($nodes as node()*) as xs:string*</code></para><programlisting>Input: any nodes </programlisting><programlisting>Output: the names of the root elements; if not present, a zero-length string is 
returned </programlisting><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-class-number">tan:class-number</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-target-element-names"><title><code>tan:target-element-names()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:target-element-names($items as item()*) as xs:string*</code></para><programlisting>Input: any strings, attributes, or elements </programlisting><programlisting>Output: the names of the elements pointed to, if the name or the value of the input is 
the name of an element or attribute that takes idrefs </programlisting><para>Used by template <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>.</para><para>Used by function <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>, <code><link linkend="function-attribute-vocabulary">tan:attribute-vocabulary</link>()</code>, <code><link linkend="function-takes-idrefs">tan:takes-idrefs</link>()</code>.</para><para>Relies upon <code><link linkend="variable-id-idrefs">$id-idrefs</link></code>.</para></section>
<section xml:id="function-trim-long-text"><title><code>tan:trim-long-text()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:trim-long-text($xml-fragment as item()*, $too-long as xs:integer) as item()*</code></para><programlisting>Input: an XML fragment; an integer </programlisting><programlisting>Output: the fragment with text nodes longer than the integer value abbreviated with 
an ellipsis </programlisting><para>Used by function <code><link linkend="function-collate">tan:collate</link>()</code>, <code><link linkend="function-diff">tan:diff</link>()</code>, <code><link linkend="function-diff-outer-loop">tan:diff-outer-loop</link>()</code>, <code><link linkend="function-diff-inner-loop">tan:diff-inner-loop</link>()</code>, <code><link linkend="function-collate-loop-outer">tan:collate-loop-outer</link>()</code>.</para><para>Relies upon <code><link linkend="template-trim-long-text">ŧ trim-long-text</link></code>.</para></section>
<section xml:id="function-uri-directory"><title><code>tan:uri-directory()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:uri-directory($uris as xs:string*) as xs:string*</code></para><programlisting>Input: any URIs, as strings </programlisting><programlisting>Output: the file path </programlisting><programlisting>NB, this function does not assume any URIs have been resolved </programlisting><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-is-relative"><title><code>tan:uri-is-relative()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:uri-is-relative($uri-to-test as xs:string?) as xs:boolean?</code></para><programlisting>Input: a string representing a URI </programlisting><programlisting>Output: a boolean indicating whether it is relative </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-uri-is-resolved">tan:uri-is-resolved</link>()</code>.</para></section>
<section xml:id="function-uri-is-resolved"><title><code>tan:uri-is-resolved()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:uri-is-resolved($uri-to-test as xs:string?) as xs:boolean?</code></para><programlisting>Input: a string representing a URI </programlisting><programlisting>Output: a boolean indicating whether it is resolved </programlisting><para>Used by function <code><link linkend="function-uri-is-relative">tan:uri-is-relative</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><emphasis>Option 1 (TAN-core-functions)</emphasis></para><para><code>tan:uri-relative-to($uri-to-revise as xs:string?, $uri-to-revise-against as xs:string?) as xs:string?</code></para><programlisting>2-parameter version of the one below </programlisting><para>Used by template <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code>, <code><link linkend="template-uri-relative-to">ŧ uri-relative-to</link></code>, <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>, <code><link linkend="template-revise-hrefs">ŧ revise-hrefs</link></code>.</para><para>Used by function <code><link linkend="function-uri-relative-to">tan:uri-relative-to</link>()</code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>.</para><para>Relies upon <code><link linkend="function-uri-relative-to">tan:uri-relative-to</link>()</code>.</para><para><emphasis>Option 2 (TAN-core-functions)</emphasis></para><para><code>tan:uri-relative-to($uri-to-revise as xs:string?, $uri-to-revise-against as xs:string?, $base-uri as xs:string?) as xs:string?</code></para><programlisting>Input: two strings representing URIs; a third representing the base against which 
the first two should be resolved </programlisting><programlisting>Output: the first string in a form relative to the second string </programlisting><programlisting>This function looks for common paths within two absolute URIs and tries to convert 
the first URI as a relative path </programlisting><para>Used by template <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code>, <code><link linkend="template-uri-relative-to">ŧ uri-relative-to</link></code>, <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>, <code><link linkend="template-revise-hrefs">ŧ revise-hrefs</link></code>.</para><para>Used by function <code><link linkend="function-uri-relative-to">tan:uri-relative-to</link>()</code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>.</para><para>Relies upon <code><link linkend="function-is-valid-uri">tan:is-valid-uri</link>()</code>, <code><link linkend="function-uri-relative-to">tan:uri-relative-to</link>()</code>.</para></section>
<section xml:id="function-url-is-local"><title><code>tan:url-is-local()</code></title><para><emphasis>TAN-core-functions</emphasis></para><para><code>tan:url-is-local($url-to-test as xs:string?) as xs:boolean</code></para><para>Used by template <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>, <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code>.</para><para>Used by function <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>, <code><link linkend="function-first-loc-available-loop">tan:first-loc-available-loop</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><emphasis>TAN-core-functions</emphasis></para><para><code>tan:value-of($items as item()*) as xs:string?</code></para><programlisting>Input: any sequence of items </programlisting><programlisting>Output: the value of each item </programlisting><programlisting>Proxy for &lt;xsl:value-of/&gt;. Useful as a function in XPath expressions </programlisting><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-vocabulary"><title><code>tan:vocabulary()</code></title><para><emphasis>Option 1 (TAN-core-functions)</emphasis></para><para><code>tan:vocabulary($target-element-names as xs:string*, $target-values as xs:string*) as element()*</code></para><programlisting>2-param version of fuller one below </programlisting><para>Used by variable <code><link linkend="variable-doc-vocabulary">$doc-vocabulary</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-attributes">ŧ core-expansion-terse-attributes</link></code>, <code><link linkend="template-mark-dependencies-pass-1">ŧ mark-dependencies-pass-1</link></code>, <code><link linkend="template-tan-a-lm-expansion-terse">ŧ tan-a-lm-expansion-terse</link></code>.</para><para>Used by function <code><link linkend="function-vocabulary">tan:vocabulary</link>()</code>, <code><link linkend="function-attribute-vocabulary">tan:attribute-vocabulary</link>()</code>, <code><link linkend="function-last-change-agent">tan:last-change-agent</link>()</code>.</para><para>Relies upon <code><link linkend="variable-doc-vocabulary">$doc-vocabulary</link></code>, <code><link linkend="function-vocabulary">tan:vocabulary</link>()</code>.</para><para><emphasis>Option 2 (TAN-core-functions)</emphasis></para><para><code>tan:vocabulary($target-element-names as xs:string*, $target-values as xs:string*, $resolved-vocabulary-ancestors as element()*) as element()*</code></para><programlisting>Input: two sequences of zero or more strings; a sequence of elements representing 
the ancestor of vocabulary in a resolved TAN file </programlisting><programlisting>Output: the vocabulary items for the particular elements whose names match the 
first sequence and whose id, alias, or name values match the second sequence, found in 
descendants of the elements provided by the third sequence </programlisting><programlisting>If either of the first two sequences are empty, or have an *, it is assumed that all 
possible values are sought. Therefore if the first two parameters are empty, the entire 
vocabulary will be returned </programlisting><programlisting>The second parameter is assumed to have one value per item in the sequence. This is 
mandatory because it is designed to take two different types of values: <code><link linkend="attribute-which">@which</link></code> (which is a 
single value and permits spaces) and other attributes (which can be multiple values, and 
spaces delimit values) </programlisting><programlisting>If you approach this function with an attribute that points to elements, and you must 
first to retrieve that attribute's elements, you should run 
<code><link linkend="function-target-element-names">tan:target-element-names</link>()</code> beforehand to generate a list of element names that should be targeted </programlisting><programlisting>It is assumed that the elements are the result of a fully resolved TAN file. </programlisting><programlisting>If a value matches id or alias, no matches on name will be sought (locally redefined 
ids override name values) </programlisting><programlisting>This function does not mark apparant errors, e.g., vocabulary items missing, or 
more than one for a single value </programlisting><programlisting>If you are trying to work with vocabulary from an included document, the 
<code>$resolved-vocabulary-ancestors</code> should point exclusively to content (not self) of the appropriate resolved 
tan:include </programlisting><para>Used by variable <code><link linkend="variable-doc-vocabulary">$doc-vocabulary</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-attributes">ŧ core-expansion-terse-attributes</link></code>, <code><link linkend="template-mark-dependencies-pass-1">ŧ mark-dependencies-pass-1</link></code>, <code><link linkend="template-tan-a-lm-expansion-terse">ŧ tan-a-lm-expansion-terse</link></code>.</para><para>Used by function <code><link linkend="function-vocabulary">tan:vocabulary</link>()</code>, <code><link linkend="function-attribute-vocabulary">tan:attribute-vocabulary</link>()</code>, <code><link linkend="function-last-change-agent">tan:last-change-agent</link>()</code>.</para><para>Relies upon <code><link linkend="function-distinct-items">tan:distinct-items</link>()</code>, <code><link linkend="function-normalize-name">tan:normalize-name</link>()</code>, <code><link linkend="function-vocabulary">tan:vocabulary</link>()</code>, <code><link linkend="template-vocabulary-all-vals">ŧ vocabulary-all-vals</link></code>, <code><link linkend="template-vocabulary-by-id">ŧ vocabulary-by-id</link></code>, <code><link linkend="template-vocabulary-by-name">ŧ vocabulary-by-name</link></code>.</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-mark-dependencies-pass-1">ŧ mark-dependencies-pass-1</link></code>, <code><link linkend="template-mark-dependencies-for-validation">ŧ mark-dependencies-for-validation</link></code>, <code><link linkend="template-tan-a-lm-expansion-terse">ŧ tan-a-lm-expansion-terse</link></code>, <code><link linkend="template-class-1-expansion-verbose-pass-3">ŧ class-1-expansion-verbose-pass-3</link></code>, <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>, <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</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><programlisting>Input: any fragment of XML; boolean indicating whether whitespace nodes should be 
ignored </programlisting><programlisting>Output: a string representation of the fragment </programlisting><programlisting>This function is a proxy of <code>serialize()</code>, used to represent XML fragments in plain 
text, useful in validation reports or in generating guidelines </programlisting><para>Used by template <code><link linkend="template-mark-dependencies-pass-1">ŧ mark-dependencies-pass-1</link></code>, <code><link linkend="template-mark-dependencies-for-validation">ŧ mark-dependencies-for-validation</link></code>, <code><link linkend="template-tan-a-lm-expansion-terse">ŧ tan-a-lm-expansion-terse</link></code>, <code><link linkend="template-class-1-expansion-verbose-pass-3">ŧ class-1-expansion-verbose-pass-3</link></code>, <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>, <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>.</para><para>Relies upon <code><link linkend="template-fragment-to-text">ŧ fragment-to-text</link></code>.</para></section>
</section>
</section>
<section xml:id="vkft-TAN-core-resolve"><title>TAN-core-resolve global variables, keys, and functions summarized</title><section><title>Functions</title><section xml:id="function-get-and-resolve-dependency"><title><code>tan:get-and-resolve-dependency()</code></title><para><emphasis>TAN-core-resolve-functions</emphasis></para><para><code>tan:get-and-resolve-dependency($TAN-elements as element()*) as document-node()*</code></para><programlisting>Input: elements for a dependency, e.g., <code><link linkend="element-source">&lt;source&gt;</link></code>, <code><link linkend="element-morphology">&lt;morphology&gt;</link></code>, <code><link linkend="element-vocabulary">&lt;vocabulary&gt;</link></code> </programlisting><programlisting>Output: documents, if available, minimally resolved </programlisting><programlisting>This function was written principally to expedite the processing of class-2 
sources </programlisting><para>Used by variable <code><link linkend="variable-inclusions-resolved">$inclusions-resolved</link></code>, <code><link linkend="variable-vocabularies-resolved">$vocabularies-resolved</link></code>.</para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>, <code><link linkend="function-get-and-resolve-dependency">tan:get-and-resolve-dependency</link>()</code>.</para><para>Relies upon <code><link linkend="variable-empty-doc">$empty-doc</link></code>, <code><link linkend="function-element-vocabulary">tan:element-vocabulary</link>()</code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>, <code><link linkend="function-get-and-resolve-dependency">tan:get-and-resolve-dependency</link>()</code>, <code><link linkend="function-resolve-doc">tan:resolve-doc</link>()</code>.</para></section>
<section xml:id="function-resolve-alias"><title><code>tan:resolve-alias()</code></title><para><emphasis>TAN-core-resolve-functions</emphasis></para><para><code>tan:resolve-alias($aliases as element()*) as element()*</code></para><programlisting>Input: one or more <code><link linkend="element-alias">&lt;alias&gt;</link></code>es </programlisting><programlisting>Output: those elements with children <code>&lt;idref&gt;</code>, each containing a single value that 
the alias stands for </programlisting><programlisting>It is assumed that <code><link linkend="element-alias">&lt;alias&gt;</link></code>es are still embedded in an XML structure that allows one to 
reference sibling <code><link linkend="element-alias">&lt;alias&gt;</link></code>es </programlisting><programlisting>Note, this function only resolves idrefs, but does not check to see if they target 
anything </programlisting><para>Used by function <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>, <code><link linkend="function-resolve-alias">tan:resolve-alias</link>()</code>.</para><para>Relies upon <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></section>
<section xml:id="function-resolve-alias-loop"><title><code>tan:resolve-alias-loop()</code></title><para><emphasis>TAN-core-resolve-functions</emphasis></para><para><code>tan:resolve-alias-loop($idrefs-to-process as xs:string*, $alias-ids-already-processed as xs:string*, $other-aliases as element()*, $loop-counter as xs:integer) as element()*</code></para><programlisting>Function associated with the master one, above; returns only <code>&lt;id-ref&gt;</code> and <code>&lt;error&gt;</code> 
children </programlisting><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-error">tan:error</link>()</code>, <code><link linkend="function-help-extracted">tan:help-extracted</link>()</code>, <code><link linkend="function-resolve-alias-loop">tan:resolve-alias-loop</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-document as document-node()?) as document-node()?</code></para><para>Used by variable <code><link linkend="variable-annotations-resolved">$annotations-resolved</link></code>, <code><link linkend="variable-see-alsos-resolved">$see-alsos-resolved</link></code>, <code><link linkend="variable-predecessors-resolved">$predecessors-resolved</link></code>, <code><link linkend="variable-successors-resolved">$successors-resolved</link></code>, <code><link linkend="variable-redivisions-resolved">$redivisions-resolved</link></code>, <code><link linkend="variable-model-resolved">$model-resolved</link></code>, <code><link linkend="variable-self-resolved">$self-resolved</link></code>, <code><link linkend="variable-sources-resolved">$sources-resolved</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">ŧ core-expansion-terse</link></code>, <code><link linkend="template-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</link></code>, <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code>.</para><para>Used by function <code><link linkend="function-resolve-doc">tan:resolve-doc</link>()</code>, <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>, <code><link linkend="function-get-and-resolve-dependency">tan:get-and-resolve-dependency</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-document as document-node()?, $add-q-ids as xs:boolean, $attributes-to-add-to-root-element as attribute()*) as document-node()?</code></para><programlisting>Input: any TAN document; a boolean indicating whether each element should be 
stamped with a unique id in <code>@q</code>; attributes that should be added to the root element </programlisting><programlisting>Output: the TAN document, resolved, as explained in the associated loop function 
below </programlisting><para>Used by variable <code><link linkend="variable-annotations-resolved">$annotations-resolved</link></code>, <code><link linkend="variable-see-alsos-resolved">$see-alsos-resolved</link></code>, <code><link linkend="variable-predecessors-resolved">$predecessors-resolved</link></code>, <code><link linkend="variable-successors-resolved">$successors-resolved</link></code>, <code><link linkend="variable-redivisions-resolved">$redivisions-resolved</link></code>, <code><link linkend="variable-model-resolved">$model-resolved</link></code>, <code><link linkend="variable-self-resolved">$self-resolved</link></code>, <code><link linkend="variable-sources-resolved">$sources-resolved</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">ŧ core-expansion-terse</link></code>, <code><link linkend="template-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</link></code>, <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code>.</para><para>Used by function <code><link linkend="function-resolve-doc">tan:resolve-doc</link>()</code>, <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>, <code><link linkend="function-get-and-resolve-dependency">tan:get-and-resolve-dependency</link>()</code>.</para><para>Relies upon <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>.</para></section>
<section xml:id="function-resolve-doc-loop"><title><code>tan:resolve-doc-loop()</code></title><para><emphasis>TAN-core-resolve-functions</emphasis></para><para><code>tan:resolve-doc-loop($TAN-document as document-node()?, $add-q-ids as xs:boolean, $attributes-to-add-to-root-element as attribute()*, $urls-already-visited as xs:string*, $doc-ids-already-visited as xs:string*, $relationship-to-prev-doc as xs:string?, $element-filters as element()*, $loop-counter as xs:integer) as document-node()?</code></para><programlisting>Input: any TAN document and a variety of other parameters </programlisting><programlisting>Output: the document resolved according to specifications </programlisting><programlisting><code>$element-filters</code> is sequence of elements specifying conditions for whether an 
element should be fetched, e.g.,: &lt;filter type="vocabulary"&gt; 
<code>&lt;element-name&gt;</code>item&lt;/element-name&gt; <code>&lt;element-name&gt;</code>verb&lt;/element-name&gt; &lt;name norm=""&gt;vocab name&lt;/name&gt; &lt;/filter&gt; 
&lt;filter inclusion="idref"&gt; <code>&lt;element-name&gt;</code>license&lt;/element-name&gt; 
<code>&lt;element-name&gt;</code>div&lt;/element-name&gt; &lt;/filter&gt; </programlisting><para>Used by template <code><link linkend="template-resolve-critical-dependencies-loop">ŧ resolve-critical-dependencies-loop</link></code>.</para><para>Used by function <code><link linkend="function-resolve-doc">tan:resolve-doc</link>()</code>, <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>.</para><para>Relies upon <code><link linkend="variable-TAN-namespace">$TAN-namespace</link></code>, <code><link linkend="variable-TEI-namespace">$TEI-namespace</link></code>, <code><link linkend="variable-names-of-attributes-that-take-idrefs">$names-of-attributes-that-take-idrefs</link></code>, <code><link linkend="function-base-uri">tan:base-uri</link>()</code>, <code><link linkend="function-class-number">tan:class-number</link>()</code>, <code><link linkend="function-error">tan:error</link>()</code>, <code><link linkend="function-normalize-name">tan:normalize-name</link>()</code>, <code><link linkend="function-resolve-alias">tan:resolve-alias</link>()</code>, <code><link linkend="function-resolve-doc">tan:resolve-doc</link>()</code>, <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>, <code><link linkend="function-target-element-names">tan:target-element-names</link>()</code>, <code><link linkend="template-apply-inclusions-and-adjust-vocabulary">ŧ apply-inclusions-and-adjust-vocabulary</link></code>, <code><link linkend="template-first-stamp-shallow-copy">ŧ first-stamp-shallow-copy</link></code>, <code><link linkend="template-first-stamp-shallow-skip">ŧ first-stamp-shallow-skip</link></code>, <code><link linkend="template-resolve-critical-dependencies-loop">ŧ resolve-critical-dependencies-loop</link></code>, <code><link linkend="template-resolve-numerals">ŧ resolve-numerals</link></code>.</para></section>
<section xml:id="function-resolve-href"><title><code>tan:resolve-href()</code></title><para><emphasis>Option 1 (TAN-core-resolve-functions)</emphasis></para><para><code>tan:resolve-href($xml-node as node()?) as node()?</code></para><programlisting>One-parameter version of the full one, below </programlisting><para>Used by function <code><link linkend="function-resolve-href">tan:resolve-href</link>()</code>, <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><para><emphasis>Option 2 (TAN-core-resolve-functions)</emphasis></para><para><code>tan:resolve-href($xml-node as node()?, $add-q-ids as xs:boolean) as node()?</code></para><programlisting>Two-parameter version of the full one, below </programlisting><para>Used by function <code><link linkend="function-resolve-href">tan:resolve-href</link>()</code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>.</para><para>Relies upon <code><link linkend="function-base-uri">tan:base-uri</link>()</code>, <code><link linkend="function-resolve-href">tan:resolve-href</link>()</code>.</para><para><emphasis>Option 3 (TAN-core-resolve-functions)</emphasis></para><para><code>tan:resolve-href($xml-node as node()?, $add-q-ids as xs:boolean, $this-base-uri as xs:string) as node()?</code></para><programlisting>Input: any XML node, a boolean, a string </programlisting><programlisting>Output: the same node, but with <code><link linkend="attribute-href">@href</link></code> in itself and all descendant elements resolved 
to absolute form, with <code>@orig-href</code> inserted preserving the original if there is a 
change </programlisting><programlisting>The second parameter is provided because this function works closely with 
<code><link linkend="function-resolve-doc">tan:resolve-doc</link>()</code>. </programlisting><para>Used by function <code><link linkend="function-resolve-href">tan:resolve-href</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>
</section>
<section xml:id="vkft-TAN-core-expand"><title>TAN-core-expand global variables, keys, and functions summarized</title><section><title>Functions</title><section xml:id="function-build-parent-ref-tree"><title><code>tan:build-parent-ref-tree()</code></title><para><emphasis>TAN-core-expand-functions</emphasis></para><para><code>tan:build-parent-ref-tree($parent-refs as element()*, $level-to-build as xs:integer, $ref-so-far as xs:string?) as element()*</code></para><programlisting>Input: any elements that are parents of <code>&lt;ref&gt;</code>s; an integer </programlisting><programlisting>Output: the parent refs built into a tree; the integer is used to loop through the tree </programlisting><programlisting>This assumes that there is only one <code>&lt;ref&gt;</code>, with constituent <code>&lt;n&gt;</code>s and a single <code>text()</code> 
that joins them into a reference </programlisting><programlisting>If any <code>&lt;ref&gt;</code> lacks the requisite number of <code>&lt;n&gt;</code>s (2nd parameter) it will be ignored </programlisting><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>, <code><link linkend="function-build-parent-ref-tree">tan:build-parent-ref-tree</link>()</code>.</para><para>Relies upon <code><link linkend="variable-separator-hierarchy">$separator-hierarchy</link></code>, <code><link linkend="function-build-parent-ref-tree">tan:build-parent-ref-tree</link>()</code>.</para></section>
<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 as document-node()?) as document-node()*</code></para><programlisting>one-parameter version of the fuller one below </programlisting><para>Used by variable <code><link linkend="variable-morphologies-expanded">$morphologies-expanded</link></code>, <code><link linkend="variable-self-expanded">$self-expanded</link></code>.</para><para>Used by template <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code>, <code><link linkend="template-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</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-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 as document-node()?, $target-phase as xs:string) as document-node()*</code></para><programlisting>two-parameter version of the fuller one below </programlisting><para>Used by variable <code><link linkend="variable-morphologies-expanded">$morphologies-expanded</link></code>, <code><link linkend="variable-self-expanded">$self-expanded</link></code>.</para><para>Used by template <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code>, <code><link linkend="template-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</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-expand-doc">tan:expand-doc</link>()</code>.</para><para><emphasis>Option 3 (TAN-core-expand-functions)</emphasis></para><para><code>tan:expand-doc($tan-doc as document-node()?, $target-phase as xs:string, $use-validation-mode as xs:boolean) </code></para><programlisting>Input: a resolved TAN document, a string indicating a phase of expansion, a boolean 
indicating whether the function is intended to serve validation </programlisting><programlisting>Output: the document and its dependencies expanded to the phase indicated. </programlisting><programlisting>If validation mode is true, then the results will be stripped down to root element and 
the bare markers for errors, warnings, and fixes. If validation mode is false, then the 
complete, expanded document and its dependencies will be returned. </programlisting><programlisting>Because class 2 files are expanded hand-in-glove with the class 1 files they depend 
upon, expansion is necessarily synchronized with its dependent sources. The expanded 
form of the original class-2 document is the first document of the result, and the 
expanded class-1 or -3 files follow. A TAN-A file expanded verbosely will return as its last 
document one TAN-A_merge file per work detected. TAN-A_merge files collate into a single 
master reference system all <code><link linkend="element-source">&lt;source&gt;</link></code>s of the TAN-A file that are versions of that work. </programlisting><para>Used by variable <code><link linkend="variable-morphologies-expanded">$morphologies-expanded</link></code>, <code><link linkend="variable-self-expanded">$self-expanded</link></code>.</para><para>Used by template <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code>, <code><link linkend="template-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</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-id">$doc-id</link></code>, <code><link linkend="variable-morphologies-resolved">$morphologies-resolved</link></code>, <code><link linkend="variable-sources-resolved">$sources-resolved</link></code>, <code><link linkend="variable-validation-phase-names">$validation-phase-names</link></code>, <code><link linkend="function-build-parent-ref-tree">tan:build-parent-ref-tree</link>()</code>, <code><link linkend="function-class-number">tan:class-number</link>()</code>, <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>, <code><link linkend="function-get-and-resolve-dependency">tan:get-and-resolve-dependency</link>()</code>, <code><link linkend="function-tan-type">tan:tan-type</link>()</code>, <code><link linkend="function-xml-to-string">tan:xml-to-string</link>()</code>, <code><link linkend="template-catalog-expansion-terse">ŧ catalog-expansion-terse</link></code>, <code><link linkend="template-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</link></code>, <code><link linkend="template-class-1-expansion-verbose-pass-2">ŧ class-1-expansion-verbose-pass-2</link></code>, <code><link linkend="template-class-1-expansion-verbose-pass-3">ŧ class-1-expansion-verbose-pass-3</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-for-validation">ŧ class-2-expansion-terse-for-validation</link></code>, <code><link linkend="template-class-2-expansion-verbose">ŧ class-2-expansion-verbose</link></code>, <code><link linkend="template-core-expansion-ad-hoc-pre-pass">ŧ core-expansion-ad-hoc-pre-pass</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-attributes">ŧ core-expansion-terse-attributes</link></code>, <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code>, <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code>, <code><link linkend="template-dependency-adjustments-pass-2">ŧ dependency-adjustments-pass-2</link></code>, <code><link linkend="template-mark-dependencies-pass-1">ŧ mark-dependencies-pass-1</link></code>, <code><link linkend="template-mark-dependencies-pass-2">ŧ mark-dependencies-pass-2</link></code>, <code><link linkend="template-mark-dependencies-pass-2-for-validation">ŧ mark-dependencies-pass-2-for-validation</link></code>, <code><link linkend="template-remove-first-token">ŧ remove-first-token</link></code>, <code><link linkend="template-reset-hierarchy">ŧ reset-hierarchy</link></code>, <code><link linkend="template-strip-dependencies-to-markers">ŧ strip-dependencies-to-markers</link></code>, <code><link linkend="template-strip-for-validation">ŧ strip-for-validation</link></code>, <code><link linkend="template-tan-a-lm-expansion-terse">ŧ tan-a-lm-expansion-terse</link></code>.</para></section>
<section xml:id="function-expand-doc-test"><title><code>tan:expand-doc-test()</code></title><para><emphasis>TAN-core-expand-functions</emphasis></para><para><code>tan:expand-doc-test($tan-doc as document-node()?, $target-phase as xs:string, $use-validation-mode as xs:boolean) as document-node()*</code></para><programlisting>Input: a TAN document, a string specifying a target phase, and a boolean specifying 
whether validation should be used </programlisting><programlisting>Output: select diagnostic output, testing the sequences of the expansion process </programlisting><programlisting>In most cases, the output will be simple or non-existent. The function can be used to 
tailor specific conditions, to test the accuracy and speed of the expansion process. </programlisting><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 xml:id="vkft-TAN-core-errors"><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><emphasis>TAN-core-errors</emphasis></para><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-core-expansion-terse">ŧ core-expansion-terse</link></code>, <code><link linkend="template-imitate-validation">ŧ imitate-validation</link></code>, <code><link linkend="template-imprint-adjustment-action">ŧ imprint-adjustment-action</link></code>, <code><link linkend="template-element-to-error">ŧ element-to-error</link></code>.</para><para>Used by function <code><link linkend="function-imprint-adjustment-locator">tan:imprint-adjustment-locator</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="variable-errors-to-squelch"><title><code>$errors-to-squelch</code></title><para><emphasis>TAN-core-errors</emphasis></para><para>Definition: <code><link linkend="variable-errors">$errors</link>/tan:errors/tan:squelch[@phase = $validation-phase]/tan:error-id</code></para><para>Used by template <code><link linkend="template-imitate-validation">ŧ imitate-validation</link></code>.</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><emphasis>TAN-core-errors</emphasis></para><para>Definition: <code>tan:escape($help-trigger)</code></para><para>Used by function <code><link linkend="function-help-extracted">tan:help-extracted</link>()</code>, <code><link linkend="function-normalize-text">tan:normalize-text</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-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><programlisting>one-parameter function of the master version, below </programlisting><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-apply-inclusions-and-adjust-vocabulary">ŧ apply-inclusions-and-adjust-vocabulary</link></code>, <code><link linkend="template-first-stamp-shallow-copy">ŧ first-stamp-shallow-copy</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="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-adjustments-pass-1, <code><link linkend="template-expand-reassigns">ŧ expand-reassigns</link></code>, <code><link linkend="template-resolve-critical-dependencies-loop">ŧ resolve-critical-dependencies-loop</link></code>, <code><link linkend="template-dependency-adjustments-pass-2">ŧ dependency-adjustments-pass-2</link></code>, <code><link linkend="template-resolve-numerals">ŧ resolve-numerals</link></code>, <code><link linkend="template-mark-tok-pos">ŧ mark-tok-pos</link></code>, <code><link linkend="template-catalog-expansion-terse">ŧ catalog-expansion-terse</link></code>, <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>, <code><link linkend="template-check-and-expand-ranges">ŧ check-and-expand-ranges</link></code>, <code><link linkend="template-mark-dependencies-pass-2-for-validation">ŧ mark-dependencies-pass-2-for-validation</link></code>, <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code> class-2-expansion-terse-for-validation, <code><link linkend="template-class-1-expansion-verbose-pass-2">ŧ class-1-expansion-verbose-pass-2</link></code>, <code><link linkend="template-class-2-expansion-verbose">ŧ class-2-expansion-verbose</link></code>, <code><link linkend="template-class-1-expansion-verbose-pass-3">ŧ class-1-expansion-verbose-pass-3</link></code>, <code><link linkend="template-cut-faulty-hrefs">ŧ cut-faulty-hrefs</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-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-adjustments-pass-1 normalize-tei-space, <code><link linkend="template-tan-a-lm-expansion-terse">ŧ tan-a-lm-expansion-terse</link></code>, <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code> core-expansion-terse, <code><link linkend="template-strip-divs-to-reset">ŧ strip-divs-to-reset</link></code>, <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code>.</para><para>Used by function <code><link linkend="function-error">tan:error</link>()</code>, <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>, <code><link linkend="function-resolve-alias-loop">tan:resolve-alias-loop</link>()</code>, <code><link linkend="function-collection">tan:collection</link>()</code>, <code><link linkend="function-sequence-error">tan:sequence-error</link>()</code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</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><programlisting>two-parameter function of the master version, below </programlisting><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-apply-inclusions-and-adjust-vocabulary">ŧ apply-inclusions-and-adjust-vocabulary</link></code>, <code><link linkend="template-first-stamp-shallow-copy">ŧ first-stamp-shallow-copy</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="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-adjustments-pass-1, <code><link linkend="template-expand-reassigns">ŧ expand-reassigns</link></code>, <code><link linkend="template-resolve-critical-dependencies-loop">ŧ resolve-critical-dependencies-loop</link></code>, <code><link linkend="template-dependency-adjustments-pass-2">ŧ dependency-adjustments-pass-2</link></code>, <code><link linkend="template-resolve-numerals">ŧ resolve-numerals</link></code>, <code><link linkend="template-mark-tok-pos">ŧ mark-tok-pos</link></code>, <code><link linkend="template-catalog-expansion-terse">ŧ catalog-expansion-terse</link></code>, <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>, <code><link linkend="template-check-and-expand-ranges">ŧ check-and-expand-ranges</link></code>, <code><link linkend="template-mark-dependencies-pass-2-for-validation">ŧ mark-dependencies-pass-2-for-validation</link></code>, <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code> class-2-expansion-terse-for-validation, <code><link linkend="template-class-1-expansion-verbose-pass-2">ŧ class-1-expansion-verbose-pass-2</link></code>, <code><link linkend="template-class-2-expansion-verbose">ŧ class-2-expansion-verbose</link></code>, <code><link linkend="template-class-1-expansion-verbose-pass-3">ŧ class-1-expansion-verbose-pass-3</link></code>, <code><link linkend="template-cut-faulty-hrefs">ŧ cut-faulty-hrefs</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-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-adjustments-pass-1 normalize-tei-space, <code><link linkend="template-tan-a-lm-expansion-terse">ŧ tan-a-lm-expansion-terse</link></code>, <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code> core-expansion-terse, <code><link linkend="template-strip-divs-to-reset">ŧ strip-divs-to-reset</link></code>, <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code>.</para><para>Used by function <code><link linkend="function-error">tan:error</link>()</code>, <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>, <code><link linkend="function-resolve-alias-loop">tan:resolve-alias-loop</link>()</code>, <code><link linkend="function-collection">tan:collection</link>()</code>, <code><link linkend="function-sequence-error">tan:sequence-error</link>()</code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</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><programlisting>four-parameter function of the master version, below </programlisting><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-apply-inclusions-and-adjust-vocabulary">ŧ apply-inclusions-and-adjust-vocabulary</link></code>, <code><link linkend="template-first-stamp-shallow-copy">ŧ first-stamp-shallow-copy</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="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-adjustments-pass-1, <code><link linkend="template-expand-reassigns">ŧ expand-reassigns</link></code>, <code><link linkend="template-resolve-critical-dependencies-loop">ŧ resolve-critical-dependencies-loop</link></code>, <code><link linkend="template-dependency-adjustments-pass-2">ŧ dependency-adjustments-pass-2</link></code>, <code><link linkend="template-resolve-numerals">ŧ resolve-numerals</link></code>, <code><link linkend="template-mark-tok-pos">ŧ mark-tok-pos</link></code>, <code><link linkend="template-catalog-expansion-terse">ŧ catalog-expansion-terse</link></code>, <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>, <code><link linkend="template-check-and-expand-ranges">ŧ check-and-expand-ranges</link></code>, <code><link linkend="template-mark-dependencies-pass-2-for-validation">ŧ mark-dependencies-pass-2-for-validation</link></code>, <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code> class-2-expansion-terse-for-validation, <code><link linkend="template-class-1-expansion-verbose-pass-2">ŧ class-1-expansion-verbose-pass-2</link></code>, <code><link linkend="template-class-2-expansion-verbose">ŧ class-2-expansion-verbose</link></code>, <code><link linkend="template-class-1-expansion-verbose-pass-3">ŧ class-1-expansion-verbose-pass-3</link></code>, <code><link linkend="template-cut-faulty-hrefs">ŧ cut-faulty-hrefs</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-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-adjustments-pass-1 normalize-tei-space, <code><link linkend="template-tan-a-lm-expansion-terse">ŧ tan-a-lm-expansion-terse</link></code>, <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code> core-expansion-terse, <code><link linkend="template-strip-divs-to-reset">ŧ strip-divs-to-reset</link></code>, <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code>.</para><para>Used by function <code><link linkend="function-error">tan:error</link>()</code>, <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>, <code><link linkend="function-resolve-alias-loop">tan:resolve-alias-loop</link>()</code>, <code><link linkend="function-collection">tan:collection</link>()</code>, <code><link linkend="function-sequence-error">tan:sequence-error</link>()</code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</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><programlisting>Input: idref of an error, and optional diagnostic messages </programlisting><programlisting>Output: the appropriate <code>&lt;error&gt;</code> with each diagnostic inserted as a child <code>&lt;message&gt;</code> </programlisting><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-apply-inclusions-and-adjust-vocabulary">ŧ apply-inclusions-and-adjust-vocabulary</link></code>, <code><link linkend="template-first-stamp-shallow-copy">ŧ first-stamp-shallow-copy</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="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-adjustments-pass-1, <code><link linkend="template-expand-reassigns">ŧ expand-reassigns</link></code>, <code><link linkend="template-resolve-critical-dependencies-loop">ŧ resolve-critical-dependencies-loop</link></code>, <code><link linkend="template-dependency-adjustments-pass-2">ŧ dependency-adjustments-pass-2</link></code>, <code><link linkend="template-resolve-numerals">ŧ resolve-numerals</link></code>, <code><link linkend="template-mark-tok-pos">ŧ mark-tok-pos</link></code>, <code><link linkend="template-catalog-expansion-terse">ŧ catalog-expansion-terse</link></code>, <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>, <code><link linkend="template-check-and-expand-ranges">ŧ check-and-expand-ranges</link></code>, <code><link linkend="template-mark-dependencies-pass-2-for-validation">ŧ mark-dependencies-pass-2-for-validation</link></code>, <code><link linkend="template-class-2-expansion-terse">ŧ class-2-expansion-terse</link></code> class-2-expansion-terse-for-validation, <code><link linkend="template-class-1-expansion-verbose-pass-2">ŧ class-1-expansion-verbose-pass-2</link></code>, <code><link linkend="template-class-2-expansion-verbose">ŧ class-2-expansion-verbose</link></code>, <code><link linkend="template-class-1-expansion-verbose-pass-3">ŧ class-1-expansion-verbose-pass-3</link></code>, <code><link linkend="template-cut-faulty-hrefs">ŧ cut-faulty-hrefs</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-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-adjustments-pass-1 normalize-tei-space, <code><link linkend="template-tan-a-lm-expansion-terse">ŧ tan-a-lm-expansion-terse</link></code>, <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code> core-expansion-terse, <code><link linkend="template-strip-divs-to-reset">ŧ strip-divs-to-reset</link></code>, <code><link linkend="template-core-expansion-verbose">ŧ core-expansion-verbose</link></code>.</para><para>Used by function <code><link linkend="function-error">tan:error</link>()</code>, <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>, <code><link linkend="function-resolve-alias-loop">tan:resolve-alias-loop</link>()</code>, <code><link linkend="function-collection">tan:collection</link>()</code>, <code><link linkend="function-sequence-error">tan:sequence-error</link>()</code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</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-codes"><title><code>tan:error-codes()</code></title><para><emphasis>TAN-core-errors</emphasis></para><para><code>tan:error-codes($string-with-error-codes as xs:string?) as xs:string*</code></para><programlisting>Input: a string </programlisting><programlisting>Output: the error codes found within the string </programlisting><programlisting>This function is used primarily in TAN-core.sch, to parse comments in 
functions/errors/*.xml and see which errors are expected. </programlisting><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-error-report"><title><code>tan:error-report()</code></title><para><emphasis>TAN-core-errors</emphasis></para><para><code>tan:error-report($error as item()*) as xs:string*</code></para><programlisting>Input: <code>&lt;error&gt;</code>s or strings corresponding to an error id </programlisting><programlisting>Output: a sequence of strings to be reported to the user </programlisting><para>Used by template <code><link linkend="template-imitate-validation">ŧ imitate-validation</link></code>.</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><emphasis>TAN-core-errors</emphasis></para><para><code>tan:fix($fix as item()*, $fix-type as xs:string?) as element()?</code></para><programlisting>Input: any items; a string representing a fix type </programlisting><programlisting>Ouput: a tan:fix element with <code><link linkend="attribute-type">@type</link></code> </programlisting><programlisting>This function is used to populate a file with material to be used by Schematron Quick 
Fixes </programlisting><para>Used by function <code><link linkend="function-help-or-info">tan:help-or-info</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-help"><title><code>tan:help()</code></title><para><emphasis>TAN-core-errors</emphasis></para><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-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code>, <code><link linkend="template-class-1-expansion-verbose-pass-2">ŧ class-1-expansion-verbose-pass-2</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><emphasis>TAN-core-errors</emphasis></para><para><code>tan:help-extracted($strings-to-check as xs:string*) as element()*</code></para><programlisting>Input: any strings </programlisting><programlisting>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. </programlisting><para>Used by template <code><link linkend="template-apply-inclusions-and-adjust-vocabulary">ŧ apply-inclusions-and-adjust-vocabulary</link></code>, <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code>, <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code>.</para><para>Used by function <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link>()</code>, <code><link linkend="function-resolve-alias-loop">tan:resolve-alias-loop</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><emphasis>TAN-core-errors</emphasis></para><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><programlisting>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) </programlisting><programlisting>Output: an element with the appropriate help or info message </programlisting><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><emphasis>TAN-core-errors</emphasis></para><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 xml:id="vkft-TAN-core-string"><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><emphasis>TAN-core-string-functions</emphasis></para><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 xml:id="variable-nested-phrase-close-marker-regex"><title><code>$nested-phrase-close-marker-regex</code></title><para><emphasis>TAN-core-string-functions</emphasis></para><para>Definition: <code>concat('[', tan:escape(string-join(<link linkend="variable-nested-phrase-markers">$nested-phrase-markers</link>/tan:pair/tan:close/text(), '')), ']')</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-nested-phrase-markers">$nested-phrase-markers</link></code>.</para></section>
<section xml:id="variable-nested-phrase-marker-regex"><title><code>$nested-phrase-marker-regex</code></title><para><emphasis>TAN-core-string-functions</emphasis></para><para>Definition: <code>concat('[', tan:escape(string-join(<link linkend="variable-nested-phrase-markers">$nested-phrase-markers</link>/tan:pair/*/text(), '')), ']')</code></para><para>Used by function <code><link linkend="function-nested-phrase-loop">tan:nested-phrase-loop</link>()</code>.</para><para>Relies upon <code><link linkend="variable-nested-phrase-markers">$nested-phrase-markers</link></code>.</para></section>
<section xml:id="variable-nested-phrase-markers"><title><code>$nested-phrase-markers</code></title><para><emphasis>TAN-core-string-functions</emphasis></para><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>Used by variable <code><link linkend="variable-nested-phrase-marker-regex">$nested-phrase-marker-regex</link></code>, <code><link linkend="variable-nested-phrase-close-marker-regex">$nested-phrase-close-marker-regex</link></code>.</para><para>Used by function <code><link linkend="function-nested-phrase-loop">tan:nested-phrase-loop</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><emphasis>TAN-core-string-functions</emphasis></para><para><code>tan:atomize-string($input as xs:string?) as xs:string*</code></para><programlisting>alias for <code>tan:-chop-string()</code> </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</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><emphasis>TAN-core-string-functions</emphasis></para><para><code>tan:batch-replace($string-to-replace as xs:string?, $replace-elements as element()*) as xs:string?</code></para><programlisting>Input: a string, a sequence of &lt;[ANY NAME] pattern="" replacement="" [flags=""]&gt; </programlisting><programlisting>Output: the string, after those replaces are processed in order </programlisting><para>Used by function <code><link linkend="function-batch-replace">tan:batch-replace</link>()</code>.</para><para>Relies upon <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><emphasis>Option 1 (TAN-core-string-functions)</emphasis></para><para><code>tan:chop-string($input as xs:string?) as xs:string*</code></para><programlisting>Input: any string </programlisting><programlisting>Output: that string chopped into a sequence of individual characters, following 
TAN rules (modifying characters always join their preceding base character) </programlisting><para>Used by template <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>, <code><link linkend="template-mark-dependencies-pass-2">ŧ mark-dependencies-pass-2</link></code>.</para><para>Used by function <code><link linkend="function-infuse-divs">tan:infuse-divs</link>()</code>, <code><link linkend="function-int-to-grc">tan:int-to-grc</link>()</code>, <code><link linkend="function-atomize-string">tan:atomize-string</link>()</code>, <code><link linkend="function-string-length">tan:string-length</link>()</code>, <code><link linkend="function-chop-string">tan:chop-string</link>()</code>.</para><para>Relies upon <code><link linkend="variable-char-reg-exp">$char-reg-exp</link></code>.</para><para><emphasis>Option 2 (TAN-core-string-functions)</emphasis></para><para><code>tan:chop-string($input as xs:string?, $chop-after-regex as xs:string) as xs:string*</code></para><programlisting>2-param version of the fuller one below </programlisting><para>Used by template <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>, <code><link linkend="template-mark-dependencies-pass-2">ŧ mark-dependencies-pass-2</link></code>.</para><para>Used by function <code><link linkend="function-infuse-divs">tan:infuse-divs</link>()</code>, <code><link linkend="function-int-to-grc">tan:int-to-grc</link>()</code>, <code><link linkend="function-atomize-string">tan:atomize-string</link>()</code>, <code><link linkend="function-string-length">tan:string-length</link>()</code>, <code><link linkend="function-chop-string">tan:chop-string</link>()</code>.</para><para>Relies upon <code><link linkend="function-chop-string">tan:chop-string</link>()</code>.</para><para><emphasis>Option 3 (TAN-core-string-functions)</emphasis></para><para><code>tan:chop-string($input as xs:string?, $chop-after-regex as xs:string, $preserve-nested-clauses as xs:boolean) as xs:string*</code></para><programlisting>Input: any string, a regular expression, a boolean </programlisting><programlisting>Output: the input string cut into a sequence of strings using the regular expression 
as the cut marker </programlisting><programlisting>If the last boolean is true, then nested clauses (parentheses, direct quotations, 
etc.) will be preserved. </programlisting><programlisting>This function differs from the 1-parameter version in that it is used to chop the 
string not into individual characters but into words, clauses, sentences, etc. </programlisting><para>Used by template <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>, <code><link linkend="template-mark-dependencies-pass-2">ŧ mark-dependencies-pass-2</link></code>.</para><para>Used by function <code><link linkend="function-infuse-divs">tan:infuse-divs</link>()</code>, <code><link linkend="function-int-to-grc">tan:int-to-grc</link>()</code>, <code><link linkend="function-atomize-string">tan:atomize-string</link>()</code>, <code><link linkend="function-string-length">tan:string-length</link>()</code>, <code><link linkend="function-chop-string">tan:chop-string</link>()</code>.</para><para>Relies upon <code><link linkend="function-nested-phrase-loop">tan:nested-phrase-loop</link>()</code>.</para></section>
<section xml:id="function-collate-loop-inner"><title><code>tan:collate-loop-inner()</code></title><para><emphasis>TAN-core-string-functions</emphasis></para><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><programlisting>Input: a collation element (see template mode diff-to-collation), one string to 
process, and the corresponding string label </programlisting><programlisting>Output: a series of collation elements, marking where there is commonality and 
differences </programlisting><programlisting>This inner loop returns only the children of the collation element; the outer loop 
handles the parent element </programlisting><programlisting>This function supports the XSLT 2.0 version of <code><link linkend="function-collate">tan:collate</link>()</code> </programlisting><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-collate-loop-inner">tan:collate-loop-inner</link>()</code>, <code><link linkend="function-diff">tan:diff</link>()</code>.</para></section>
<section xml:id="function-collate-loop-outer"><title><code>tan:collate-loop-outer()</code></title><para><emphasis>TAN-core-string-functions</emphasis></para><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><programlisting>Input: a collation element (see template mode diff-to-collation), some strings to 
process, and corresponding string labels </programlisting><programlisting>Output: a series of collation elements, marking where there is commonality and 
differences </programlisting><programlisting>This function supports the XSLT 2.0 version of <code><link linkend="function-collate">tan:collate</link>()</code> </programlisting><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>, <code><link linkend="function-trim-long-text">tan:trim-long-text</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><programlisting>2-param version of fuller one below </programlisting><para>Used by template <code><link linkend="template-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</link></code>.</para><para>Used by function <code><link linkend="function-diff-cache">tan:diff-cache</link>()</code>, <code><link linkend="function-giant-diff">tan:giant-diff</link>()</code>, <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><programlisting>3-param version of fuller one below </programlisting><para>Used by template <code><link linkend="template-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</link></code>.</para><para>Used by function <code><link linkend="function-diff-cache">tan:diff-cache</link>()</code>, <code><link linkend="function-giant-diff">tan:giant-diff</link>()</code>, <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 3 (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, $preprocess-long-strings as xs:boolean) as element()</code></para><programlisting>This function prepares strings for 5-ary <code><link linkend="function-diff">tan:diff</link>()</code>, primarily by tending to input 
strings that are large or really large (giant). Large pairs of strings are parsed to find 
common characters that might be used to find pairwise congruence of large segments. Giant 
pairs of strings are passed to <code><link linkend="function-giant-diff">tan:giant-diff</link>()</code>. </programlisting><para>Used by template <code><link linkend="template-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</link></code>.</para><para>Used by function <code><link linkend="function-diff-cache">tan:diff-cache</link>()</code>, <code><link linkend="function-giant-diff">tan:giant-diff</link>()</code>, <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>, <code><link linkend="function-ellipses">tan:ellipses</link>()</code>, <code><link linkend="function-giant-diff">tan:giant-diff</link>()</code>.</para><para><emphasis>Option 4 (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, $characters-to-tokenize-on as xs:string*, $loop-counter as xs:integer) as element()</code></para><programlisting>Input: any two strings; boolean indicating whether results should snap to nearest 
word; boolean indicating whether long strings should be pre-processed </programlisting><programlisting>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 </programlisting><programlisting>This function was written to assist the validation of <code><link linkend="element-redivision">&lt;redivision&gt;</link></code>s quickly find 
differences between any two strings. The function has been tested on pairs of strings up to 
combined lengths of 9M characters. At that scale, the only way to efficiently process the 
diffs is by chaining smaller diffs, which are still large, optimally about 350K in length. </programlisting><para>Used by template <code><link linkend="template-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</link></code>.</para><para>Used by function <code><link linkend="function-diff-cache">tan:diff-cache</link>()</code>, <code><link linkend="function-giant-diff">tan:giant-diff</link>()</code>, <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-collate-pair-of-sequences">tan:collate-pair-of-sequences</link>()</code>, <code><link linkend="function-diff">tan:diff</link>()</code>, <code><link linkend="function-diff-outer-loop">tan:diff-outer-loop</link>()</code>, <code><link linkend="function-ellipses">tan:ellipses</link>()</code>, <code><link linkend="function-trim-long-text">tan:trim-long-text</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-inner-loop"><title><code>tan:diff-inner-loop()</code></title><para><emphasis>TAN-core-string-functions</emphasis></para><para><code>tan:diff-inner-loop($short-string as element()?, $long-string as element()?, $starting-locs-to-check as xs:integer*, $length-of-short-substring as xs:integer, $search-prefix as xs:string?, $search-suffix as xs:string?, $loop-counter as xs:integer) </code></para><para>Used by function <code><link linkend="function-diff-outer-loop">tan:diff-outer-loop</link>()</code>, <code><link linkend="function-diff-inner-loop">tan:diff-inner-loop</link>()</code>.</para><para>Relies upon <code><link linkend="function-diff-inner-loop">tan:diff-inner-loop</link>()</code>, <code><link linkend="function-trim-long-text">tan:trim-long-text</link>()</code>.</para></section>
<section xml:id="function-diff-outer-loop"><title><code>tan:diff-outer-loop()</code></title><para><emphasis>TAN-core-string-functions</emphasis></para><para><code>tan:diff-outer-loop($short-string as element()?, $long-string as element()?, $start-at-beginning as xs:boolean, $check-vertically-before-horizontally as xs:boolean, $vertical-stops-to-process as xs:double*, $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-outer-loop">tan:diff-outer-loop</link>()</code>.</para><para>Relies upon <code><link linkend="function-common-end-string">tan:common-end-string</link>()</code>, <code><link linkend="function-common-start-string">tan:common-start-string</link>()</code>, <code><link linkend="function-diff-inner-loop">tan:diff-inner-loop</link>()</code>, <code><link linkend="function-diff-outer-loop">tan:diff-outer-loop</link>()</code>, <code><link linkend="function-trim-long-text">tan:trim-long-text</link>()</code>, <code><link linkend="function-vertical-stops">tan:vertical-stops</link>()</code>.</para></section>
<section xml:id="function-ellipses"><title><code>tan:ellipses()</code></title><para><emphasis>TAN-core-string-functions</emphasis></para><para><code>tan:ellipses($strings-to-truncate as xs:string*, $string-length-to-retain as xs:integer) as xs:string*</code></para><programlisting>Input: any sequence of strings; an integer </programlisting><programlisting>Output: the sequence of strings, but with any substring beyond the requested length 
replaced by ellipses </programlisting><para>Used by function <code><link linkend="function-giant-diff">tan:giant-diff</link>()</code>, <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-fill"><title><code>tan:fill()</code></title><para><emphasis>TAN-core-string-functions</emphasis></para><para><code>tan:fill($string-to-fill as xs:string?, $times-to-repeat as xs:integer) as xs:string?</code></para><programlisting>Input: a string, an integer </programlisting><programlisting>Output: a string with the first parameter repeated the number of times specified by 
the integer </programlisting><programlisting>This function was written to facilitate indentation </programlisting><para>Used by template <code><link linkend="template-indent-items">ŧ indent-items</link></code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-nested-phrase-loop"><title><code>tan:nested-phrase-loop()</code></title><para><emphasis>TAN-core-string-functions</emphasis></para><para><code>tan:nested-phrase-loop($elements-to-process as element()*, $current-nesting-data as element()?) as element()*</code></para><programlisting>Input: a series of elements with text content; an element indicating what nesting 
exists so far </programlisting><programlisting>Output: each input element with the text value put into <code>&lt;val&gt;</code> and a </programlisting><para>Used by function <code><link linkend="function-chop-string">tan:chop-string</link>()</code>, <code><link linkend="function-nested-phrase-loop">tan:nested-phrase-loop</link>()</code>.</para><para>Relies upon <code><link linkend="variable-nested-phrase-marker-regex">$nested-phrase-marker-regex</link></code>, <code><link linkend="variable-nested-phrase-markers">$nested-phrase-markers</link></code>, <code><link linkend="function-nested-phrase-loop">tan:nested-phrase-loop</link>()</code>.</para></section>
<section xml:id="function-normalize-name"><title><code>tan:normalize-name()</code></title><para><emphasis>TAN-core-string-functions</emphasis></para><para><code>tan:normalize-name($text as xs:string*) as xs:string*</code></para><programlisting>one-parameter, name-normalizing version of <code><link linkend="function-normalize-text">tan:normalize-text</link>()</code> </programlisting><para>Used by template <code><link linkend="template-first-stamp-shallow-copy">ŧ first-stamp-shallow-copy</link></code>, <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-first-stamp-shallow-skip">ŧ first-stamp-shallow-skip</link></code>, <code><link linkend="template-core-expansion-normal">ŧ core-expansion-normal</link></code>.</para><para>Used by function <code><link linkend="function-vocabulary">tan:vocabulary</link>()</code>, <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>, <code><link linkend="function-attribute-vocabulary">tan:attribute-vocabulary</link>()</code>.</para><para>Relies upon <code><link linkend="function-normalize-text">tan:normalize-text</link>()</code>.</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><programlisting>one-parameter version of full function below </programlisting><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-normalize-text">tan:normalize-text</link>()</code>, <code><link linkend="function-normalize-name">tan:normalize-name</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*, $treat-as-name-values as xs:boolean) as xs:string*</code></para><programlisting>Input: any sequence of strings; a boolean indicating whether the results should be 
name-normalized </programlisting><programlisting>Output: that sequence, with each item's space normalized, and removal of any help 
requested </programlisting><programlisting>In name-normalization, the string is converted to lower-case, and spaces replace 
hyphens, underscores, and illegal characters. </programlisting><programlisting>Special end div characters are not removed in this operation, nor is tail-end space 
adjusted according to TAN rules; for that, see <code><link linkend="function-normalize-div-text">tan:normalize-div-text</link>()</code>. </programlisting><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-normalize-text">tan:normalize-text</link>()</code>, <code><link linkend="function-normalize-name">tan:normalize-name</link>()</code>.</para><para>Relies upon <code><link linkend="variable-help-trigger-regex">$help-trigger-regex</link></code>, <code><link linkend="variable-regex-characters-not-permitted">$regex-characters-not-permitted</link></code>, <code><link linkend="variable-regex-name-space-characters">$regex-name-space-characters</link></code>.</para></section>
<section xml:id="function-string-length"><title><code>tan:string-length()</code></title><para><emphasis>TAN-core-string-functions</emphasis></para><para><code>tan:string-length($input as xs:string?) as xs:integer</code></para><programlisting>Input: any string </programlisting><programlisting>Output: the number of characters in the string, as defined by TAN (i.e., modifiers 
are counted with the preceding base character) </programlisting><para>Used by template <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><programlisting>one-parameter version of the function below </programlisting><para>Used by template <code><link linkend="template-mark-dependencies-for-validation">ŧ mark-dependencies-for-validation</link></code>, <code><link linkend="template-dependency-adjustments-pass-2">ŧ dependency-adjustments-pass-2</link></code>, <code><link linkend="template-tokenize-div">ŧ tokenize-div</link></code>, <code><link linkend="template-mark-dependencies-pass-1">ŧ mark-dependencies-pass-1</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>, <code><link linkend="function-tokenize-text">tan:tokenize-text</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><programlisting>three-parameter version of the function below </programlisting><para>Used by template <code><link linkend="template-mark-dependencies-for-validation">ŧ mark-dependencies-for-validation</link></code>, <code><link linkend="template-dependency-adjustments-pass-2">ŧ dependency-adjustments-pass-2</link></code>, <code><link linkend="template-tokenize-div">ŧ tokenize-div</link></code>, <code><link linkend="template-mark-dependencies-pass-1">ŧ mark-dependencies-pass-1</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>.</para><para><emphasis>Option 3 (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?, $add-attr-q as xs:boolean?, $add-attr-pos as xs:boolean?) as element()*</code></para><programlisting>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. </programlisting><programlisting>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. </programlisting><para>Used by template <code><link linkend="template-mark-dependencies-for-validation">ŧ mark-dependencies-for-validation</link></code>, <code><link linkend="template-dependency-adjustments-pass-2">ŧ dependency-adjustments-pass-2</link></code>, <code><link linkend="template-tokenize-div">ŧ tokenize-div</link></code>, <code><link linkend="template-mark-dependencies-pass-1">ŧ mark-dependencies-pass-1</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>, <code><link linkend="function-tokenize-text">tan:tokenize-text</link>()</code>, <code><link linkend="template-add-tok-pos">ŧ add-tok-pos</link></code>, <code><link linkend="template-first-stamp-shallow-copy">ŧ first-stamp-shallow-copy</link></code>.</para></section>
<section xml:id="function-unique-char"><title><code>tan:unique-char()</code></title><para><emphasis>TAN-core-string-functions</emphasis></para><para><code>tan:unique-char($context-strings as xs:string*) as xs:string?</code></para><programlisting>Input: any sequence of strings </programlisting><programlisting>Output: a single character that is not to be found in those strings </programlisting><programlisting>This function, written to support <code><link linkend="function-collate-sequences">tan:collate-sequences</link>()</code>, provides unique way 
to join any sequence strings in such a way that it can later be tokenized. </programlisting><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-vertical-stops"><title><code>tan:vertical-stops()</code></title><para><emphasis>TAN-core-string-functions</emphasis></para><para><code>tan:vertical-stops($short-string as xs:string?) as xs:double*</code></para><programlisting>Input: a string </programlisting><programlisting>Output: percentages of the string that should be followed in 
<code><link linkend="function-diff-outer-loop">tan:diff-outer-loop</link>()</code> </programlisting><para>Used by function <code><link linkend="function-diff-outer-loop">tan:diff-outer-loop</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
</section>
</section>
<section xml:id="vkft-TAN-core-3-0"><title>TAN-core-3-0 global variables, keys, and functions summarized</title><section><title>Functions</title><section xml:id="function-adjust-diff"><title><code>tan:adjust-diff()</code></title><para><emphasis>TAN-core-3-0-functions</emphasis></para><para><code>tan:adjust-diff($diff-output as element()*) as element()*</code></para><programlisting>Input: any output <code>&lt;diff&gt;</code>s from <code><link linkend="function-diff">tan:diff</link>()</code> </programlisting><programlisting>Output: the output adjusted, with <code>&lt;a&gt;</code> and <code>&lt;b&gt;</code>s adjusted if there are more optimal 
placements </programlisting><para>Used by function <code><link linkend="function-collate">tan:collate</link>()</code>, <code><link linkend="function-giant-diff">tan:giant-diff</link>()</code>, <code><link linkend="function-adjust-diff">tan:adjust-diff</link>()</code>.</para><para>Relies upon <code><link linkend="function-adjust-diff">tan:adjust-diff</link>()</code>, <code><link linkend="function-common-end-string">tan:common-end-string</link>()</code>, <code><link linkend="function-common-start-string">tan:common-start-string</link>()</code>, <code><link linkend="template-trim-or-add-text">ŧ trim-or-add-text</link></code>.</para></section>
<section xml:id="function-collation-to-strings"><title><code>tan:collation-to-strings()</code></title><para><emphasis>TAN-core-3-0-functions</emphasis></para><para><code>tan:collation-to-strings($tan-collate-output as element()?) as element()*</code></para><programlisting>Input: any output from tan:collate (version for XSLT 3.0) </programlisting><programlisting>Output: a sequence of &lt;witness id=""&gt;[ORIGINAL STRING]&lt;/witness&gt; </programlisting><programlisting>This function was written to reverse, and therefore test the integrity of, the 
output of <code><link linkend="function-collate">tan:collate</link>()</code> </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-collation-to-strings">ŧ collation-to-strings</link></code>.</para></section>
<section xml:id="function-common-end-string"><title><code>tan:common-end-string()</code></title><para><emphasis>TAN-core-3-0-functions</emphasis></para><para><code>tan:common-end-string($strings as xs:string*) as xs:string?</code></para><programlisting>See full function below </programlisting><para>Used by function <code><link linkend="function-adjust-diff">tan:adjust-diff</link>()</code>, <code><link linkend="function-diff-outer-loop">tan:diff-outer-loop</link>()</code>.</para><para>Relies upon <code><link linkend="function-common-start-or-end-string">tan:common-start-or-end-string</link>()</code>.</para></section>
<section xml:id="function-common-start-or-end-string"><title><code>tan:common-start-or-end-string()</code></title><para><emphasis>Option 1 (TAN-core-3-0-functions)</emphasis></para><para><code>tan:common-start-or-end-string($strings as xs:string*, $find-common-start as xs:boolean) as xs:string?</code></para><programlisting>See full function below </programlisting><para>Used by function <code><link linkend="function-common-start-string">tan:common-start-string</link>()</code>, <code><link linkend="function-common-end-string">tan:common-end-string</link>()</code>, <code><link linkend="function-common-start-or-end-string">tan:common-start-or-end-string</link>()</code>.</para><para>Relies upon <code><link linkend="function-common-start-or-end-string">tan:common-start-or-end-string</link>()</code>.</para><para><emphasis>Option 2 (TAN-core-3-0-functions)</emphasis></para><para><code>tan:common-start-or-end-string($string-a as xs:string?, $string-b as xs:string?, $find-common-start as xs:boolean) as xs:string?</code></para><programlisting>Input: two strings; a boolean </programlisting><programlisting>Output: the longest common start (param 2 is true) or end (param 2 is false) portion of 
the two strings. </programlisting><para>Used by function <code><link linkend="function-common-start-string">tan:common-start-string</link>()</code>, <code><link linkend="function-common-end-string">tan:common-end-string</link>()</code>, <code><link linkend="function-common-start-or-end-string">tan:common-start-or-end-string</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-common-start-string"><title><code>tan:common-start-string()</code></title><para><emphasis>TAN-core-3-0-functions</emphasis></para><para><code>tan:common-start-string($strings as xs:string*) as xs:string?</code></para><programlisting>See full function below </programlisting><para>Used by function <code><link linkend="function-adjust-diff">tan:adjust-diff</link>()</code>, <code><link linkend="function-diff-outer-loop">tan:diff-outer-loop</link>()</code>.</para><para>Relies upon <code><link linkend="function-common-start-or-end-string">tan:common-start-or-end-string</link>()</code>.</para></section>
<section xml:id="function-diff-cache"><title><code>tan:diff-cache()</code></title><para><emphasis>TAN-core-3-0-functions</emphasis></para><para><code>tan:diff-cache($string-a as xs:string?, $string-b as xs:string?, $snap-to-word as xs:boolean, $preprocess-long-strings as xs:boolean) as element()</code></para><programlisting>This is a shadow function for <code><link linkend="function-diff">tan:diff</link>()</code>. It uses XSLT 3.0 <code>@cache</code>, so that 
<code><link linkend="function-collate">tan:collate</link>()</code> can avoid repeating diffs </programlisting><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>.</para></section>
<section xml:id="function-diff-to-collation"><title><code>tan:diff-to-collation()</code></title><para><emphasis>TAN-core-3-0-functions</emphasis></para><para><code>tan:diff-to-collation($diff-output as element()?, $diff-text-a-label as xs:string?, $diff-text-b-label as xs:string?) as element()</code></para><programlisting>Input: any single output of <code><link linkend="function-diff">tan:diff</link>()</code>, two strings for the labels of diff strings a 
and b </programlisting><programlisting>Output: a <code>&lt;collation&gt;</code> with the data prepped for merging with other collations </programlisting><programlisting>This function was written to support the XSLT 3.0 version of <code><link linkend="function-collate">tan:collate</link>()</code> </programlisting><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="function-giant-diff"><title><code>tan:giant-diff()</code></title><para><emphasis>TAN-core-3-0-functions</emphasis></para><para><code>tan:giant-diff($string-a as xs:string?, $string-b as xs:string?, $snap-to-word as xs:boolean, $string-a-segment-length as xs:integer, $string-b-segment-length as xs:integer) as element()</code></para><programlisting>Input: same parameters as 3-ary <code><link linkend="function-diff">tan:diff</link>()</code>; two integers </programlisting><programlisting>Output: the same as <code><link linkend="function-diff">tan:diff</link>()</code>, but handled differently; the two integers specify 
the segment lengths into which the first and second strings, respectively, should be 
cut. </programlisting><para>Used by function <code><link linkend="function-giant-diff">tan:giant-diff</link>()</code>, <code><link linkend="function-diff">tan:diff</link>()</code>.</para><para>Relies upon <code><link linkend="variable-empty-element">$empty-element</link></code>, <code><link linkend="function-adjust-diff">tan:adjust-diff</link>()</code>, <code><link linkend="function-diff">tan:diff</link>()</code>, <code><link linkend="function-ellipses">tan:ellipses</link>()</code>, <code><link linkend="function-giant-diff">tan:giant-diff</link>()</code>.</para></section>
<section xml:id="function-longest-ascending-subsequence"><title><code>tan:longest-ascending-subsequence()</code></title><para><emphasis>TAN-core-3-0-functions</emphasis></para><para><code>tan:longest-ascending-subsequence($integer-sequence as item()*) as element()*</code></para><programlisting>Input: a sequence of items. Each item is either an integer or a sequence of integers 
(via child elements) </programlisting><programlisting>Output: a sequence of elements. Each one has in its text node an integer greater than 
the preceding element's text node. Each output element has a <code><link linkend="attribute-pos">@pos</link></code> with an integer 
identifying the position of the input item that has been chosen (to handle repetitions in the 
input) </programlisting><programlisting>Although this function claims by its name to find the longest subsequence, in the 
interests of efficiency, it applies the so-called Patience method of finding the string, 
which may return only a very long string, not the longest possible string. Such an approach 
allows the number of operations to be directly proportionate to the number of input values 
(backtracking would be computationally intensive on long sequences). The routine does 
"remember" gaps. If adding a number to the sequence would require a jump, the sequence is 
created, but a copy of the pre-gapped sequence is memoized, in case it is later discovered that 
the pre-gapped sequence is better. </programlisting><programlisting>The input is a sequence of elements, not integers, because this function has been 
written to support <code>tan:collate-pairs-of-sequences()</code>, which requires choice options. 
That is, you may have a situation where you are comparing two sequences, either of which 
may have values that repeat, e.g., (a, b, c, b, d) and (c, b, d). The first sequence is 
converted (1, 2, 3, 4, 5). In finding a corresponding sequence of integers for the second set, b 
must be allowed to be either 2 or 4, i.e., the array [3, [2, 4], 5]. Both items of input would 
ideally be expressed as arrays of integers, but this function serves an XSLT 2.0 library 
(where arrays are not recognized), and arrays are not as easy to construct in XSLT 3.0 as maps 
are. </programlisting><para>Used by function <code><link linkend="function-collate-pair-of-sequences">tan:collate-pair-of-sequences</link>()</code>, <code><link linkend="function-longest-ascending-subsequence">tan:longest-ascending-subsequence</link>()</code>.</para><para>Relies upon <code><link linkend="function-longest-ascending-subsequence">tan:longest-ascending-subsequence</link>()</code>.</para></section>
</section>
</section>
<section xml:id="vkft-regex-ext-tan"><title>regex-ext-tan global variables, keys, and functions summarized</title><section><title>Variables</title><section xml:id="variable-base-marker-regex"><title><code>$base-marker-regex</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para>Definition: <code>'-'</code></para><para>Used by function <code><link linkend="function-process-regex-escape-u">rgx:process-regex-escape-u</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-base64-key"><title><code>$base64-key</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><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', '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', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '\')</code></para><para>Used by function <code><link linkend="function-dec-to-n">rgx:dec-to-n</link>()</code>, <code><link linkend="function-n-to-dec">rgx:n-to-dec</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-characters-allowed-in-ucd-names-regex"><title><code>$characters-allowed-in-ucd-names-regex</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para>Definition: <code>'[-#\(\)a-zA-Z0-9]'</code></para><para>Used by function <code><link linkend="function-process-regex-escape-u">rgx:process-regex-escape-u</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-characters-to-escape-when-converting-string-to-regex"><title><code>$characters-to-escape-when-converting-string-to-regex</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para>Definition: <code>'[\.\[\]\\\|\^\$\?\*\+\{\}\(\)]'</code></para><para>Used by function <code><link linkend="function-escape">rgx:escape</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-close-group-symbols-regex"><title><code>$close-group-symbols-regex</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para>Definition: <code>[\]\)\}]</code></para><para>Used by function <code><link linkend="function-parse-regex">rgx:parse-regex</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-composite-marker-regex"><title><code>$composite-marker-regex</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para>Definition: <code>'\+'</code></para><para>Used by function <code><link linkend="function-process-regex-escape-u">rgx:process-regex-escape-u</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-default-ucd-decomp-db"><title><code>$default-ucd-decomp-db</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para>Definition: <code><link linkend="function-get-ucd-decomp-db">rgx:get-ucd-decomp-db</link>()</code></para><para>Used by function <code><link linkend="function-string-to-components">rgx:string-to-components</link>()</code>, <code><link linkend="function-string-to-composites">rgx:string-to-composites</link>()</code>.</para><para>Relies upon <code><link linkend="function-get-ucd-decomp-db">rgx:get-ucd-decomp-db</link>()</code>.</para></section>
<section xml:id="variable-default-ucd-decomp-simple-db"><title><code>$default-ucd-decomp-simple-db</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para>Definition: <code><link linkend="function-get-ucd-decomp-simple-db">rgx:get-ucd-decomp-simple-db</link>()</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="function-get-ucd-decomp-simple-db">rgx:get-ucd-decomp-simple-db</link>()</code>.</para></section>
<section xml:id="variable-default-ucd-names-db"><title><code>$default-ucd-names-db</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para>Definition: <code><link linkend="function-get-ucd-names-db">rgx:get-ucd-names-db</link>()</code></para><para>Used by function <code><link linkend="function-get-chars-by-name">rgx:get-chars-by-name</link>()</code>, <code><link linkend="function-build-char-replacement-guide">rgx:build-char-replacement-guide</link>()</code>.</para><para>Relies upon <code><link linkend="function-get-ucd-names-db">rgx:get-ucd-names-db</link>()</code>.</para></section>
<section xml:id="variable-escapes-in-regex"><title><code>$escapes-in-regex</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para>Definition: <code>'\\[\.\[\]\\\|\^\$\?\*\+\{\}\(\)nrtdDsSiIcCwW\d]|\\[pPu]\{[^\}]*\}'</code></para><para>Used by function <code><link linkend="function-parse-regex">rgx:parse-regex</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-hex-key"><title><code>$hex-key</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><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-n">rgx:dec-to-n</link>()</code>, <code><link linkend="function-n-to-dec">rgx:n-to-dec</link>()</code>, <code><link linkend="function-hex-to-dec">rgx:hex-to-dec</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-name-marker-regex"><title><code>$name-marker-regex</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para>Definition: <code>'[\.!]'</code></para><para>Used by function <code><link linkend="function-process-regex-escape-u">rgx:process-regex-escape-u</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-open-group-symbols-regex"><title><code>$open-group-symbols-regex</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para>Definition: <code>[\[\(\{]</code></para><para>Used by function <code><link linkend="function-parse-regex">rgx:parse-regex</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-u-item-delimiter-regex"><title><code>$u-item-delimiter-regex</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para>Definition: <code>' '</code></para><para>Used by function <code><link linkend="function-process-regex-escape-u">rgx:process-regex-escape-u</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-unicode-versions-supported"><title><code>$unicode-versions-supported</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para>Definition: <code>5.1, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0</code></para><para>Used by function <code><link linkend="function-best-unicode-version">rgx:best-unicode-version</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-string"><title><code>rgx:analyze-string()</code></title><para><emphasis>Option 1 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:analyze-string($input as xs:string?, $pattern as xs:string) as element()</code></para><para>Used by function <code><link linkend="function-analyze-string">rgx:analyze-string</link>()</code>.</para><para>Relies upon <code><link linkend="function-analyze-string">rgx:analyze-string</link>()</code>.</para><para><emphasis>Option 2 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:analyze-string($input as xs:string?, $pattern as xs:string, $flags as xs:string) as element()</code></para><para>Used by function <code><link linkend="function-analyze-string">rgx:analyze-string</link>()</code>.</para><para>Relies upon <code><link linkend="function-parse-flags">rgx:parse-flags</link>()</code>, <code><link linkend="function-regex">rgx:regex</link>()</code>.</para></section>
<section xml:id="function-best-unicode-version"><title><code>rgx:best-unicode-version()</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para><code>rgx:best-unicode-version($version as xs:double?) as xs:double</code></para><programlisting>Input: a double representing a Unicode version </programlisting><programlisting>Output: the best version supported </programlisting><para>Used by function <code><link linkend="function-get-ucd-decomp-db">rgx:get-ucd-decomp-db</link>()</code>, <code><link linkend="function-get-ucd-decomp-simple-db">rgx:get-ucd-decomp-simple-db</link>()</code>, <code><link linkend="function-get-ucd-names-db">rgx:get-ucd-names-db</link>()</code>, <code><link linkend="function-parse-flags">rgx:parse-flags</link>()</code>.</para><para>Relies upon <code><link linkend="variable-unicode-versions-supported">$unicode-versions-supported</link></code>.</para></section>
<section xml:id="function-build-char-replacement-guide"><title><code>rgx:build-char-replacement-guide()</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para><code>rgx:build-char-replacement-guide($words-in-name-to-drop as xs:string*, $words-in-replacement-char-name as xs:string*, $words-not-in-replacement-char-name as xs:string*, $search-is-strict as xs:boolean?, $version as xs:double) as element()</code></para><programlisting>Input: three sequences of strings; a boolean (whether matches should be strict); a 
double (Unicode version) </programlisting><programlisting>Output: an XML tree rgx:replace/rgx:char/rgx:with specifying that every 
rgx:char/<code><link linkend="attribute-val">@val</link></code> should be replaced by a string-joining of its rgx:with/<code><link linkend="attribute-val">@val.</link></code>. </programlisting><programlisting>This function should be used to optimize replacement through a global variable. See 
documentation at <code><link linkend="function-replace-by-char-name">rgx:replace-by-char-name</link>()</code>, which this function supports. </programlisting><para>Used by function <code><link linkend="function-replace-by-char-name">rgx:replace-by-char-name</link>()</code>.</para><para>Relies upon <code><link linkend="variable-default-ucd-names-db">$default-ucd-names-db</link></code>, <code><link linkend="function-get-chars-by-name">rgx:get-chars-by-name</link>()</code>, <code><link linkend="function-get-ucd-names-db">rgx:get-ucd-names-db</link>()</code>.</para></section>
<section xml:id="function-codepoints-to-string"><title><code>rgx:codepoints-to-string()</code></title><para><emphasis>Option 1 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:codepoints-to-string($arg as xs:integer*) as xs:string?</code></para><programlisting>one-parameter function for the one below; default XML 1.0 </programlisting><para>Used by function <code><link linkend="function-codepoints-to-string">rgx:codepoints-to-string</link>()</code>, <code><link linkend="function-process-regex-escape-u">rgx:process-regex-escape-u</link>()</code>.</para><para>Relies upon <code><link linkend="function-codepoints-to-string">rgx:codepoints-to-string</link>()</code>.</para><para><emphasis>Option 2 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:codepoints-to-string($arg as xs:integer*, $xml-1-0 as xs:boolean) as xs:string?</code></para><programlisting>Input: any number of integers </programlisting><programlisting>Output: the string value representation, but only if the integers represent valid 
characters in XML </programlisting><programlisting>Like <code>fn:codepoints-to-string()</code>, but filters out XML illegal characters </programlisting><para>Used by function <code><link linkend="function-codepoints-to-string">rgx:codepoints-to-string</link>()</code>, <code><link linkend="function-process-regex-escape-u">rgx: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>rgx:dec-to-hex()</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para><code>rgx:dec-to-hex($in as xs:integer?) as xs:string?</code></para><programlisting>Input: xs:integer </programlisting><programlisting>Output: the hexadecimal equivalent as a string, e.g., 31 - &gt; '1F' </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-dec-to-n">rgx:dec-to-n</link>()</code>.</para></section>
<section xml:id="function-dec-to-n"><title><code>rgx:dec-to-n()</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para><code>rgx:dec-to-n($in as xs:integer?, $base as xs:integer) as xs:string?</code></para><programlisting>Input: two integers </programlisting><programlisting>Output: a string that represents the first numeral in base N, where N is the second 
numeral </programlisting><para>Used by function <code><link linkend="function-dec-to-hex">rgx:dec-to-hex</link>()</code>, <code><link linkend="function-dec-to-n">rgx:dec-to-n</link>()</code>.</para><para>Relies upon <code><link linkend="variable-base64-key">$base64-key</link></code>, <code><link linkend="variable-hex-key">$hex-key</link></code>, <code><link linkend="function-dec-to-n">rgx:dec-to-n</link>()</code>.</para></section>
<section xml:id="function-escape"><title><code>rgx:escape()</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para><code>rgx:escape($strings as xs:string*) as xs:string*</code></para><programlisting>Input: any sequence of strings </programlisting><programlisting>Output: each string prepared for regular expression searches, i.e., with reserved 
characters escaped out. </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="variable-characters-to-escape-when-converting-string-to-regex">$characters-to-escape-when-converting-string-to-regex</link></code>.</para></section>
<section xml:id="function-get-chars-by-name"><title><code>rgx:get-chars-by-name()</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para><code>rgx:get-chars-by-name($words-in-name as xs:string*, $words-not-in-name as xs:string*, $version as xs:double) as element()*</code></para><programlisting>Input: two sets of strings </programlisting><programlisting>Output: <code>&lt;char&gt;</code> elements from the Unicode database, the words of whose name (or 
alias) match all the first set and none of the second </programlisting><para>Used by function <code><link linkend="function-process-regex-escape-u">rgx:process-regex-escape-u</link>()</code>, <code><link linkend="function-build-char-replacement-guide">rgx:build-char-replacement-guide</link>()</code>.</para><para>Relies upon <code><link linkend="variable-default-ucd-names-db">$default-ucd-names-db</link></code>, <code><link linkend="function-get-ucd-names-db">rgx:get-ucd-names-db</link>()</code>.</para></section>
<section xml:id="function-get-ucd-decomp-db"><title><code>rgx:get-ucd-decomp-db()</code></title><para><emphasis>Option 1 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:get-ucd-decomp-db() </code></para><programlisting>one-parameter version of fuller one below </programlisting><para>Used by variable <code><link linkend="variable-default-ucd-decomp-db">$default-ucd-decomp-db</link></code>.</para><para>Used by function <code><link linkend="function-get-ucd-decomp-db">rgx:get-ucd-decomp-db</link>()</code>, <code><link linkend="function-string-to-components">rgx:string-to-components</link>()</code>, <code><link linkend="function-string-to-composites">rgx:string-to-composites</link>()</code>.</para><para>Relies upon <code><link linkend="function-get-ucd-decomp-db">rgx:get-ucd-decomp-db</link>()</code>.</para><para><emphasis>Option 2 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:get-ucd-decomp-db($version as xs:double) </code></para><programlisting>Input: a double specifying a Unicode version number </programlisting><programlisting>Output: the document that contains the data for decomposing characters to and from 
their parts </programlisting><para>Used by variable <code><link linkend="variable-default-ucd-decomp-db">$default-ucd-decomp-db</link></code>.</para><para>Used by function <code><link linkend="function-get-ucd-decomp-db">rgx:get-ucd-decomp-db</link>()</code>, <code><link linkend="function-string-to-components">rgx:string-to-components</link>()</code>, <code><link linkend="function-string-to-composites">rgx:string-to-composites</link>()</code>.</para><para>Relies upon <code><link linkend="function-best-unicode-version">rgx:best-unicode-version</link>()</code>.</para></section>
<section xml:id="function-get-ucd-decomp-simple-db"><title><code>rgx:get-ucd-decomp-simple-db()</code></title><para><emphasis>Option 1 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:get-ucd-decomp-simple-db() </code></para><programlisting>one-parameter version of fuller one below </programlisting><para>Used by variable <code><link linkend="variable-default-ucd-decomp-simple-db">$default-ucd-decomp-simple-db</link></code>.</para><para>Used by function <code><link linkend="function-string-base">rgx:string-base</link>()</code>, <code><link linkend="function-get-ucd-decomp-simple-db">rgx:get-ucd-decomp-simple-db</link>()</code>.</para><para>Relies upon <code><link linkend="function-get-ucd-decomp-simple-db">rgx:get-ucd-decomp-simple-db</link>()</code>.</para><para><emphasis>Option 2 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:get-ucd-decomp-simple-db($version as xs:double) </code></para><programlisting>Input: a double specifying a Unicode version number </programlisting><programlisting>Output: the document that contains the data for translating characters to and from 
their base characters </programlisting><para>Used by variable <code><link linkend="variable-default-ucd-decomp-simple-db">$default-ucd-decomp-simple-db</link></code>.</para><para>Used by function <code><link linkend="function-string-base">rgx:string-base</link>()</code>, <code><link linkend="function-get-ucd-decomp-simple-db">rgx:get-ucd-decomp-simple-db</link>()</code>.</para><para>Relies upon <code><link linkend="function-best-unicode-version">rgx:best-unicode-version</link>()</code>.</para></section>
<section xml:id="function-get-ucd-names-db"><title><code>rgx:get-ucd-names-db()</code></title><para><emphasis>Option 1 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:get-ucd-names-db() </code></para><programlisting>zero-parameter version of fuller one below </programlisting><para>Used by variable <code><link linkend="variable-default-ucd-names-db">$default-ucd-names-db</link></code>.</para><para>Used by function <code><link linkend="function-get-ucd-names-db">rgx:get-ucd-names-db</link>()</code>, <code><link linkend="function-get-chars-by-name">rgx:get-chars-by-name</link>()</code>, <code><link linkend="function-build-char-replacement-guide">rgx:build-char-replacement-guide</link>()</code>.</para><para>Relies upon <code><link linkend="function-get-ucd-names-db">rgx:get-ucd-names-db</link>()</code>.</para><para><emphasis>Option 2 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:get-ucd-names-db($version as xs:double) </code></para><programlisting>Input: a double specifying a Unicode version number </programlisting><programlisting>Output: the document that contains the data for Unicode character names </programlisting><para>Used by variable <code><link linkend="variable-default-ucd-names-db">$default-ucd-names-db</link></code>.</para><para>Used by function <code><link linkend="function-get-ucd-names-db">rgx:get-ucd-names-db</link>()</code>, <code><link linkend="function-get-chars-by-name">rgx:get-chars-by-name</link>()</code>, <code><link linkend="function-build-char-replacement-guide">rgx:build-char-replacement-guide</link>()</code>.</para><para>Relies upon <code><link linkend="function-best-unicode-version">rgx:best-unicode-version</link>()</code>.</para></section>
<section xml:id="function-hex-to-dec"><title><code>rgx:hex-to-dec()</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para><code>rgx:hex-to-dec($hex as xs:string?) as xs:integer?</code></para><programlisting>Input: a string representing a hexadecimal number </programlisting><programlisting>Output: the integer value, e.g., '1F' - &gt; 31 </programlisting><para>Used by function <code><link linkend="function-process-regex-escape-u">rgx: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>rgx:matches()</code></title><para><emphasis>Option 1 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:matches($input as xs:string?, $pattern as xs:string) as xs:boolean</code></para><programlisting>two-param function of the three-param version below </programlisting><para>Used by function <code><link linkend="function-matches">rgx:matches</link>()</code>, <code><link linkend="function-regex-is-valid">rgx:regex-is-valid</link>()</code>.</para><para>Relies upon <code><link linkend="function-matches">rgx:matches</link>()</code>.</para><para><emphasis>Option 2 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:matches($input as xs:string?, $pattern as xs:string, $flags as xs:string) as xs:boolean</code></para><programlisting>Parallel to <code>fn:matches()</code>, but converts \u{} into classes. See <code><link linkend="function-regex">rgx:regex</link>()</code> for 
details. </programlisting><para>Used by function <code><link linkend="function-matches">rgx:matches</link>()</code>, <code><link linkend="function-regex-is-valid">rgx:regex-is-valid</link>()</code>.</para><para>Relies upon <code><link linkend="function-parse-flags">rgx:parse-flags</link>()</code>, <code><link linkend="function-regex">rgx:regex</link>()</code>.</para></section>
<section xml:id="function-n-to-dec"><title><code>rgx:n-to-dec()</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para><code>rgx:n-to-dec($input as xs:string?, $base-n as xs:integer) as xs:integer?</code></para><programlisting>Input: string representation of some number; an integer </programlisting><programlisting>Output: an integer representing the first parameter in the base system of the 2nd 
parameter </programlisting><para>Used by function <code><link linkend="function-n-to-dec">rgx:n-to-dec</link>()</code>.</para><para>Relies upon <code><link linkend="variable-base64-key">$base64-key</link></code>, <code><link linkend="variable-hex-key">$hex-key</link></code>, <code><link linkend="function-n-to-dec">rgx:n-to-dec</link>()</code>.</para></section>
<section xml:id="function-parse-flags"><title><code>rgx:parse-flags()</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para><code>rgx:parse-flags($flags as xs:string) as element()</code></para><programlisting>Input: a string corresponding to a <code>$flags</code> parameter in a regular expression 
function </programlisting><programlisting>Output: an element that differentiates parts of the string between special 
TAN-regex flags and not </programlisting><para>Used by function <code><link linkend="function-replace">rgx:replace</link>()</code>, <code><link linkend="function-matches">rgx:matches</link>()</code>, <code><link linkend="function-tokenize">rgx:tokenize</link>()</code>, <code><link linkend="function-analyze-string">rgx:analyze-string</link>()</code>.</para><para>Relies upon <code><link linkend="function-best-unicode-version">rgx:best-unicode-version</link>()</code>.</para></section>
<section xml:id="function-parse-regex"><title><code>rgx:parse-regex()</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para><code>rgx:parse-regex($regex as xs:string?, $version as xs:double) as element()</code></para><programlisting>Input: a regular expression </programlisting><programlisting>Output: an element with the regular expression parsed </programlisting><programlisting>Any errors are embedded as <code>&lt;error&gt;</code>s </programlisting><para>Used by function <code><link linkend="function-regex">rgx:regex</link>()</code>.</para><para>Relies upon <code><link linkend="variable-close-group-symbols-regex">$close-group-symbols-regex</link></code>, <code><link linkend="variable-escapes-in-regex">$escapes-in-regex</link></code>, <code><link linkend="variable-open-group-symbols-regex">$open-group-symbols-regex</link></code>, <code><link linkend="function-process-regex-escape-u">rgx:process-regex-escape-u</link>()</code>.</para></section>
<section xml:id="function-process-regex-escape-u"><title><code>rgx:process-regex-escape-u()</code></title><para><emphasis>Option 1 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:process-regex-escape-u($val-inside-braces as xs:string) as xs:string?</code></para><programlisting>one-parameter version of fuller one, below </programlisting><para>Used by function <code><link linkend="function-process-regex-escape-u">rgx:process-regex-escape-u</link>()</code>, <code><link linkend="function-parse-regex">rgx:parse-regex</link>()</code>.</para><para>Relies upon <code><link linkend="function-process-regex-escape-u">rgx:process-regex-escape-u</link>()</code>.</para><para><emphasis>Option 2 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:process-regex-escape-u($val-inside-braces as xs:string, $version as xs:double) as xs:string?</code></para><programlisting>Input: a string that is inside the braces of a \u{} expression </programlisting><programlisting>Output: the expansion of the expression </programlisting><programlisting>Acceptable contents of \u{}: </programlisting><programlisting>1. Individual hex values or ranges of them, separated by a comma or space. Values will 
be replaced with entities </programlisting><programlisting>'4d-4f, 51' &gt; '&amp;#x4d;-&amp;#x4f;&amp;#x51;' </programlisting><programlisting>2. Composite signal: + followed by a string </programlisting><programlisting>'+b' &gt; 'bᵇḃḅḇ⒝ⓑ㍴㏔㏝ｂ𝐛𝑏𝒃𝒷𝓫𝔟𝕓𝖇𝖻𝗯𝘣𝙗𝚋' </programlisting><programlisting>3. Base signal: - followed by a string </programlisting><programlisting>'-ḉ' &gt; 'c' </programlisting><programlisting>4. name keywords: chains of . or ! each followed by a string </programlisting><programlisting>'.greek.capital.perispomeni' &gt; 'ἎἏἮἯἾἿὟὮὯᾎᾏᾞᾟᾮᾯ' .latin.cedilla - - &gt; 
'ÇçĢģĶķĻļŅņŖŗŞşŢţȨȩᷗḈḉḐḑḜḝḨḩ' .m!small - - &gt; 'MƜൔᒻᒼᒾᒿᛗᛘᛙᣘᧄᮿᰮᴹḾṀṂℳⓂⱮㄇ㎛㎡㎥㎧㎨㏁㏞㏟ꚳꟽꟿꩌＭ' </programlisting><para>Used by function <code><link linkend="function-process-regex-escape-u">rgx:process-regex-escape-u</link>()</code>, <code><link linkend="function-parse-regex">rgx:parse-regex</link>()</code>.</para><para>Relies upon <code><link linkend="variable-base-marker-regex">$base-marker-regex</link></code>, <code><link linkend="variable-characters-allowed-in-ucd-names-regex">$characters-allowed-in-ucd-names-regex</link></code>, <code><link linkend="variable-composite-marker-regex">$composite-marker-regex</link></code>, <code><link linkend="variable-name-marker-regex">$name-marker-regex</link></code>, <code><link linkend="variable-u-item-delimiter-regex">$u-item-delimiter-regex</link></code>, <code><link linkend="function-codepoints-to-string">rgx:codepoints-to-string</link>()</code>, <code><link linkend="function-get-chars-by-name">rgx:get-chars-by-name</link>()</code>, <code><link linkend="function-hex-to-dec">rgx:hex-to-dec</link>()</code>, <code><link linkend="function-string-base">rgx:string-base</link>()</code>, <code><link linkend="function-string-to-composites">rgx:string-to-composites</link>()</code>.</para></section>
<section xml:id="function-regex"><title><code>rgx:regex()</code></title><para><emphasis>Option 1 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:regex($regex as xs:string?) as xs:string?</code></para><programlisting>one-parameter version of the longer one, below </programlisting><para>Used by function <code><link linkend="function-regex">rgx:regex</link>()</code>, <code><link linkend="function-replace">rgx:replace</link>()</code>, <code><link linkend="function-matches">rgx:matches</link>()</code>, <code><link linkend="function-tokenize">rgx:tokenize</link>()</code>, <code><link linkend="function-analyze-string">rgx:analyze-string</link>()</code>.</para><para>Relies upon <code><link linkend="function-regex">rgx:regex</link>()</code>.</para><para><emphasis>Option 2 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:regex($regex as xs:string?, $version as xs:double) as xs:string?</code></para><programlisting>Input: string representing a regex pattern </programlisting><programlisting>Output: the regular expression adjusted according to TAN-regex rules </programlisting><para>Used by function <code><link linkend="function-regex">rgx:regex</link>()</code>, <code><link linkend="function-replace">rgx:replace</link>()</code>, <code><link linkend="function-matches">rgx:matches</link>()</code>, <code><link linkend="function-tokenize">rgx:tokenize</link>()</code>, <code><link linkend="function-analyze-string">rgx:analyze-string</link>()</code>.</para><para>Relies upon <code><link linkend="function-parse-regex">rgx:parse-regex</link>()</code>.</para></section>
<section xml:id="function-regex-is-valid"><title><code>rgx:regex-is-valid()</code></title><para><emphasis>regex-ext-tan-functions</emphasis></para><para><code>rgx:regex-is-valid($input-regex as xs:string?) as xs:boolean</code></para><programlisting>Input: a string </programlisting><programlisting>Output: true if the string is a valid regular expression, false otherwise </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-matches">rgx:matches</link>()</code>.</para></section>
<section xml:id="function-replace"><title><code>rgx:replace()</code></title><para><emphasis>Option 1 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:replace($input as xs:string?, $pattern as xs:string, $replacement as xs:string) as xs:string</code></para><programlisting>three-param function of the four-param version below </programlisting><para>Used by function <code><link linkend="function-replace">rgx:replace</link>()</code>.</para><para>Relies upon <code><link linkend="function-replace">rgx:replace</link>()</code>.</para><para><emphasis>Option 2 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:replace($input as xs:string?, $pattern as xs:string, $replacement as xs:string, $flags as xs:string) as xs:string</code></para><programlisting>Parallel to <code>fn:replace()</code>, but converts \u{} into classes. See <code><link linkend="function-regex">rgx:regex</link>()</code> for 
details. </programlisting><para>Used by function <code><link linkend="function-replace">rgx:replace</link>()</code>.</para><para>Relies upon <code><link linkend="function-parse-flags">rgx:parse-flags</link>()</code>, <code><link linkend="function-regex">rgx:regex</link>()</code>.</para></section>
<section xml:id="function-replace-by-char-name"><title><code>rgx:replace-by-char-name()</code></title><para><emphasis>Option 1 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:replace-by-char-name($string-to-replace as xs:string?, $words-in-name-to-drop as xs:string*, $words-in-replacement-char-name as xs:string*, $words-not-in-replacement-char-name as xs:string*, $search-is-strict as xs:boolean?) as xs:string?</code></para><programlisting>five-parameter version of the full function, below </programlisting><para>Used by function <code><link linkend="function-replace-by-char-name">rgx:replace-by-char-name</link>()</code>.</para><para>Relies upon <code><link linkend="function-replace-by-char-name">rgx:replace-by-char-name</link>()</code>.</para><para><emphasis>Option 2 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:replace-by-char-name($string-to-replace as xs:string?, $words-in-name-to-drop as xs:string*, $words-in-replacement-char-name as xs:string*, $words-not-in-replacement-char-name as xs:string*, $search-is-strict as xs:boolean?, $version as xs:double) as xs:string?</code></para><programlisting>five-parameter version of the full function, below </programlisting><para>Used by function <code><link linkend="function-replace-by-char-name">rgx:replace-by-char-name</link>()</code>.</para><para>Relies upon <code><link linkend="function-build-char-replacement-guide">rgx:build-char-replacement-guide</link>()</code>, <code><link linkend="function-replace-by-char-name">rgx:replace-by-char-name</link>()</code>.</para><para><emphasis>Option 3 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:replace-by-char-name($string-to-replace as xs:string?, $replace-guide as element(rgx:replace)) as xs:string?</code></para><programlisting>Input: a string to be changed; three sets of strings; a boolean </programlisting><programlisting>Output: the string with characters replaced according to the rules below </programlisting><programlisting>This function was written primarily to transform Greek letters, e.g., to change 
graves into acutes </programlisting><programlisting>The input string is broken into individual characters. Focus is placed on only those 
characters whose Unicode name has words matching <code>$words-in-name-to-drop.</code>. Other words in the 
first matching name are retained, and a search is made for any other Unicode character that 
has names specified by <code>$words-in-replacement-char-name</code> and does not have words 
specified by <code>$words-not-in-replacement-char-name.</code>. </programlisting><programlisting>If the boolean is false, then the search will return Unicode codepoints that might 
have other words in their name; otherwise the match must correspond to all words in the 
target name. </programlisting><programlisting>If the character does not have an entry in the <code>$replace-guide</code>, the original 
character is returned. </programlisting><programlisting>The process will be applied to a char against only the first name found, not aliases. </programlisting><programlisting>To use this function optimally, first bind the second parameter to a global 
variable, using <code><link linkend="function-build-char-replacement-guide">rgx:build-char-replacement-guide</link>()</code>, then use the 2-parameter version of 
this function. </programlisting><para>Used by function <code><link linkend="function-replace-by-char-name">rgx:replace-by-char-name</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-string-base"><title><code>rgx:string-base()</code></title><para><emphasis>Option 1 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:string-base($arg as xs:string?) as xs:string?</code></para><programlisting>one-param version of the fuller one, below </programlisting><para>Used by function <code><link linkend="function-string-base">rgx:string-base</link>()</code>, <code><link linkend="function-process-regex-escape-u">rgx:process-regex-escape-u</link>()</code>.</para><para>Relies upon <code><link linkend="function-string-base">rgx:string-base</link>()</code>.</para><para><emphasis>Option 2 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:string-base($arg as xs:string?, $version as xs:double) as xs:string?</code></para><programlisting>This function takes any string and replaces every character with its base Unicode 
character. This function is useful to prepare a text to be searched without respect to accents. 
E.g., ἄνθρωπός - &gt; ανθρωπος Note, the ς is retained because it doesn't decompose. To match 
on σ one needs to use the flag 'i' (case insensitive) because ς case-folds to σ. This 
function is similar to <code><link linkend="function-string-to-components">rgx:string-to-components</link>()</code>, but strictly enforces a one-for-one 
replacement, so that it behaves much like <code>fn:lower-case()</code> and <code>fn:upper-case()</code>, where the string 
length is always preserved. To this end, this function is based on <code>fn:translate()</code>, and uses 
simple decomposition databases, which are much smaller and quicker to use than are full 
decomposition databases. The strict one-for-one replacement observes the following rules: If a 
character decomposes to a single character, that single character is returned. If a character 
decomposes to multiple characters that are identical, that single character is returned, 
e.g., ‴ to ′ If a character decomposes to multiple characters, a distinction is made 
between base and non-base characters: - Base characters: 
\p{Lu}\p{Ll}\p{Lt}\p{Lo}\p{N}\p{S} - Non-base characters: \p{Lm}\p{M}\p{P}\p{Z}\p{C} If after non-base characters 
are removed there is not exactly one unique decomposed character left, the original 
input is retained. The above rules are already reflected in the contents of the simple 
decomposition database, so do not need to be expressed in this function. For more, see 
ucd/ucd-decomp.xsl. </programlisting><para>Used by function <code><link linkend="function-string-base">rgx:string-base</link>()</code>, <code><link linkend="function-process-regex-escape-u">rgx:process-regex-escape-u</link>()</code>.</para><para>Relies upon <code><link linkend="function-get-ucd-decomp-simple-db">rgx:get-ucd-decomp-simple-db</link>()</code>.</para></section>
<section xml:id="function-string-to-components"><title><code>rgx:string-to-components()</code></title><para><emphasis>Option 1 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:string-to-components($arg as xs:string?) as xs:string*</code></para><programlisting>one-param version of the fuller one, below </programlisting><para>Used by function <code><link linkend="function-string-to-components">rgx:string-to-components</link>()</code>.</para><para>Relies upon <code><link linkend="function-string-to-components">rgx:string-to-components</link>()</code>.</para><para><emphasis>Option 2 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:string-to-components($arg as xs:string?, $version as xs:double) as xs:string*</code></para><programlisting>Input: any string; a Unicode version number. </programlisting><programlisting>Output: one string per character in the input; if a character lends itself to 
decomposition, its component parts are returned, otherwise the character itself is returned. </programlisting><programlisting>This function is the inverse of <code><link linkend="function-string-to-composites">rgx:string-to-composites</link>()</code>. </programlisting><programlisting>If you wish to have more control over which components are returned (e.g., exclusion 
of combining marks), consider using either <code><link linkend="function-string-base">rgx:string-base</link>()</code> or the database 
directly: <code><link linkend="function-get-ucd-decomp-db">rgx:get-ucd-decomp-db</link>()</code>. The each rgx:char/rgx:b has <code>@gc</code> with the code for the 
component's general category </programlisting><para>Used by function <code><link linkend="function-string-to-components">rgx:string-to-components</link>()</code>.</para><para>Relies upon <code><link linkend="variable-default-ucd-decomp-db">$default-ucd-decomp-db</link></code>, <code><link linkend="function-get-ucd-decomp-db">rgx:get-ucd-decomp-db</link>()</code>.</para></section>
<section xml:id="function-string-to-composites"><title><code>rgx:string-to-composites()</code></title><para><emphasis>Option 1 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:string-to-composites($arg as xs:string?) as xs:string*</code></para><programlisting>one-parameter version of fuller one, below </programlisting><para>Used by function <code><link linkend="function-string-to-composites">rgx:string-to-composites</link>()</code>, <code><link linkend="function-process-regex-escape-u">rgx:process-regex-escape-u</link>()</code>.</para><para>Relies upon <code><link linkend="function-string-to-composites">rgx:string-to-composites</link>()</code>.</para><para><emphasis>Option 2 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:string-to-composites($arg as xs:string?, $version as xs:double) as xs:string*</code></para><programlisting>Input: a string; a version of Unicode (double) </programlisting><programlisting>Output: one string per character in the input; that string consists of the character 
itself followed by all characters that use it as a base </programlisting><programlisting>This function is the inverse of rgx:string-to-components. E.g., 'Max' - &gt; 
'MᴹḾṀṂℳⅯⓂ㎆㎒㎫㎹㎿㏁Ｍ𝐌𝑀𝑴𝓜𝔐𝕄𝕸𝖬𝗠𝘔𝙈𝙼🄼🅋🅪🅫aªàáâãäåāăąǎǟǡǻȁȃȧᵃḁẚạảấầẩẫậắằẳẵặₐ℀℁ⓐ㏂ａ𝐚𝑎𝒂𝒶𝓪𝔞𝕒𝖆𝖺𝗮𝘢𝙖𝚊xˣẋẍₓⅹⅺⅻⓧｘ𝐱𝑥𝒙𝓍𝔁𝔵𝕩𝖝𝗑𝘅𝘹𝙭𝚡' 
This is useful for preparing regex character classes to broaden a search. </programlisting><para>Used by function <code><link linkend="function-string-to-composites">rgx:string-to-composites</link>()</code>, <code><link linkend="function-process-regex-escape-u">rgx:process-regex-escape-u</link>()</code>.</para><para>Relies upon <code><link linkend="variable-default-ucd-decomp-db">$default-ucd-decomp-db</link></code>, <code><link linkend="function-get-ucd-decomp-db">rgx:get-ucd-decomp-db</link>()</code>.</para></section>
<section xml:id="function-tokenize"><title><code>rgx:tokenize()</code></title><para><emphasis>Option 1 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:tokenize($input as xs:string?, $pattern as xs:string) as xs:string*</code></para><programlisting>two-param function of the three-param version below </programlisting><para>Used by function <code><link linkend="function-tokenize">rgx:tokenize</link>()</code>.</para><para>Relies upon <code><link linkend="function-tokenize">rgx:tokenize</link>()</code>.</para><para><emphasis>Option 2 (regex-ext-tan-functions)</emphasis></para><para><code>rgx:tokenize($input as xs:string?, $pattern as xs:string, $flags as xs:string) as xs:string*</code></para><programlisting>Parallel to <code>fn:tokenize()</code>, but converts \u{} into classes. See <code><link linkend="function-regex">rgx:regex</link>()</code> for 
details. </programlisting><para>Used by function <code><link linkend="function-tokenize">rgx:tokenize</link>()</code>.</para><para>Relies upon <code><link linkend="function-parse-flags">rgx:parse-flags</link>()</code>, <code><link linkend="function-regex">rgx:regex</link>()</code>.</para></section>
</section>
</section>
<section xml:id="vkft-TAN-class-1"><title>TAN-class-1 global variables, keys, and functions summarized</title><section><title>Variables</title><section xml:id="variable-model-1st-da"><title><code>$model-1st-da</code></title><para><emphasis>TAN-class-1-functions</emphasis></para><para>Definition: <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>(<link linkend="variable-head">$head</link>/tan:model[1])</code></para><para>Used by variable <code><link linkend="variable-model-resolved">$model-resolved</link></code>.</para><para>Relies upon <code><link linkend="variable-head">$head</link></code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>.</para></section>
<section xml:id="variable-model-resolved"><title><code>$model-resolved</code></title><para><emphasis>TAN-class-1-functions</emphasis></para><para>Definition: <code><link linkend="function-resolve-doc">tan:resolve-doc</link>(<link linkend="variable-model-1st-da">$model-1st-da</link>, false(), <link linkend="function-attr">tan:attr</link>('relationship', 'model'))</code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code>, <code><link linkend="template-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</link></code>.</para><para>Relies upon <code><link linkend="variable-model-1st-da">$model-1st-da</link></code>, <code><link linkend="function-attr">tan:attr</link>()</code>, <code><link linkend="function-resolve-doc">tan:resolve-doc</link>()</code>.</para></section>
<section xml:id="variable-redivisions-1st-da"><title><code>$redivisions-1st-da</code></title><para><emphasis>TAN-class-1-functions</emphasis></para><para>Definition: <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>(<link linkend="variable-head">$head</link>/tan:redivision)</code></para><para>Used by variable <code><link linkend="variable-redivisions-resolved">$redivisions-resolved</link></code>.</para><para>Relies upon <code><link linkend="variable-head">$head</link></code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>.</para></section>
<section xml:id="variable-redivisions-resolved"><title><code>$redivisions-resolved</code></title><para><emphasis>TAN-class-1-functions</emphasis></para><para>Definition: <code>          for $i in <link linkend="variable-redivisions-1st-da">$redivisions-1st-da</link>          return             <link linkend="function-resolve-doc">tan:resolve-doc</link>($i, false(), <link linkend="function-attr">tan:attr</link>('relationship', 'redivision'))</code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code>, <code><link linkend="template-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</link></code>.</para><para>Relies upon <code><link linkend="variable-redivisions-1st-da">$redivisions-1st-da</link></code>, <code><link linkend="function-attr">tan:attr</link>()</code>, <code><link linkend="function-resolve-doc">tan:resolve-doc</link>()</code>.</para></section>
<section xml:id="variable-special-end-div-chars"><title><code>$special-end-div-chars</code></title><para><emphasis>TAN-class-1-functions</emphasis></para><para>Definition: <code>(<link linkend="variable-zwj">$zwj</link>, <link linkend="variable-dhy">$dhy</link>, <link linkend="variable-zwsp">$zwsp</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 template <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code>, <code><link linkend="template-tokenize-div">ŧ tokenize-div</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-dhy">$dhy</link></code>, <code><link linkend="variable-zwj">$zwj</link></code>, <code><link linkend="variable-zwsp">$zwsp</link></code>.</para></section>
<section xml:id="variable-special-end-div-chars-regex"><title><code>$special-end-div-chars-regex</code></title><para><emphasis>TAN-class-1-functions</emphasis></para><para>Definition: <code>concat('\s*[', string-join(<link linkend="variable-special-end-div-chars">$special-end-div-chars</link>, ''), ']\s*$')</code></para><para>Used by template <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code>, <code><link linkend="template-tokenize-div">ŧ tokenize-div</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>
<section><title>Keys</title><section xml:id="key-div-via-ref"><title><code>ʞ div-via-ref</code></title><para><emphasis>TAN-class-1-functions</emphasis></para><para>Looks for elements matching <code>tan:div</code></para><para>Used by template <code><link linkend="template-class-1-expansion-verbose-pass-2">ŧ class-1-expansion-verbose-pass-2</link></code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="key-divs-to-reset"><title><code>ʞ divs-to-reset</code></title><para><emphasis>TAN-class-1-functions</emphasis></para><para>Looks for elements matching <code>tan:div</code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="key-tok-via-val"><title><code>ʞ tok-via-val</code></title><para><emphasis>TAN-class-1-functions</emphasis></para><para>Looks for elements matching <code>tan:tok</code></para><para>Used by template <code><link linkend="template-mark-dependencies-pass-2-for-validation">ŧ mark-dependencies-pass-2-for-validation</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><emphasis>TAN-class-1-functions</emphasis></para><para><code>tan:analyze-leaf-div-string-length($document-fragment as item()*) as item()*</code></para><programlisting>Input: any class 1 document fragment, or result of <code><link linkend="function-diff">tan:diff</link>()</code> </programlisting><programlisting>Output: Every leaf div or common/a/b 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. </programlisting><programlisting>This function is useful for statistical processing, and for comparing a <code>TAN-T(</code>EI) 
file against a redivision. </programlisting><programlisting>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. </programlisting><programlisting>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 </programlisting><para>Used by template <code><link linkend="template-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-pass-1</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><emphasis>TAN-class-1-functions</emphasis></para><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><programlisting>Loop function for the master one, above. </programlisting><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-normalize-div-text">tan:normalize-div-text</link>()</code>, <code><link linkend="function-string-length">tan:string-length</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><programlisting>One-parameter function of the two-parameter version below </programlisting><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><programlisting>Input: any class-1 document or fragment (or a result of <code><link linkend="function-diff">tan:diff</link>()</code>); an indication 
whether string lengths should be added only to leaf divs, or to every div. </programlisting><programlisting>Output: the same document, with <code>@string-length</code> and <code>@string-pos</code> added to every 
element </programlisting><programlisting>Function to calculate string lengths of each leaf elements and their relative 
position, so that a raw text can be segmented proportionately 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 terminates a <code><link linkend="element-div">&lt;div&gt;</link></code> not only will not be 
counted, but the assumed space that follows will also not be counted. On the other hand, the 
lack of a special character at the end means that the nominal space that follows a div will 
be included in both the length and the position. Thus input... &lt;div type="m" 
n="1"&gt;abc&amp;#xad;&lt;/div&gt; &lt;div type="m" n="2"&gt;def&amp;#x200d;&lt;/div&gt; &lt;div type="m" n="3"&gt;ghi&lt;/div&gt; &lt;div 
type="m" n="4"&gt;xyz&lt;/div&gt; ...presumes a raw joined text of "abcdefghi xyz ", and so becomes 
output: &lt;div type="m" n="1" string-length="3" string-pos="1"&gt;abc&amp;#xad;&lt;/div&gt; &lt;div 
type="m" n="2" string-length="3" string-pos="4"&gt;def&amp;#x200d;&lt;/div&gt; &lt;div type="m" n="3" 
string-length="4" string-pos="7"&gt;ghi&lt;/div&gt; &lt;div type="m" n="4" string-length="4" 
string-pos="11"&gt;xyz&lt;/div&gt; </programlisting><programlisting>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 </programlisting><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><emphasis>Option 1 (TAN-class-1-functions)</emphasis></para><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><programlisting>Two-parameter version of the fuller one, below </programlisting><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="function-div-to-div-transfer">tan:div-to-div-transfer</link>()</code>.</para><para><emphasis>Option 2 (TAN-class-1-functions)</emphasis></para><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()*, $break-at-regex as xs:string) as item()*</code></para><programlisting>Input: (1) any set of divs with content to be transferred into the structure of (2) 
another set of divs; and (3) a snap marker. </programlisting><programlisting>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. </programlisting><programlisting>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. </programlisting><programlisting>The raw text will be tokenized based on the third parameter, so that, if you so wish, 
words, clauses, or sentences are not broken up. </programlisting><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="function-infuse-divs">tan:infuse-divs</link>()</code>, <code><link linkend="function-text-join">tan:text-join</link>()</code>.</para></section>
<section xml:id="function-group-divs"><title><code>tan:group-divs()</code></title><para><emphasis>TAN-class-1-functions</emphasis></para><para><code>tan:group-divs($divs-to-group as element()*) as element()*</code></para><programlisting>Input: expanded <code><link linkend="element-div">&lt;div&gt;</link></code>s </programlisting><programlisting>Output: those <code><link linkend="element-div">&lt;div&gt;</link></code>s grouped in <code><link linkend="element-group">&lt;group&gt;</link></code>s according to their <code>&lt;ref&gt;</code> values </programlisting><programlisting>Attempt is made to preserve original div order </programlisting><para>Used by template <code><link linkend="template-merge-divs">ŧ merge-divs</link></code>.</para><para>Used by function <code><link linkend="function-group-divs">tan:group-divs</link>()</code>.</para><para>Relies upon <code><link linkend="function-collate-sequences">tan:collate-sequences</link>()</code>, <code><link linkend="function-group-divs">tan:group-divs</link>()</code>, <code><link linkend="function-group-elements-by-shared-node-values">tan:group-elements-by-shared-node-values</link>()</code>.</para></section>
<section xml:id="function-imprint-adjustment-locator"><title><code>tan:imprint-adjustment-locator()</code></title><para><emphasis>Option 1 (TAN-class-1-functions)</emphasis></para><para><code>tan:imprint-adjustment-locator($adjustment-action-locators as element()*) as element()*</code></para><programlisting>one-parameter version of the full one below </programlisting><para>Used by template <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code>, <code><link linkend="template-dependency-adjustments-pass-2">ŧ dependency-adjustments-pass-2</link></code>, <code><link linkend="template-mark-reassigns">ŧ mark-reassigns</link></code>.</para><para>Used by function <code><link linkend="function-imprint-adjustment-locator">tan:imprint-adjustment-locator</link>()</code>.</para><para>Relies upon <code><link linkend="function-imprint-adjustment-locator">tan:imprint-adjustment-locator</link>()</code>.</para><para><emphasis>Option 2 (TAN-class-1-functions)</emphasis></para><para><code>tan:imprint-adjustment-locator($adjustment-action-locators as element()*, $errors-to-report as element()*) as element()*</code></para><programlisting>Input: any locator from an adjustment action (ref, n, div-type, from-tok, 
through-tok); any errors to report </programlisting><programlisting>Output: the locator wrapped in its ancestral element and wrapping any errors </programlisting><programlisting>This function is used to mark class 1 files with a record of locators in class 2 
adjustments </programlisting><para>Used by template <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code>, <code><link linkend="template-dependency-adjustments-pass-2">ŧ dependency-adjustments-pass-2</link></code>, <code><link linkend="template-mark-reassigns">ŧ mark-reassigns</link></code>.</para><para>Used by function <code><link linkend="function-imprint-adjustment-locator">tan:imprint-adjustment-locator</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-infuse-divs"><title><code>tan:infuse-divs()</code></title><para><emphasis>TAN-class-1-functions</emphasis></para><para><code>tan:infuse-divs($new-content-to-be-transferred as xs:string?, $items-whose-divs-should-be-infused-with-new-content as item()*, $break-at-regex as xs:string) as item()*</code></para><programlisting>Input: a string; an XML fragment that has <code><link linkend="element-div">&lt;div&gt;</link></code>s </programlisting><programlisting>Output: the latter, infused with the former, infusing text proportionate to the 
quantity of <code><link linkend="element-div">&lt;div&gt;</link></code> text being replaced </programlisting><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="function-chop-string">tan:chop-string</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="template-infuse-tokenized-div-end-check">ŧ infuse-tokenized-div-end-check</link></code>, <code><link linkend="template-infuse-tokenized-text">ŧ infuse-tokenized-text</link></code>, <code><link linkend="template-infuse-tokenized-text-cleanup">ŧ infuse-tokenized-text-cleanup</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><programlisting>See fuller version below </programlisting><para>Used by function <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><programlisting>See fuller version below </programlisting><para>Used by function <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><programlisting>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 </programlisting><programlisting>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 </programlisting><programlisting>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 </programlisting><programlisting>For merging multiple files normally the value should be true; if they are misfits 
from a single source, false </programlisting><para>Used by function <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><emphasis>Option 1 (TAN-class-1-functions)</emphasis></para><para><code>tan:normalize-div-text($single-leaf-div-text-nodes as xs:string*) as xs:string*</code></para><programlisting>One-parameter version of the fuller one, below. </programlisting><para>Used by template <code><link linkend="template-tokenize-div">ŧ tokenize-div</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code>, <code><link linkend="template-text-join">ŧ text-join</link></code>.</para><para>Used by function <code><link linkend="function-normalize-div-text">tan:normalize-div-text</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-normalize-div-text">tan:normalize-div-text</link>()</code>.</para><para><emphasis>Option 2 (TAN-class-1-functions)</emphasis></para><para><code>tan:normalize-div-text($single-leaf-div-text-nodes as xs:string*, $remove-special-div-end-chars as xs:boolean) as xs:string*</code></para><programlisting>Input: any sequence of strings, presumed to be text nodes of a single leaf div; a 
boolean indicating whether special div-end characters should be retained or not </programlisting><programlisting>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. </programlisting><programlisting>This function is designed specifically for TAN's commitment to nonmixed content. 
That is, every TAN element contains either elements or non-space text but not both, which 
also means that space-only text nodes are effectively ignored. It is assumed that every 
TAN element is followed by a notional space. </programlisting><programlisting>The second parameter is important, because output will be used to normalize and 
repopulate leaf <code><link linkend="element-div">&lt;div&gt;</link></code>s (where special div-end characters should be retained) or to 
concatenate leaf <code><link linkend="element-div">&lt;div&gt;</link></code> text (where those characters should be deleted) </programlisting><para>Used by template <code><link linkend="template-tokenize-div">ŧ tokenize-div</link></code>, <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code>, <code><link linkend="template-text-join">ŧ text-join</link></code>.</para><para>Used by function <code><link linkend="function-normalize-div-text">tan:normalize-div-text</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="variable-special-end-div-chars-regex">$special-end-div-chars-regex</link></code>, <code><link linkend="function-normalize-div-text">tan:normalize-div-text</link>()</code>.</para></section>
<section xml:id="function-reset-hierarchy-loop"><title><code>tan:reset-hierarchy-loop()</code></title><para><emphasis>TAN-class-1-functions</emphasis></para><para><code>tan:reset-hierarchy-loop($divs-to-process as element()*, $divs-to-integrate as element()*, $level-of-interest as xs:integer) as element()*</code></para><programlisting>Input: <code><link linkend="element-div">&lt;div&gt;</link></code>s to process; <code><link linkend="element-div">&lt;div&gt;</link></code>s to merge </programlisting><programlisting>Output: any <code><link linkend="element-div">&lt;div&gt;</link></code>s in the first group with <code><link linkend="element-div">&lt;div&gt;</link></code>s in the second group that should be 
merged or passed to children will be passed through template mode reset-hierarchy; all 
others will be copied in place </programlisting><programlisting>We presume that only the first tan:ref is the one to match against </programlisting><para>Used by template <code><link linkend="template-reset-hierarchy">ŧ reset-hierarchy</link></code>.</para><para>Used by function <code><link linkend="function-reset-hierarchy-loop">tan:reset-hierarchy-loop</link>()</code>.</para><para>Relies upon <code><link linkend="function-reset-hierarchy-loop">tan:reset-hierarchy-loop</link>()</code>, <code><link linkend="template-reset-hierarchy">ŧ reset-hierarchy</link></code>, <code><link linkend="template-strip-divs-to-reset">ŧ strip-divs-to-reset</link></code>.</para></section>
<section xml:id="function-text-join"><title><code>tan:text-join()</code></title><para><emphasis>TAN-class-1-functions</emphasis></para><para><code>tan:text-join($items as item()*) as xs:string?</code></para><programlisting>Input: any document fragment of a TAN class 1 body, whether raw or resolved </programlisting><programlisting>Output: a single string that joins and normalizes the leaf div text according to TAN 
rules </programlisting><programlisting>All special leaf-div-end characters will be stripped including the last </programlisting><programlisting>Do not apply this template to class-1 files that have been expanded, because 
normalization will have already occurred. </programlisting><para>Used by template <code><link linkend="template-text-join">ŧ text-join</link></code>, <code><link linkend="template-analyze-string-length-pass-1">ŧ analyze-string-length-pass-1</link></code>, <code><link linkend="template-merge-divs">ŧ merge-divs</link></code>, <code><link linkend="template-class-1-expansion-verbose-pass-1">ŧ class-1-expansion-verbose-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><emphasis>TAN-class-1-functions</emphasis></para><para><code>tan:tokenize-div($input as item()*, $token-definitions as element(tan:token-definition)) as item()*</code></para><programlisting>Input: any items, a <code><link linkend="element-token-definition">&lt;token-definition&gt;</link></code> </programlisting><programlisting>Output: the items with <code><link linkend="element-div">&lt;div&gt;</link></code>s in tokenized form </programlisting><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 xml:id="vkft-TAN-class-2"><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><emphasis>TAN-class-2-functions</emphasis></para><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>.</para><para>Relies upon <code><link linkend="variable-head">$head</link></code>.</para></section>
</section>
</section>
<section xml:id="vkft-TAN-A"><title>TAN-A global variables, keys, and functions summarized</title><section><title>Variables</title><section xml:id="variable-datatypes-that-require-unit-specification"><title><code>$datatypes-that-require-unit-specification</code></title><para><emphasis>TAN-A-functions</emphasis></para><para>Definition: <code>('decimal', 'float', 'double', 'integer', 'nonPositiveInteger', 'negativeInteger', 'long', 'nonNegativeInteger', 'positiveInteger')</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-objects-target-what-elements-names"><title><code>$objects-target-what-elements-names</code></title><para><emphasis>TAN-A-functions</emphasis></para><para>Definition: <code><link linkend="variable-id-idrefs">$id-idrefs</link>/tan:id-idrefs/tan:id[tan:idrefs[@attribute = 'object']]/tan:element</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-id-idrefs">$id-idrefs</link></code>.</para></section>
<section xml:id="variable-subjects-target-what-elements-names"><title><code>$subjects-target-what-elements-names</code></title><para><emphasis>TAN-A-functions</emphasis></para><para>Definition: <code><link linkend="variable-id-idrefs">$id-idrefs</link>/tan:id-idrefs/tan:id[tan:idrefs[@attribute = 'subject']]/tan:element</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-id-idrefs">$id-idrefs</link></code>.</para></section>
</section>
<section><title>Functions</title><section xml:id="function-data-type-check"><title><code>tan:data-type-check()</code></title><para><emphasis>TAN-A-functions</emphasis></para><para><code>tan:data-type-check($item as item()?, $data-type as xs:string) as xs:boolean</code></para><programlisting>Input: an item and a string naming a data type </programlisting><programlisting>Output: a boolean indicating whether the item can be cast into that data type </programlisting><programlisting>If the first parameter doesn't match a data type, the function returns false </programlisting><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 xml:id="vkft-TAN-extra"><title>TAN-extra global variables, keys, and functions summarized</title><section><title>Variables</title><section xml:id="variable-annotations-1st-da"><title><code>$annotations-1st-da</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para>Definition: <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>(<link linkend="variable-head">$head</link>/tan:annotation)</code></para><para>Used by variable <code><link linkend="variable-annotations-resolved">$annotations-resolved</link></code>.</para><para>Relies upon <code><link linkend="variable-head">$head</link></code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>.</para></section>
<section xml:id="variable-annotations-resolved"><title><code>$annotations-resolved</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para>Definition: <code><link linkend="function-resolve-doc">tan:resolve-doc</link>(<link linkend="variable-annotations-1st-da">$annotations-1st-da</link>, false(), <link linkend="function-attr">tan:attr</link>('relationship', 'annotation'))</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-annotations-1st-da">$annotations-1st-da</link></code>, <code><link linkend="function-attr">tan:attr</link>()</code>, <code><link linkend="function-resolve-doc">tan:resolve-doc</link>()</code>.</para></section>
<section xml:id="variable-applications-collection"><title><code>$applications-collection</code></title><para><emphasis>TAN-extra-functions</emphasis></para><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-applications-uri-collection">$applications-uri-collection</link></code>.</para></section>
<section xml:id="variable-applications-uri-collection"><title><code>$applications-uri-collection</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para>Definition: <code>uri-collection('../applications/catalog.xml?on-error=ignore')</code></para><para>Used by variable <code><link linkend="variable-applications-collection">$applications-collection</link></code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-doc-filename"><title><code>$doc-filename</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para>Definition: <code><link linkend="function-cfne">tan:cfne</link>(/)</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="function-cfne">tan:cfne</link>()</code>.</para></section>
<section xml:id="variable-doc-history"><title><code>$doc-history</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para>Definition: <code><link linkend="function-get-doc-history">tan:get-doc-history</link>(<link linkend="variable-orig-self">$orig-self</link>)</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-orig-self">$orig-self</link></code>, <code><link linkend="function-get-doc-history">tan:get-doc-history</link>()</code>.</para></section>
<section xml:id="variable-english-articles"><title><code>$english-articles</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para>Definition: <code>('a', 'the')</code></para><para>Used by function <code><link linkend="function-title-case">tan:title-case</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-english-prepositions"><title><code>$english-prepositions</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para>Definition: <code>('aboard', 'about', 'above', 'across', 'after', 'against', 'along', 'amid', 'among', 'anti', 'around', 'as', 'at', 'before', 'behind', 'below', 'beneath', 'beside', 'besides', 'between', 'beyond', 'but', 'by', 'concerning', 'considering', 'despite', 'down', 'during', 'except', 'excepting', 'excluding', 'following', 'for', 'from', 'in', 'inside', 'into', 'like', 'minus', 'near', 'of', 'off', 'on', 'onto', 'opposite', 'outside', 'over', 'past', 'per', 'plus', 'regarding', 'round', 'save', 'since', 'than', 'through', 'to', 'toward', 'towards', 'under', 'underneath', 'unlike', 'until', 'up', 'upon', 'versus', 'via', 'with', 'within', 'without')</code></para><para>Used by function <code><link linkend="function-title-case">tan:title-case</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-error-markers"><title><code>$error-markers</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para>Definition: <code><link linkend="variable-error-tests">$error-tests</link>//comment()[matches(., '\w\w\w\d\d')]</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-error-tests">$error-tests</link></code>.</para></section>
<section xml:id="variable-error-tests"><title><code>$error-tests</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para>Definition: <code>collection('errors/?select=error-test-*.xml')</code></para><para>Used by variable <code><link linkend="variable-error-markers">$error-markers</link></code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-local-TAN-collection"><title><code>$local-TAN-collection</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para>Definition: <code>collection(concat(resolve-uri('catalog.tan.xml', <link linkend="variable-doc-uri">$doc-uri</link>), '?on-error=warning'))</code></para><para>Used by variable <code><link linkend="variable-local-TAN-voc-collection">$local-TAN-voc-collection</link></code>.</para><para>Relies upon <code><link linkend="variable-doc-uri">$doc-uri</link></code>.</para></section>
<section xml:id="variable-local-TAN-voc-collection"><title><code>$local-TAN-voc-collection</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para>Definition: <code><link linkend="variable-local-TAN-collection">$local-TAN-collection</link>[name(*) = 'TAN-voc']</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-local-TAN-collection">$local-TAN-collection</link></code>.</para></section>
<section xml:id="variable-morphologies-expanded"><title><code>$morphologies-expanded</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para>Definition: <code><link linkend="function-expand-doc">tan:expand-doc</link>(<link linkend="variable-morphologies-resolved">$morphologies-resolved</link>, 'terse', false())</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-morphologies-resolved">$morphologies-resolved</link></code>, <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>.</para></section>
<section xml:id="variable-most-common-indentations"><title><code>$most-common-indentations</code></title><para><emphasis>TAN-extra-functions</emphasis></para><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-most-common-item">tan:most-common-item</link>()</code>.</para></section>
<section xml:id="variable-namespaces-and-prefixes"><title><code>$namespaces-and-prefixes</code></title><para><emphasis>TAN-extra-functions</emphasis></para><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-orig-self-validated"><title><code>$orig-self-validated</code></title><para><emphasis>TAN-extra-functions</emphasis></para><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-orig-self">$orig-self</link></code>, <code><link linkend="template-imitate-validation">ŧ imitate-validation</link></code>.</para></section>
<section xml:id="variable-predecessors-1st-da"><title><code>$predecessors-1st-da</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para>Definition: <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>(<link linkend="variable-head">$head</link>/tan:predecessor)</code></para><para>Used by variable <code><link linkend="variable-predecessors-resolved">$predecessors-resolved</link></code>.</para><para>Relies upon <code><link linkend="variable-head">$head</link></code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>.</para></section>
<section xml:id="variable-predecessors-resolved"><title><code>$predecessors-resolved</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para>Definition: <code><link linkend="function-resolve-doc">tan:resolve-doc</link>(<link linkend="variable-predecessors-1st-da">$predecessors-1st-da</link>, false(), <link linkend="function-attr">tan:attr</link>('relationship', 'predecessor'))</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-predecessors-1st-da">$predecessors-1st-da</link></code>, <code><link linkend="function-attr">tan:attr</link>()</code>, <code><link linkend="function-resolve-doc">tan:resolve-doc</link>()</code>.</para></section>
<section xml:id="variable-see-alsos-1st-da"><title><code>$see-alsos-1st-da</code></title><para><emphasis>TAN-extra-functions</emphasis></para><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="variable-head">$head</link></code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>.</para></section>
<section xml:id="variable-see-alsos-resolved"><title><code>$see-alsos-resolved</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para>Definition: <code><link linkend="function-resolve-doc">tan:resolve-doc</link>(<link linkend="variable-see-alsos-1st-da">$see-alsos-1st-da</link>, false(), <link linkend="function-attr">tan:attr</link>('relationship', 'see-also'))</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-see-alsos-1st-da">$see-alsos-1st-da</link></code>, <code><link linkend="function-attr">tan:attr</link>()</code>, <code><link linkend="function-resolve-doc">tan:resolve-doc</link>()</code>.</para></section>
<section xml:id="variable-successors-1st-da"><title><code>$successors-1st-da</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para>Definition: <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>(<link linkend="variable-head">$head</link>/tan:successor)</code></para><para>Used by variable <code><link linkend="variable-successors-resolved">$successors-resolved</link></code>.</para><para>Relies upon <code><link linkend="variable-head">$head</link></code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>.</para></section>
<section xml:id="variable-successors-resolved"><title><code>$successors-resolved</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para>Definition: <code><link linkend="function-resolve-doc">tan:resolve-doc</link>(<link linkend="variable-successors-1st-da">$successors-1st-da</link>, false(), <link linkend="function-attr">tan:attr</link>('relationship', 'successor'))</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-successors-1st-da">$successors-1st-da</link></code>, <code><link linkend="function-attr">tan:attr</link>()</code>, <code><link linkend="function-resolve-doc">tan:resolve-doc</link>()</code>.</para></section>
<section xml:id="variable-today-iso"><title><code>$today-iso</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para>Definition: <code>format-date(current-date(), '[Y0001]-[M01]-[D01]')</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-url-regex"><title><code>$url-regex</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para>Definition: <code>\S+\.\w+</code></para><para>Used by function <code><link linkend="function-parse-urls">tan:parse-urls</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><emphasis>TAN-extra-functions</emphasis></para><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>Keys</title><section xml:id="key-get-ana"><title><code>ʞ get-ana</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para>Looks for elements matching <code>tan:ana</code></para><para>Used by function <code><link linkend="function-lm-data">tan:lm-data</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-acronym"><title><code>tan:acronym()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:acronym($string-input as xs:string*) as xs:string?</code></para><programlisting>Input: any strings </programlisting><programlisting>Output: the acronym of those strings (initial letters joined without spaces) </programlisting><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-add-attribute"><title><code>tan:add-attribute()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:add-attribute($elements-to-change as element()*, $attribute-name as xs:string?, $attribute-value as item()?) as element()*</code></para><programlisting>Input: elements; a string and a value </programlisting><programlisting>Output: Each element with an attribute given the name of the string and a value of the 
value </programlisting><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-analyze-stats"><title><code>tan:analyze-stats()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:analyze-stats($arg as xs:anyAtomicType*) as element()?</code></para><programlisting>Input: a sequence of numbers </programlisting><programlisting>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 </programlisting><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-base64-to-bin"><title><code>tan:base64-to-bin()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:base64-to-bin($base64 as xs:base64Binary?) as xs:string?</code></para><programlisting>Input: a base64 datum </programlisting><programlisting>Output: a string representing the datum in binary code </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-base64-to-dec">tan:base64-to-dec</link>()</code>, <code><link linkend="function-dec-to-bin">tan:dec-to-bin</link>()</code>.</para></section>
<section xml:id="function-base64-to-dec"><title><code>tan:base64-to-dec()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:base64-to-dec($base64 as xs:base64Binary?) as xs:integer?</code></para><programlisting>Input: a base64 datum </programlisting><programlisting>Output: an integer representing the base-10 value of the input </programlisting><para>Used by function <code><link linkend="function-base64-to-bin">tan:base64-to-bin</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-batch-replace-advanced"><title><code>tan:batch-replace-advanced()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:batch-replace-advanced($string as xs:string?, $replace-elements as element()*) as item()*</code></para><programlisting>Input: a string; a sequence of elements &lt;[ANY NAME] pattern="" [flags=""]&gt;[ANY 
CONTENT]&lt;/[ANY NAME]&gt; </programlisting><programlisting>Output: a sequence of items, with instances of <code><link linkend="attribute-pattern">@pattern</link></code> replaced by the content of 
the elements </programlisting><programlisting>This is a more advanced form of <code><link linkend="function-batch-replace">tan:batch-replace</link>()</code>, in that it allows text to be 
replaced by elements. </programlisting><programlisting>The function was devised to convert raw text into TAN-T. Textual references can be 
turned into &lt;div n=""/&gt; anchors, and the result can then be changed into a traditional 
hierarchy. </programlisting><para>Used by function <code><link linkend="function-batch-replace-advanced">tan:batch-replace-advanced</link>()</code>.</para><para>Relies upon <code><link linkend="function-batch-replace-advanced">tan:batch-replace-advanced</link>()</code>, <code><link linkend="template-batch-replace-advanced">ŧ batch-replace-advanced</link></code>.</para></section>
<section xml:id="function-blend-alpha-value"><title><code>tan:blend-alpha-value()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:blend-alpha-value($alpha-a as xs:double, $alpha-b as xs:double, $blend-mid-point as xs:double) as xs:double?</code></para><programlisting>Input: three doubles between zero and 1 </programlisting><programlisting>Output: the blend of the first two doubles, interpreted as alpha values and the third 
interpreted as a midpoint </programlisting><para>Used by function <code><link linkend="function-blend-colors">tan:blend-colors</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-blend-color-channel-value"><title><code>tan:blend-color-channel-value()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:blend-color-channel-value($color-a as xs:double, $color-b as xs:double, $blend-mid-point as xs:double) as xs:double?</code></para><programlisting>Input: two integers and a double between zero and 1 </programlisting><programlisting>Output: a double representing a blend between the first two numbers, interpreted as 
RGB values </programlisting><para>Used by function <code><link linkend="function-blend-color-channel-value">tan:blend-color-channel-value</link>()</code>, <code><link linkend="function-blend-colors">tan:blend-colors</link>()</code>.</para><para>Relies upon <code><link linkend="function-blend-color-channel-value">tan:blend-color-channel-value</link>()</code>.</para></section>
<section xml:id="function-blend-colors"><title><code>tan:blend-colors()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:blend-colors($rgb-color-1 as item()+, $rgb-color-2 as item()+, $blend-mid-point as xs:double) as xs:double*</code></para><programlisting>Input: two sequences of doubles (the first three items being from 0 through 255 and 
the fourth and last between 0 and 1); a double between zero and 1 </programlisting><programlisting>Output: a sequence of doubles representing a blend of the first two sequences, 
interpreted as RGB colors, and the last double as a desired midpoint </programlisting><para>Used by function <code><link linkend="function-blend-colors">tan:blend-colors</link>()</code>.</para><para>Relies upon <code><link linkend="function-blend-alpha-value">tan:blend-alpha-value</link>()</code>, <code><link linkend="function-blend-color-channel-value">tan:blend-color-channel-value</link>()</code>, <code><link linkend="function-blend-colors">tan:blend-colors</link>()</code>.</para></section>
<section xml:id="function-commas-and-ands"><title><code>tan:commas-and-ands()</code></title><para><emphasis>Option 1 (TAN-extra-functions)</emphasis></para><para><code>tan:commas-and-ands($input-strings as xs:string*) as xs:string?</code></para><programlisting>One-parameter version of the full one below </programlisting><para>Used by function <code><link linkend="function-commas-and-ands">tan:commas-and-ands</link>()</code>.</para><para>Relies upon <code><link linkend="function-commas-and-ands">tan:commas-and-ands</link>()</code>.</para><para><emphasis>Option 2 (TAN-extra-functions)</emphasis></para><para><code>tan:commas-and-ands($input-strings as xs:string*, $oxford-comma as xs:boolean) as xs:string?</code></para><programlisting>Input: sequences of strings </programlisting><programlisting>Output: the strings joined together with , and 'and' </programlisting><para>Used by function <code><link linkend="function-commas-and-ands">tan:commas-and-ands</link>()</code>.</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><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:counts-to-lasts($seq as xs:integer*) as xs:integer*</code></para><programlisting>Input: sequence of numbers representing counts of items. Output: sequence of 
numbers representing the last position of each item within the total count. E.g., (4, 12, 0, 
7) - &gt; (4, 16, 16, 23) </programlisting><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-dec-to-bin"><title><code>tan:dec-to-bin()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:dec-to-bin($in as xs:integer?) as xs:string?</code></para><programlisting>Input: a decimal </programlisting><programlisting>Output: the number in binary, represented as a string </programlisting><para>Used by function <code><link linkend="function-base64-to-bin">tan:base64-to-bin</link>()</code>.</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><programlisting>2-param version of the fuller one below </programlisting><para>Used by function <code><link linkend="function-evaluate">tan:evaluate</link>()</code>, <code><link linkend="function-group-elements">tan:group-elements</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><programlisting>Input: a string to be evaluated in light of XPath expressions; a context node </programlisting><programlisting>Output: the result of the string evaluated as an XPath statement against the context 
node </programlisting><para>Used by function <code><link linkend="function-evaluate">tan:evaluate</link>()</code>, <code><link linkend="function-group-elements">tan:group-elements</link>()</code>.</para><para>Relies upon <code><link linkend="variable-xpath-pattern">$xpath-pattern</link></code>.</para></section>
<section xml:id="function-glob-to-regex"><title><code>tan:glob-to-regex()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:glob-to-regex($globs as xs:string*) as xs:string*</code></para><programlisting>Input: any strings that follow a glob-like syntax </programlisting><programlisting>Output: the strings converted to regular expressions </programlisting><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-grc-to-int"><title><code>tan:grc-to-int()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:grc-to-int($greek-numerals as xs:string*) as xs:integer*</code></para><programlisting>Input: Greek letters that represent numerals </programlisting><programlisting>Output: the numerical value of the letters </programlisting><programlisting>NB, this does not take into account the use of letters representing numbers 1000 and 
greater </programlisting><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><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:group-elements($elements-to-group as element()*, $group-min as xs:double?, $label-to-prepend) as element()*</code></para><programlisting>Input: any elements that should be grouped; parameters specifying minimum size of 
grouping and the name of a label to prepend </programlisting><programlisting>Output: those elements grouped </programlisting><programlisting>This function was written primarily for the major alter function </programlisting><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-initial-upper-case"><title><code>tan:initial-upper-case()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:initial-upper-case($strings as xs:string*) as xs:string*</code></para><programlisting>Input: any strings </programlisting><programlisting>Output: each string with the initial letters capitalized and the rest set 
lower-case </programlisting><para>Used by template <code><link linkend="template-title-case">ŧ title-case</link></code>.</para><para>Used by function <code><link linkend="function-title-case">tan:title-case</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-int-to-aaa"><title><code>tan:int-to-aaa()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:int-to-aaa($integers as xs:integer*) as xs:string*</code></para><programlisting>Input: any integers </programlisting><programlisting>Output: the alphabetic representation of those numerals </programlisting><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-int-to-grc"><title><code>tan:int-to-grc()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:int-to-grc($integers as xs:integer*) as xs:string*</code></para><programlisting>Input: any integers </programlisting><programlisting>Output: the integers expressed as lowercase Greek alphabetic numerals, with 
numeral <code>marker(</code>s) </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-chop-string">tan:chop-string</link>()</code>.</para></section>
<section xml:id="function-integers-to-sequence"><title><code>tan:integers-to-sequence()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:integers-to-sequence($input-integers as xs:integer*) as xs:string?</code></para><programlisting>Input: any integers </programlisting><programlisting>Output: a string that compactly expresses those integers </programlisting><programlisting>Example: (1, 3, 6, 1, 2) - &gt; "1-3, 6" </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-integers-to-sequence">ŧ integers-to-sequence</link></code>.</para></section>
<section xml:id="function-lengths-to-positions"><title><code>tan:lengths-to-positions()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:lengths-to-positions($seq as xs:integer*) as xs:integer*</code></para><programlisting>Input: sequence of numbers representing legnths of items. </programlisting><programlisting>Output: sequence of numbers representing the first position of each input item, if 
the sequence concatenated. E.g., (4, 12, 0, 7) - &gt; (1, 5, 17, 17) </programlisting><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-lm-data"><title><code>tan:lm-data()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:lm-data($token-value as xs:string?, $lang-codes as xs:string*) as element()*</code></para><programlisting>Input: token value; a language code </programlisting><programlisting>Output: <code><link linkend="element-lm">&lt;lm&gt;</link></code> data for that token value from any available resources </programlisting><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>, <code><link linkend="function-lang-catalog">tan:lang-catalog</link>()</code>, <code><link linkend="function-search-morpheus">tan:search-morpheus</link>()</code>, <code><link linkend="function-search-results-to-claims">tan:search-results-to-claims</link>()</code>.</para></section>
<section xml:id="function-median"><title><code>tan:median()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:median($numbers as xs:double*) as xs:double?</code></para><programlisting>Input: any sequence of numbers </programlisting><programlisting>Output: the median value </programlisting><programlisting>It is assumed that the input has already been sorted by <code>tan:numbers-sorted()</code> vel sim </programlisting><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><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:merge-analyzed-stats($analyzed-stats as element()*, $add-stats as xs:boolean?) as element()</code></para><programlisting>Input: Results from <code><link linkend="function-analyze-stats">tan:analyze-stats</link>()</code>; a boolean </programlisting><programlisting>Output: A synthesis of the results. If the second parameter is true, the stats are 
added; if false, the first statistic will be compared to the sum of all subsequent ones. </programlisting><para>Used by function <code><link linkend="function-merge-analyzed-stats">tan:merge-analyzed-stats</link>()</code>.</para><para>Relies upon <code><link linkend="function-analyze-stats">tan:analyze-stats</link>()</code>, <code><link linkend="function-merge-analyzed-stats">tan:merge-analyzed-stats</link>()</code>.</para></section>
<section xml:id="function-most-common-item"><title><code>tan:most-common-item()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:most-common-item($sequence as item()*) as item()?</code></para><programlisting>Input: any sequence of items </programlisting><programlisting>Output: the one item that appears most frequently </programlisting><programlisting>If two or more items appear equally frequently, only the first is returned </programlisting><para>Used by variable <code><link linkend="variable-most-common-indentations">$most-common-indentations</link></code>.</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><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:namespace($prefix-or-uri as xs:string*) as xs:string*</code></para><programlisting>Input: any strings representing a namespace prefix or uri </programlisting><programlisting>Output: the corresponding prefix or uri whenever a match is found in the global 
variable </programlisting><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><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:no-outliers($numbers as xs:anyAtomicType*) as xs:anyAtomicType*</code></para><programlisting>Input: any sequence of numbers </programlisting><programlisting>Output: the same sequence, without outliers </programlisting><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-node-type"><title><code>tan:node-type()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:node-type($xml-items as item()*) as xs:string*</code></para><programlisting>Input: any XML items </programlisting><programlisting>Output: the node types of each item </programlisting><para>Used by function <code><link linkend="function-search-morpheus">tan:search-morpheus</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-normalize-xml-element-space"><title><code>tan:normalize-xml-element-space()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:normalize-xml-element-space($element-to-normalize as element()?) as element()?</code></para><programlisting>Input: an element </programlisting><programlisting>Output: the same element, but with text node descendants space-normalized </programlisting><programlisting>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 </programlisting><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><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:number-sort($numbers as xs:anyAtomicType*) as xs:double*</code></para><programlisting>Input: any sequence of items </programlisting><programlisting>Output: the same sequence, sorted with string numerals converted to numbers </programlisting><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-open-file"><title><code>tan:open-file()</code></title><para><emphasis>Option 1 (TAN-extra-functions)</emphasis></para><para><code>tan:open-file($resolved-urls) </code></para><programlisting>1-parameter function of the main one below </programlisting><para>Used by function <code><link linkend="function-open-file">tan:open-file</link>()</code>.</para><para>Relies upon <code><link linkend="function-open-file">tan:open-file</link>()</code>.</para><para><emphasis>Option 2 (TAN-extra-functions)</emphasis></para><para><code>tan:open-file($resolved-urls, $target-fallback-encoding as xs:string*) as document-node()*</code></para><programlisting>Input: items that can be resolved as strings; a string </programlisting><programlisting>Output: for each resolvable string in the first parameter, if a document is 
available, the document; if it is not, but unparsed text is available, a document with the 
unparsed text wrapped in a root element; otherwise an empty document node. If unparsed text is 
not available, another attempt will be made on a fallback encoding specified by the 2nd 
parameter. </programlisting><programlisting>If the file is not an XML document, the content will be wrapped by a root element of an 
XML document. That root node will have <code>@xml:base</code> pointing to the source url. </programlisting><para>Used by function <code><link linkend="function-open-file">tan:open-file</link>()</code>.</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><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:outliers($numbers as xs:anyAtomicType*) as xs:anyAtomicType*</code></para><programlisting>Input: any sequence of numbers </programlisting><programlisting>Output: outliers in the sequence </programlisting><para>Used by function <code><link linkend="function-no-outliers">tan:no-outliers</link>()</code>, <code><link linkend="function-outliers">tan:outliers</link>()</code>.</para><para>Relies upon <code><link linkend="function-median">tan:median</link>()</code>, <code><link linkend="function-number-sort">tan:number-sort</link>()</code>, <code><link linkend="function-outliers">tan:outliers</link>()</code>.</para></section>
<section xml:id="function-parse-urls"><title><code>tan:parse-urls()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:parse-urls($input-strings as xs:string*) as element()*</code></para><programlisting>Input: any sequence of strings </programlisting><programlisting>Output: one element per string, parsed into children <code>&lt;non-url&gt;</code> and <code>&lt;url&gt;</code> </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="variable-url-regex">$url-regex</link></code>.</para></section>
<section xml:id="function-possible-bibliography-id"><title><code>tan:possible-bibliography-id()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:possible-bibliography-id($bibl-cit as xs:string) as xs:string</code></para><programlisting>Input: a string with a bibliographic entry </programlisting><programlisting>Output: unique values of the two longest words and the first numeral that looks like a 
date </programlisting><programlisting>When working with bibliographical data, it is next to impossible to rely upon an 
exact match to tell whether two citations refer to the same item. </programlisting><programlisting>Many times, however, the longest word or two, plus the four-digit date, are good ways 
to try to find matches. </programlisting><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><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:product($numbers as item()*) as xs:double?</code></para><programlisting>Input: a sequence of numbers </programlisting><programlisting>Output: the product of those numbers </programlisting><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><emphasis>TAN-extra-functions</emphasis></para><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-remove-duplicate-siblings"><title><code>tan:remove-duplicate-siblings()</code></title><para><emphasis>Option 1 (TAN-extra-functions)</emphasis></para><para><code>tan:remove-duplicate-siblings($items-to-process as item()*) as item()*</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-remove-duplicate-siblings">ŧ remove-duplicate-siblings</link></code>.</para><para><emphasis>Option 2 (TAN-extra-functions)</emphasis></para><para><code>tan:remove-duplicate-siblings($items-to-process as document-node()*, $element-names-to-check as xs:string*) as item()*</code></para><programlisting>Input: any items </programlisting><programlisting>Output: the same documents after removing duplicate elements whose names match the 
second parameter. </programlisting><programlisting>This function is applied during document resolution, to prune duplicate elements 
that might have been included </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-remove-duplicate-siblings">ŧ remove-duplicate-siblings</link></code>.</para></section>
<section xml:id="function-reset-hierarchy"><title><code>tan:reset-hierarchy()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:reset-hierarchy($expanded-class-1-docs as document-node()*, $flag-misplaced-leaf-divs as xs:boolean?) as document-node()*</code></para><programlisting>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 </programlisting><programlisting>Output: the same documents, with <code><link linkend="element-div">&lt;div&gt;</link></code>s restored to their proper place in the 
hierarchy </programlisting><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-revise-hrefs"><title><code>tan:revise-hrefs()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:revise-hrefs($item-to-resolve as item()?, $items-original-url as xs:string, $items-destination-url as xs:string) as item()*</code></para><programlisting>Input: an item that should have urls resolved; the original url of the item; the 
target url (the item's destination) </programlisting><programlisting>Output: the item with each <code><link linkend="attribute-href">@href</link></code> (including those in processing instructions) and 
html:*/<code><link linkend="attribute-src">@src</link></code> resolved </programlisting><para>Used by function <code><link linkend="function-revise-hrefs">tan:revise-hrefs</link>()</code>.</para><para>Relies upon <code><link linkend="function-revise-hrefs">tan:revise-hrefs</link>()</code>, <code><link linkend="template-revise-hrefs">ŧ revise-hrefs</link></code>.</para></section>
<section xml:id="function-sequence-to-tree"><title><code>tan:sequence-to-tree()</code></title><para><emphasis>Option 1 (TAN-extra-functions)</emphasis></para><para><code>tan:sequence-to-tree($sequence-to-reconstruct as item()*) as item()*</code></para><programlisting>One-parameter version of the more complete one below </programlisting><para>Used by function <code><link linkend="function-sequence-to-tree">tan:sequence-to-tree</link>()</code>.</para><para>Relies upon <code><link linkend="function-sequence-to-tree">tan:sequence-to-tree</link>()</code>.</para><para><emphasis>Option 2 (TAN-extra-functions)</emphasis></para><para><code>tan:sequence-to-tree($sequence-to-reconstruct as item()*, $fix-orphan-text as xs:boolean) as item()*</code></para><programlisting>Input: a result of <code><link linkend="function-tree-to-sequence">tan:tree-to-sequence</link>()</code>; a boolean </programlisting><programlisting>Output: the original tree; if the boolean is true, then any first children that are 
text nodes will be wrapped in a shallow copy of the first child element </programlisting><para>Used by function <code><link linkend="function-sequence-to-tree">tan:sequence-to-tree</link>()</code>.</para><para>Relies upon <code><link linkend="template-sequence-to-tree">ŧ sequence-to-tree</link></code>.</para></section>
<section xml:id="function-syr-to-int"><title><code>tan:syr-to-int()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:syr-to-int($syriac-numerals as xs:string*) as xs:integer*</code></para><programlisting>Input: Syriac letters that represent numerals </programlisting><programlisting>Output: the numerical value of the letters </programlisting><programlisting>NB, this does not take into account the use of letters representing numbers 1000 and 
greater </programlisting><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-title-case"><title><code>tan:title-case()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:title-case($string-to-convert as xs:string*) as xs:string*</code></para><programlisting>Input: a sequence of strings </programlisting><programlisting>Output: each string set in title case, following the conventions of English (one of 
the only languages that bother with title-case) </programlisting><programlisting>According to Chicago rules of title casing, the first and last words are always 
capitalized, and interior words are capitalzied unless they are a preposition or article </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="variable-english-articles">$english-articles</link></code>, <code><link linkend="variable-english-prepositions">$english-prepositions</link></code>, <code><link linkend="function-initial-upper-case">tan:initial-upper-case</link>()</code>, <code><link linkend="template-title-case">ŧ title-case</link></code>.</para></section>
<section xml:id="function-tree-to-sequence"><title><code>tan:tree-to-sequence()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:tree-to-sequence($xml-fragment as item()*) as item()*</code></para><programlisting>Input: any XML fragment </programlisting><programlisting>Output: a flattened sequence of XML nodes representing the original fragment. Each 
element is given a new <code>@level</code> specifying the level of hierarchy the element had in the 
original. </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-tree-to-sequence">ŧ tree-to-sequence</link></code>.</para></section>
<section xml:id="function-true"><title><code>tan:true()</code></title><para><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:true($string as xs:string*) as xs:boolean*</code></para><programlisting>Input: a sequence of strings representing truth values </programlisting><programlisting>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 </programlisting><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><emphasis>TAN-extra-functions</emphasis></para><para><code>tan:zip-uris($uris as xs:string*) as xs:anyURI*</code></para><programlisting>Input: any string representing a uri </programlisting><programlisting>Output: the same string with 'zip:' prepended if it represents a uri to a file in an 
archive (docx, jar, zip, etc.) </programlisting><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 xml:id="vkft-TAN-function"><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><emphasis>TAN-function-functions</emphasis></para><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><emphasis>TAN-function-functions</emphasis></para><para><code>tan:errors-checked-where($error-ids as xs:string*) as element()*</code></para><programlisting>Input: error ids </programlisting><programlisting>Output: the top-level templates, stylesheets, and variables that use that error 
code </programlisting><programlisting>Used primarily by schematron validation for TAN-errors.xml </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="variable-all-functions">$all-functions</link></code>, <code><link linkend="variable-apos">$apos</link></code>, <code><link linkend="variable-quot">$quot</link></code>.</para></section>
<section xml:id="function-variables-checked-where"><title><code>tan:variables-checked-where()</code></title><para><emphasis>TAN-function-functions</emphasis></para><para><code>tan:variables-checked-where($error-ids as xs:string*) as element()*</code></para><programlisting>Input: name of a variable </programlisting><programlisting>Output: the top-level templates, stylesheets, and variables that use that error 
code </programlisting><programlisting>Used primarily by schematron validation for TAN-errors.xml </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="variable-all-functions">$all-functions</link></code>, <code><link linkend="variable-apos">$apos</link></code>, <code><link linkend="variable-quot">$quot</link></code>.</para></section>
</section>
</section>
<section xml:id="vkft-TAN-schema"><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><emphasis>TAN-schema-functions</emphasis></para><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><emphasis>TAN-schema-functions</emphasis></para><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><emphasis>TAN-schema-functions</emphasis></para><para>Definition: <code>             for $i in <link linkend="variable-schema-uri-collection">$schema-uri-collection</link>             return                 if (doc-available($i)) then                     doc($i)                 else                     ()</code></para><para>Used by variable <code><link linkend="variable-rng-collection">$rng-collection</link></code>.</para><para>Relies upon <code><link linkend="variable-schema-uri-collection">$schema-uri-collection</link></code>.</para></section>
<section xml:id="variable-schema-uri-collection"><title><code>$schema-uri-collection</code></title><para><emphasis>TAN-schema-functions</emphasis></para><para>Definition: <code>uri-collection('../../schemas'), uri-collection('../../schemas/incl')</code></para><para>Used by variable <code><link linkend="variable-schema-collection">$schema-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><emphasis>TAN-schema-functions</emphasis></para><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="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><title>Functions</title><section xml:id="function-get-parent-elements"><title><code>tan:get-parent-elements()</code></title><para><emphasis>TAN-schema-functions</emphasis></para><para><code>tan:get-parent-elements($current-elements as element()*) as element()*</code></para><programlisting>requires as input some rng: element from <code><link linkend="variable-rng-collection">$rng-collection</link></code>, oftentimes an 
rng:element or rng:attribute </programlisting><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 xml:id="vkft-TAN-language"><title>TAN-language global variables, keys, and functions summarized</title><section><title>Variables</title><section xml:id="variable-grc-tokens-without-accents"><title><code>$grc-tokens-without-accents</code></title><para><emphasis>TAN-language-functions</emphasis></para><para>Definition: <code>doc('lang/grc-tokens-without-accents.xml')/*/*</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-iso-639-3"><title><code>$iso-639-3</code></title><para><emphasis>TAN-language-functions</emphasis></para><para>Definition: <code>doc('lang/iso-639-3.xml')</code></para><para>Used by function <code><link linkend="function-lang-code">tan:lang-code</link>()</code>, <code><link linkend="function-lang-name">tan:lang-name</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-languages-supported"><title><code>$languages-supported</code></title><para><emphasis>TAN-language-functions</emphasis></para><para>Definition: <code>map:keys($lang-catalog-map)</code></para><para>Used by function <code><link linkend="function-lang-catalog">tan:lang-catalog</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-lang-catalog"><title><code>tan:lang-catalog()</code></title><para><emphasis>TAN-language-functions</emphasis></para><para><code>tan:lang-catalog($lang-codes as xs:string*) as document-node()*</code></para><programlisting>Input: language codes </programlisting><programlisting>Output: the catalogs for those languages </programlisting><para>Used by function <code><link linkend="function-lm-data">tan:lm-data</link>()</code>.</para><para>Relies upon <code><link linkend="variable-languages-supported">$languages-supported</link></code>.</para></section>
<section xml:id="function-lang-code"><title><code>tan:lang-code()</code></title><para><emphasis>TAN-language-functions</emphasis></para><para><code>tan:lang-code($lang-name as xs:string?) as xs:string*</code></para><programlisting>Input: the name of a language </programlisting><programlisting>Output: the 3-letter code for the language </programlisting><programlisting>If no exact match is found, the parameter will be treated as a regular expression, and 
all case-insensitive matches will be returned </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="variable-iso-639-3">$iso-639-3</link></code>.</para></section>
<section xml:id="function-lang-name"><title><code>tan:lang-name()</code></title><para><emphasis>TAN-language-functions</emphasis></para><para><code>tan:lang-name($lang-code as xs:string?) as xs:string*</code></para><programlisting>Input: the code of a language </programlisting><programlisting>Output: the name of the language </programlisting><programlisting>If no exact match is found, the parameter will be treated as a regular expression, and 
all case-insensitive matches will be returned </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="variable-iso-639-3">$iso-639-3</link></code>.</para></section>
</section>
</section>
<section xml:id="vkft-TAN-search"><title>TAN-search global variables, keys, and functions summarized</title><section><title>Variables</title><section xml:id="variable-search-services"><title><code>$search-services</code></title><para><emphasis>TAN-search-functions</emphasis></para><para>Definition: <code>doc('TAN-search-services.xml')</code></para><para>Used by function <code><link linkend="function-search-for-entities">tan:search-for-entities</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-search-for-entities"><title><code>tan:search-for-entities()</code></title><para><emphasis>TAN-search-functions</emphasis></para><para><code>tan:search-for-entities($server-idref as xs:string, $params as element()+) as item()*</code></para><programlisting>Input: a sequence of strings (search keywords), a string (options: loc), a string 
(options: marcxml, dc, mods), a positive integer </programlisting><programlisting>Output: up to N records (N = integer parameter) in the protocol of the 3rd paramater, 
using the SRU protocol of the library catalog specified in the 2nd parameter based on 
search words in the 1st </programlisting><para>Used by function <code><link linkend="function-search-for-entities">tan:search-for-entities</link>()</code>, <code><link linkend="function-search-for-scripta">tan:search-for-scripta</link>()</code>, <code><link linkend="function-search-for-persons">tan:search-for-persons</link>()</code>, <code><link linkend="function-search-wikipedia">tan:search-wikipedia</link>()</code>, <code><link linkend="function-search-morpheus">tan:search-morpheus</link>()</code>.</para><para>Relies upon <code><link linkend="variable-internet-available">$internet-available</link></code>, <code><link linkend="variable-search-services">$search-services</link></code>, <code><link linkend="function-search-for-entities">tan:search-for-entities</link>()</code>.</para></section>
<section xml:id="function-search-for-persons"><title><code>tan:search-for-persons()</code></title><para><emphasis>TAN-search-functions</emphasis></para><para><code>tan:search-for-persons($search-expression as xs:string?, $max-records as xs:integer) as item()*</code></para><programlisting>Input: a search expression, an integer indicating the number of records requested </programlisting><programlisting>Output: that number of records using the search expression in the Virtual 
International Authority File </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-search-for-entities">tan:search-for-entities</link>()</code>.</para></section>
<section xml:id="function-search-for-scripta"><title><code>tan:search-for-scripta()</code></title><para><emphasis>TAN-search-functions</emphasis></para><para><code>tan:search-for-scripta($search-expression as xs:string?, $max-records as xs:integer) as item()*</code></para><programlisting>Input: a search expression, an integer indicating the number of records requested </programlisting><programlisting>Output: that number of records using the search expression in the Library of 
Congress </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-search-for-entities">tan:search-for-entities</link>()</code>.</para></section>
<section xml:id="function-search-morpheus"><title><code>tan:search-morpheus()</code></title><para><emphasis>TAN-search-functions</emphasis></para><para><code>tan:search-morpheus($search-expression as xs:string?) as document-node()?</code></para><programlisting>Input: a token in Greek or Latin </programlisting><programlisting>Output: lexico-morphological data using Morpheus's service </programlisting><para>Used by function <code><link linkend="function-lm-data">tan:lm-data</link>()</code>.</para><para>Relies upon <code><link linkend="function-node-type">tan:node-type</link>()</code>, <code><link linkend="function-search-for-entities">tan:search-for-entities</link>()</code>.</para></section>
<section xml:id="function-search-results-to-claims"><title><code>tan:search-results-to-claims()</code></title><para><emphasis>TAN-search-functions</emphasis></para><para><code>tan:search-results-to-claims($search-results as item()*, $results-vendor as xs:string) as item()*</code></para><programlisting>Input: XML representing a search result that is a claim; a string indicating which 
vendor supplied the results </programlisting><programlisting>Output: the claim represented in TAN elements </programlisting><programlisting>This experimental function, so far only supporting results from 
<code><link linkend="function-search-morpheus">tan:search-morpheus</link>()</code> </programlisting><para>Used by function <code><link linkend="function-lm-data">tan:lm-data</link>()</code>.</para><para>Relies upon <code><link linkend="template-claims-morpheus">ŧ claims-morpheus</link></code>.</para></section>
<section xml:id="function-search-results-to-IRI-name-pattern"><title><code>tan:search-results-to-IRI-name-pattern()</code></title><para><emphasis>Option 1 (TAN-search-functions)</emphasis></para><para><code>tan:search-results-to-IRI-name-pattern($search-results as item()*) as item()*</code></para><programlisting>One-parameter version of the fuller one, below </programlisting><para>Used by function <code><link linkend="function-search-results-to-IRI-name-pattern">tan:search-results-to-IRI-name-pattern</link>()</code>.</para><para>Relies upon <code><link linkend="function-search-results-to-IRI-name-pattern">tan:search-results-to-IRI-name-pattern</link>()</code>.</para><para><emphasis>Option 2 (TAN-search-functions)</emphasis></para><para><code>tan:search-results-to-IRI-name-pattern($search-results as item()*, $format-results as xs:boolean) as item()*</code></para><programlisting>Input: search results from <code><link linkend="function-search-for-entities">tan:search-for-entities</link>()</code> </programlisting><programlisting>Output: for every entity found, an <code><link linkend="element-item">&lt;item&gt;</link></code> with <code><link linkend="element-IRI">&lt;IRI&gt;</link></code>, <code><link linkend="element-name">&lt;name&gt;</link></code>, and perhaps <code><link linkend="element-desc">&lt;desc&gt;</link></code> </programlisting><programlisting>Note, this is intended to format results from searches that result in identifiers 
and descriptions of entities, not claims. </programlisting><para>Used by function <code><link linkend="function-search-results-to-IRI-name-pattern">tan:search-results-to-IRI-name-pattern</link>()</code>.</para><para>Relies upon <code><link linkend="template-get-IRI-name">ŧ get-IRI-name</link></code>.</para></section>
<section xml:id="function-search-wikipedia"><title><code>tan:search-wikipedia()</code></title><para><emphasis>TAN-search-functions</emphasis></para><para><code>tan:search-wikipedia($search-expression as xs:string?, $max-records as xs:integer) as item()*</code></para><programlisting>Input: a search expression, an integer indicating the number of records requested </programlisting><programlisting>Output: that number of records using the search expression in Wikipedia </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-search-for-entities">tan:search-for-entities</link>()</code>.</para></section>
</section>
</section>
<section xml:id="vkft-TAN-A-lm-extra"><title>TAN-A-lm-extra global variables, keys, and functions summarized</title><section><title>Variables</title><section xml:id="variable-TAN-feature-vocabulary"><title><code>$TAN-feature-vocabulary</code></title><para><emphasis>TAN-A-lm-extra-functions</emphasis></para><para>Definition: <code><link linkend="variable-TAN-vocabularies">$TAN-vocabularies</link>[tan:TAN-voc/<link linkend="attribute-id">@id</link> = 'tag:textalign.net,2015:tan-voc:features']</code></para><para>Used by template <code><link linkend="template-build-morpheus-ana">ŧ build-morpheus-ana</link></code> build-morpheus-lex.</para><para>Relies upon <code><link linkend="variable-TAN-vocabularies">$TAN-vocabularies</link></code>.</para></section>
</section>
<section><title>Functions</title><section xml:id="function-merge-anas"><title><code>tan:merge-anas()</code></title><para><emphasis>TAN-A-lm-extra-functions</emphasis></para><para><code>tan:merge-anas($anas-to-merge as element(tan:ana)*, $regard-only-those-toks-that-have-what-vals as xs:string*) as element()?</code></para><programlisting>Input: a set of <code><link linkend="element-ana">&lt;ana&gt;</link></code>s that should be merged; a list of strings to which <code><link linkend="element-tok">&lt;tok&gt;</link></code>s should 
be restricted </programlisting><programlisting>Output: the merger of the <code><link linkend="element-ana">&lt;ana&gt;</link></code>s, with <code><link linkend="attribute-cert">@cert</link></code> recalibrated and all <code><link linkend="element-tok">&lt;tok&gt;</link></code>s merged </programlisting><programlisting>This function presumes that every relevant <code><link linkend="element-tok">&lt;tok&gt;</link></code> has a <code><link linkend="attribute-val">@val</link></code>, and that values of <code><link linkend="element-l">&lt;l&gt;</link></code> 
and <code><link linkend="element-m">&lt;m&gt;</link></code> have been normalized </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-distinct-items">tan:distinct-items</link>()</code>, <code><link linkend="template-itemize-lms">ŧ itemize-lms</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><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template priority='-5' match='document-node()' mode='#all' /&gt;</code></para><para><code>&lt;xsl:template priority='-5' match='*' mode='#all' /&gt;</code></para><para><code>&lt;xsl:template priority='-5' match='comment() | processing-instruction()' mode='#all' /&gt;</code></para><para><code>&lt;xsl:template match='tan:error | tan:help | tan:warning | tan:fix | tan:fatal | tan:info' priority='-4' mode='#all' /&gt;</code></para><para><code>&lt;xsl:template match='tei:teiHeader' mode='#all' priority='-4' /&gt;</code></para><para><code>&lt;xsl:template match='tan:tail' mode='#all' priority='-4' /&gt;</code></para><programlisting>We ignore tails in validation; retain otherwise </programlisting><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-collation-pos-offset"><title><code>ŧ add-collation-pos-offset</code></title><bridgehead><code>TAN-core-3-0-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:wit' mode='add-collation-pos-offset' /&gt;</code></para><para>Used by template <code><link linkend="template-clean-up-collation-pass-1">ŧ clean-up-collation-pass-1</link></code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-add-tok-pos"><title><code>ŧ add-tok-pos</code></title><bridgehead><code>TAN-core-string-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:tok' mode='add-tok-pos' /&gt;</code></para><para>Used by function <code><link linkend="function-tokenize-text">tan:tokenize-text</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><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*:body | tan:div | tan:tok | tan:non-tok | tei:*' mode='analyze-string-length-pass-1' /&gt;</code></para><para><code>&lt;xsl:template match='tan:a | tan:b | tan:common' mode='analyze-string-length-pass-1' /&gt;</code></para><programlisting>To process <code><link linkend="function-diff">tan:diff</link>()</code> results </programlisting><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><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*[@string-length or @s1-length or @s2-length]' mode='analyze-string-length-pass-2' /&gt;</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-apply-inclusions-and-adjust-vocabulary"><title><code>ŧ apply-inclusions-and-adjust-vocabulary</code></title><bridgehead><code>catalog.tan-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='collection' priority='2' mode='get-undefined-idrefs resolve-critical-dependencies apply-inclusions-and-adjust-vocabulary resolve-numerals       core-expansion-terse core-expansion-normal core-expansion-verbose core-expansion-terse-attributes' /&gt;</code></para><bridgehead><code>TAN-core-resolve-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:inclusion/*[tan:head]' mode='apply-inclusions-and-adjust-vocabulary' /&gt;</code></para><para><code>&lt;xsl:template match='*[@include]' mode='apply-inclusions-and-adjust-vocabulary' /&gt;</code></para><para><code>&lt;xsl:template match='tan:vocabulary/tan:TAN-voc' mode='apply-inclusions-and-adjust-vocabulary' /&gt;</code></para><programlisting>We already know that <code><link linkend="element-vocabulary">&lt;vocabulary&gt;</link></code> targets a TAN-voc file, so we can skip the root 
element, and even the &lt;head type="vocabulary"&gt;, and merely report back the <code><link linkend="element-item">&lt;item&gt;</link></code>s and 
<code><link linkend="element-verb">&lt;verb&gt;</link></code>s </programlisting><para><code>&lt;xsl:template match='tan:head/tan:TAN-voc' mode='apply-inclusions-and-adjust-vocabulary' /&gt;</code></para><programlisting>We retain those standard TAN vocabulary items only if they fetched something that 
matched a vocabulary filter </programlisting><para>Used by template <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code>.</para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>, <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>.</para><para>Relies upon <code><link linkend="function-copy-of-except">tan:copy-of-except</link>()</code>, <code><link linkend="function-element-vocabulary">tan:element-vocabulary</link>()</code>, <code><link linkend="function-error">tan:error</link>()</code>, <code><link linkend="function-help-extracted">tan:help-extracted</link>()</code>, <code><link linkend="template-prefix-attr-include">ŧ prefix-attr-include</link></code>.</para></section><section xml:id="template-batch-replace-advanced"><title><code>ŧ batch-replace-advanced</code></title><bridgehead><code>TAN-extra-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*' mode='batch-replace-advanced' /&gt;</code></para><para><code>&lt;xsl:template match='@*' mode='batch-replace-advanced' /&gt;</code></para><para><code>&lt;xsl:template match='text()' mode='batch-replace-advanced' /&gt;</code></para><para>Used by function <code><link linkend="function-batch-replace-advanced">tan:batch-replace-advanced</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-build-grouping-key"><title><code>ŧ build-grouping-key</code></title><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='text()' mode='build-grouping-key' /&gt;</code></para><para><code>&lt;xsl:template match='*' mode='build-grouping-key' /&gt;</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>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-build-morpheus-ana"><title><code>ŧ build-morpheus-ana</code></title><bridgehead><code>TAN-search-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='node()' mode='claims-morpheus claims-morpheus-desc       build-morpheus-ana build-morpheus-lex' /&gt;</code></para><para><code>&lt;xsl:template match='oac:Body' mode='build-morpheus-ana' /&gt;</code></para><para><code>&lt;xsl:template match='entry' mode='build-morpheus-ana' /&gt;</code></para><para><code>&lt;xsl:template match='dict' mode='build-morpheus-ana' /&gt;</code></para><para><code>&lt;xsl:template match='infl' mode='build-morpheus-ana' /&gt;</code></para><para><code>&lt;xsl:template match='pofs | case | gend | num | mood | tense | voice | comp' mode='build-morpheus-ana build-morpheus-lex' /&gt;</code></para><para>Used by template <code><link linkend="template-claims-morpheus">ŧ claims-morpheus</link></code>.</para><para>Used by function <code><link linkend="function-search-results-to-claims">tan:search-results-to-claims</link>()</code>.</para><para>Relies upon <code><link linkend="variable-TAN-feature-vocabulary">$TAN-feature-vocabulary</link></code>.</para></section><section xml:id="template-build-morpheus-lex"><title><code>ŧ build-morpheus-lex</code></title><bridgehead><code>TAN-search-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='node()' mode='claims-morpheus claims-morpheus-desc       build-morpheus-ana build-morpheus-lex' /&gt;</code></para><para><code>&lt;xsl:template match='pofs | case | gend | num | mood | tense | voice | comp' mode='build-morpheus-ana build-morpheus-lex' /&gt;</code></para><para><code>&lt;xsl:template match='infl' mode='build-morpheus-lex' /&gt;</code></para><para><code>&lt;xsl:template match='dict' mode='build-morpheus-lex' /&gt;</code></para><para><code>&lt;xsl:template match='hdwd' mode='build-morpheus-lex' /&gt;</code></para><para><code>&lt;xsl:template match='@xml:lang' mode='build-morpheus-lex' /&gt;</code></para><para>Used by template <code><link linkend="template-claims-morpheus">ŧ claims-morpheus</link></code>.</para><para>Used by function <code><link linkend="function-search-results-to-claims">tan:search-results-to-claims</link>()</code>.</para><para>Relies upon <code><link linkend="variable-TAN-feature-vocabulary">$TAN-feature-vocabulary</link></code>.</para></section><section xml:id="template-catalog-expansion-terse"><title><code>ŧ catalog-expansion-terse</code></title><bridgehead><code>TAN-core-expand-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='collection' mode='catalog-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='doc' mode='catalog-expansion-terse' /&gt;</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-duplicate-ids">$duplicate-ids</link></code>, <code><link linkend="function-duplicate-items">tan:duplicate-items</link>()</code>, <code><link linkend="function-error">tan:error</link>()</code>.</para></section><section xml:id="template-check-and-expand-ranges"><title><code>ŧ check-and-expand-ranges</code></title><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*[@from][text()]' mode='check-and-expand-ranges' /&gt;</code></para><para><code>&lt;xsl:template match='tan:ref[@from][tan:n]' priority='1' mode='check-and-expand-ranges' /&gt;</code></para><para>Used by function <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link>()</code>.</para><para>Relies upon <code><link linkend="variable-separator-hierarchy">$separator-hierarchy</link></code>, <code><link linkend="function-error">tan:error</link>()</code>, <code><link linkend="function-expand-numerical-sequence">tan:expand-numerical-sequence</link>()</code>, <code><link linkend="function-sequence-error">tan:sequence-error</link>()</code>, <code><link linkend="function-string-to-numerals">tan:string-to-numerals</link>()</code>.</para></section><section xml:id="template-check-referred-doc"><title><code>ŧ check-referred-doc</code></title><bridgehead><code>TAN-A-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:vocabulary/tan:item' priority='2' mode='check-referred-doc' /&gt;</code></para><programlisting>This template overrides the one in TAN-core-expand-functions.xsl </programlisting><bridgehead><code>TAN-core-expand-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:inclusion/* | tan:vocabulary/tan:item' priority='1' mode='check-referred-doc' /&gt;</code></para><programlisting>Ignore anything deeper than inclusion. </programlisting><para><code>&lt;xsl:template match='tan:algorithm | tan:TAN-T/tan:head/tan:source | tei:TEI/tan:head/tan:source' mode='check-referred-doc' /&gt;</code></para><programlisting>This component of the template mode is to check elements that point to non-TAN files </programlisting><para><code>&lt;xsl:template match='          tan:inclusion | tan:vocabulary | tan:TAN-A/tan:head/tan:source | tan:TAN-A-lm/tan:head/tan:source | tan:TAN-A-tok/tan:head/tan:source          | tan:see-also | tan:morphology | tan:redivision | tan:model | tan:successor | tan:predecessor | tan:annotation' mode='check-referred-doc' /&gt;</code></para><programlisting>Look for errors in a TAN document referred to; should not be applied to non-TAN files </programlisting><para><code>&lt;xsl:template match='tan:IRI' priority='2' mode='check-referred-doc' /&gt;</code></para><para><code>&lt;xsl:template match='*[@href]' mode='check-referred-doc' /&gt;</code></para><para>Used by template <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-TAN-namespace">$TAN-namespace</link></code>, <code><link linkend="variable-TAN-vocabularies">$TAN-vocabularies</link></code>, <code><link linkend="variable-doc-catalogs">$doc-catalogs</link></code>, <code><link linkend="variable-doc-id">$doc-id</link></code>, <code><link linkend="variable-duplicate-head-iris">$duplicate-head-iris</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-inclusions-resolved">$inclusions-resolved</link></code>, <code><link linkend="variable-internet-available">$internet-available</link></code>, <code><link linkend="variable-sources-resolved">$sources-resolved</link></code>, <code><link linkend="variable-vocabularies-resolved">$vocabularies-resolved</link></code>, <code><link linkend="function-base-uri">tan:base-uri</link>()</code>, <code><link linkend="function-catalogs">tan:catalogs</link>()</code>, <code><link linkend="function-class-number">tan:class-number</link>()</code>, <code><link linkend="function-dateTime-to-decimal">tan:dateTime-to-decimal</link>()</code>, <code><link linkend="function-distinct-items">tan:distinct-items</link>()</code>, <code><link linkend="function-element-vocabulary">tan:element-vocabulary</link>()</code>, <code><link linkend="function-error">tan:error</link>()</code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>, <code><link linkend="function-get-doc-history">tan:get-doc-history</link>()</code>, <code><link linkend="function-is-valid-uri">tan:is-valid-uri</link>()</code>, <code><link linkend="function-last-change-agent">tan:last-change-agent</link>()</code>, <code><link linkend="function-normalize-text">tan:normalize-text</link>()</code>, <code><link linkend="function-resolve-doc">tan:resolve-doc</link>()</code>, <code><link linkend="function-shallow-copy">tan:shallow-copy</link>()</code>, <code><link linkend="function-tan-type">tan:tan-type</link>()</code>, <code><link linkend="function-uri-relative-to">tan:uri-relative-to</link>()</code>, <code><link linkend="function-url-is-local">tan:url-is-local</link>()</code>.</para></section><section xml:id="template-claims-morpheus"><title><code>ŧ claims-morpheus</code></title><bridgehead><code>TAN-search-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='node()' mode='claims-morpheus claims-morpheus-desc       build-morpheus-ana build-morpheus-lex' /&gt;</code></para><para><code>&lt;xsl:template match='/*' mode='claims-morpheus' /&gt;</code></para><para>Used by template <code><link linkend="template-claims-morpheus">ŧ claims-morpheus</link></code>.</para><para>Used by function <code><link linkend="function-search-results-to-claims">tan:search-results-to-claims</link>()</code>.</para><para>Relies upon <code><link linkend="template-build-morpheus-ana">ŧ build-morpheus-ana</link></code>, <code><link linkend="template-build-morpheus-lex">ŧ build-morpheus-lex</link></code>.</para></section><section xml:id="template-claims-morpheus-desc"><title><code>ŧ claims-morpheus-desc</code></title><bridgehead><code>TAN-search-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='node()' mode='claims-morpheus claims-morpheus-desc       build-morpheus-ana build-morpheus-lex' /&gt;</code></para><para>Used by template <code><link linkend="template-claims-morpheus">ŧ claims-morpheus</link></code>.</para><para>Used by function <code><link linkend="function-search-results-to-claims">tan:search-results-to-claims</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-class-1-expansion-verbose-pass-1"><title><code>ŧ class-1-expansion-verbose-pass-1</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:head' mode='class-1-expansion-verbose-pass-1' /&gt;</code></para><para><code>&lt;xsl:template match='tan:redivision' mode='class-1-expansion-verbose-pass-1' /&gt;</code></para><para><code>&lt;xsl:template match='tan:model' mode='class-1-expansion-verbose-pass-1' /&gt;</code></para><para><code>&lt;xsl:template match='tan:body' mode='class-1-expansion-verbose-pass-1' /&gt;</code></para><programlisting>Anticipate the next pass, which will check redivisions against the current text, by 
analyzing the leaf div string length </programlisting><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>.</para><para>Relies upon <code><link linkend="variable-doc-id">$doc-id</link></code>, <code><link linkend="variable-model-resolved">$model-resolved</link></code>, <code><link linkend="variable-redivisions-resolved">$redivisions-resolved</link></code>, <code><link linkend="function-analyze-leaf-div-string-length">tan:analyze-leaf-div-string-length</link>()</code>, <code><link linkend="function-copy-of-except">tan:copy-of-except</link>()</code>, <code><link linkend="function-diff">tan:diff</link>()</code>, <code><link linkend="function-error">tan:error</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-merge-expanded-docs">tan:merge-expanded-docs</link>()</code>, <code><link linkend="function-resolve-doc">tan:resolve-doc</link>()</code>, <code><link linkend="function-text-join">tan:text-join</link>()</code>.</para></section><section xml:id="template-class-1-expansion-verbose-pass-2"><title><code>ŧ class-1-expansion-verbose-pass-2</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:head' mode='class-1-expansion-verbose-pass-2' /&gt;</code></para><para><code>&lt;xsl:template match='tan:redivision/tan:diff' mode='class-1-expansion-verbose-pass-2' /&gt;</code></para><programlisting>The goal here is first to punctuate the diff elements with empty &lt;div string-pos=""&gt; 
anchors and then to rebuild the diff fragments within newly built <code><link linkend="element-div">&lt;div&gt;</link></code>s </programlisting><para><code>&lt;xsl:template match='tan:redivision/tan:diff/tan:b' mode='class-1-expansion-verbose-pass-2' /&gt;</code></para><programlisting>if there's a <code>&lt;b&gt;</code> without a comparion <code>&lt;a&gt;</code> then copy it without variables; <code>&lt;b&gt;</code>'s with 
companion <code>&lt;a&gt;</code>s get processed with the <code>&lt;a&gt;</code> </programlisting><para><code>&lt;xsl:template match='tan:redivision/tan:diff/tan:common | tan:redivision/tan:diff/tan:a' mode='class-1-expansion-verbose-pass-2' /&gt;</code></para><para><code>&lt;xsl:template match='tan:model' mode='class-1-expansion-verbose-pass-2' /&gt;</code></para><para><code>&lt;xsl:template match='tan:model/tan:body' mode='class-1-expansion-verbose-pass-2' /&gt;</code></para><para><code>&lt;xsl:template match='tan:TAN-T/tan:body' mode='class-1-expansion-verbose-pass-2' /&gt;</code></para><para><code>&lt;xsl:template match='tan:div' mode='class-1-expansion-verbose-pass-2' /&gt;</code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>.</para><para>Relies upon <code><link linkend="element-div">&lt;div&gt;</link></code>, <code><link linkend="function-analyze-numbers-in-string">tan:analyze-numbers-in-string</link>()</code>, <code><link linkend="function-error">tan:error</link>()</code>, <code><link linkend="function-help">tan:help</link>()</code>, <code><link linkend="function-shallow-copy">tan:shallow-copy</link>()</code>, <code><link linkend="function-string-to-numerals">tan:string-to-numerals</link>()</code>.</para></section><section xml:id="template-class-1-expansion-verbose-pass-3"><title><code>ŧ class-1-expansion-verbose-pass-3</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:body' mode='class-1-expansion-verbose-pass-3' /&gt;</code></para><para><code>&lt;xsl:template match='tan:div[not(tan:div)]' mode='class-1-expansion-verbose-pass-3' /&gt;</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-xml-to-string">tan:xml-to-string</link>()</code>.</para></section><section xml:id="template-class-2-expansion-normal"><title><code>ŧ class-2-expansion-normal</code></title><bridgehead><code>TAN-class-2-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:div-ref' mode='core-expansion-normal class-2-expansion-normal' /&gt;</code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-class-2-expansion-terse"><title><code>ŧ class-2-expansion-terse</code></title><bridgehead><code>TAN-A-lm-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:body' mode='class-2-expansion-terse' /&gt;</code></para><bridgehead><code>TAN-class-2-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:skip/tan:div-type | tan:skip/tan:n | tan:rename/tan:n | tan:passage       | tan:from-tok | tan:through-tok | tan:rename | tan:reassign' mode='class-2-expansion-terse class-2-expansion-terse-for-validation' /&gt;</code></para><para><code>&lt;xsl:template match='tan:equate' mode='class-2-expansion-terse class-2-expansion-terse-for-validation' /&gt;</code></para><programlisting>equate locators should be more forgiving than other adjustment locators: you do not 
want every value of <code><link linkend="attribute-n">@n</link></code> to match each source, only one combination </programlisting><para><code>&lt;xsl:template match='tan:to/tan:ref | tan:new/tan:ref' mode='class-2-expansion-terse class-2-expansion-terse-for-validation' /&gt;</code></para><programlisting>these refs do not assume the ref exists in the target sources </programlisting><para><code>&lt;xsl:template match='tan:ref' mode='class-2-expansion-terse class-2-expansion-terse-for-validation' /&gt;</code></para><para><code>&lt;xsl:template match='tan:pos' mode='class-2-expansion-terse class-2-expansion-terse-for-validation' /&gt;</code></para><programlisting>Tokens are identified by a combination of rgx/val plus pos. Because the latter is the 
only constant, we monitor identified tokens through tan:pos, not tan:rgx or tan:val </programlisting><para><code>&lt;xsl:template match='tan:chars' mode='class-2-expansion-terse class-2-expansion-terse-for-validation' /&gt;</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-duplicate-items">tan:duplicate-items</link>()</code>, <code><link linkend="function-error">tan:error</link>()</code>, <code><link linkend="function-node-before">tan:node-before</link>()</code>, <code><link linkend="function-ordinal">tan:ordinal</link>()</code>.</para></section><section xml:id="template-class-2-expansion-terse-for-validation"><title><code>ŧ class-2-expansion-terse-for-validation</code></title><bridgehead><code>TAN-class-2-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:skip/tan:div-type | tan:skip/tan:n | tan:rename/tan:n | tan:passage       | tan:from-tok | tan:through-tok | tan:rename | tan:reassign' mode='class-2-expansion-terse class-2-expansion-terse-for-validation' /&gt;</code></para><para><code>&lt;xsl:template match='tan:equate' mode='class-2-expansion-terse class-2-expansion-terse-for-validation' /&gt;</code></para><programlisting>equate locators should be more forgiving than other adjustment locators: you do not 
want every value of <code><link linkend="attribute-n">@n</link></code> to match each source, only one combination </programlisting><para><code>&lt;xsl:template match='tan:to/tan:ref | tan:new/tan:ref' mode='class-2-expansion-terse class-2-expansion-terse-for-validation' /&gt;</code></para><programlisting>these refs do not assume the ref exists in the target sources </programlisting><para><code>&lt;xsl:template match='tan:ref' mode='class-2-expansion-terse class-2-expansion-terse-for-validation' /&gt;</code></para><para><code>&lt;xsl:template match='tan:pos' mode='class-2-expansion-terse class-2-expansion-terse-for-validation' /&gt;</code></para><programlisting>Tokens are identified by a combination of rgx/val plus pos. Because the latter is the 
only constant, we monitor identified tokens through tan:pos, not tan:rgx or tan:val </programlisting><para><code>&lt;xsl:template match='tan:chars' mode='class-2-expansion-terse class-2-expansion-terse-for-validation' /&gt;</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-duplicate-items">tan:duplicate-items</link>()</code>, <code><link linkend="function-error">tan:error</link>()</code>, <code><link linkend="function-node-before">tan:node-before</link>()</code>, <code><link linkend="function-ordinal">tan:ordinal</link>()</code>.</para></section><section xml:id="template-class-2-expansion-verbose"><title><code>ŧ class-2-expansion-verbose</code></title><bridgehead><code>TAN-class-2-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:source' mode='class-2-expansion-verbose' /&gt;</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-get-1st-doc">tan:get-1st-doc</link>()</code>.</para></section><section xml:id="template-clean-reset-divs-1"><title><code>ŧ clean-reset-divs-1</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:div' mode='clean-reset-divs-1' /&gt;</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:template.</para><para>Relies upon <code><link linkend="template-clean-reset-divs-2">ŧ clean-reset-divs-2</link></code>.</para></section><section xml:id="template-clean-reset-divs-2"><title><code>ŧ clean-reset-divs-2</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:div[tan:ref/@reset]' mode='reset-hierarchy clean-reset-divs-2' /&gt;</code></para><para><code>&lt;xsl:template match='tan:ref' mode='clean-reset-divs-2' /&gt;</code></para><para>Used by template <code><link linkend="template-clean-reset-divs-1">ŧ clean-reset-divs-1</link></code>.</para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>, <code><link linkend="function-reset-hierarchy-loop">tan:reset-hierarchy-loop</link>()</code>, <code><link linkend="function-reset-hierarchy">tan:reset-hierarchy</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-clean-up-collation-pass-1"><title><code>ŧ clean-up-collation-pass-1</code></title><bridgehead><code>TAN-core-3-0-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:x | tan:witness' mode='clean-up-collation-pass-1' /&gt;</code></para><para><code>&lt;xsl:template match='tan:previous-collation | tan:diagnostics' mode='clean-up-collation-pass-1' /&gt;</code></para><para><code>&lt;xsl:template match='*[tan:u]' mode='clean-up-collation-pass-1' /&gt;</code></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>, <code><link linkend="template-add-collation-pos-offset">ŧ add-collation-pos-offset</link></code>.</para></section><section xml:id="template-clean-up-collation-pass-2"><title><code>ŧ clean-up-collation-pass-2</code></title><bridgehead><code>TAN-core-3-0-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*[tan:u]' mode='clean-up-collation-pass-2' /&gt;</code></para><programlisting>At the end of cleanup, there may be adjacent <code>&lt;c&gt;</code>s, which should be consolidated </programlisting><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-collation-to-strings"><title><code>ŧ collation-to-strings</code></title><bridgehead><code>TAN-core-3-0-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:witness' mode='collation-to-strings' /&gt;</code></para><para>Used by function <code><link linkend="function-collation-to-strings">tan:collation-to-strings</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-copy-of-except"><title><code>ŧ copy-of-except</code></title><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*' mode='copy-of-except' /&gt;</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-ad-hoc-pre-pass"><title><code>ŧ core-expansion-ad-hoc-pre-pass</code></title><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='squelch' priority='-5' mode='core-expansion-ad-hoc-pre-pass' /&gt;</code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</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><bridgehead><code>catalog.tan-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='collection' priority='2' mode='get-undefined-idrefs resolve-critical-dependencies apply-inclusions-and-adjust-vocabulary resolve-numerals       core-expansion-terse core-expansion-normal core-expansion-verbose core-expansion-terse-attributes' /&gt;</code></para><bridgehead><code>TAN-A-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:subject/tan:div | tan:object/tan:div' priority='1' mode='core-expansion-normal' /&gt;</code></para><programlisting>This template prevents a <code><link linkend="element-div">&lt;div&gt;</link></code> within a claim being treated as if part of a class 1 
file. </programlisting><bridgehead><code>TAN-voc-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:body' mode='core-expansion-normal' /&gt;</code></para><para><code>&lt;xsl:template match='tan:name' mode='core-expansion-normal' /&gt;</code></para><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:body | tan:div' mode='core-expansion-normal' /&gt;</code></para><bridgehead><code>TAN-class-2-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:div-ref' mode='core-expansion-normal class-2-expansion-normal' /&gt;</code></para><bridgehead><code>TAN-core-expand-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='/*' mode='core-expansion-normal dependency-expansion-normal' /&gt;</code></para><para><code>&lt;xsl:template match='tan:master-location' mode='core-expansion-normal' /&gt;</code></para><para><code>&lt;xsl:template match='tan:see-also | tan:model | tan:redivision | tan:successor | tan:predecessor | tan:algorithm | tan:source[tan:location] | tan:annotation' mode='core-expansion-normal' /&gt;</code></para><para><code>&lt;xsl:template match='text()[matches(., '\S')]' mode='core-expansion-normal' /&gt;</code></para><programlisting>Text should have already been subject to <code><link linkend="function-normalize-text">tan:normalize-text</link>()</code> in the terse phase. 
This routine checks for other anomalies. </programlisting><para>Used by template <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code>.</para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>, <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>.</para><para>Relies upon <code><link linkend="variable-orig-self">$orig-self</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-error">tan:error</link>()</code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>, <code><link linkend="function-get-doc-history">tan:get-doc-history</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-normalize-name">tan:normalize-name</link>()</code>, <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>.</para></section><section xml:id="template-core-expansion-terse"><title><code>ŧ core-expansion-terse</code></title><bridgehead><code>catalog.tan-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='collection' priority='2' mode='get-undefined-idrefs resolve-critical-dependencies apply-inclusions-and-adjust-vocabulary resolve-numerals       core-expansion-terse core-expansion-normal core-expansion-verbose core-expansion-terse-attributes' /&gt;</code></para><bridgehead><code>TAN-A-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='/' mode='core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:claim/tan:work | tan:object/tan:work | tan:subject/tan:work' mode='core-expansion-terse' /&gt;</code></para><programlisting>This template targets <code><link linkend="element-work">&lt;work&gt;</link></code> elements in the body, not the head </programlisting><programlisting>Such a step would ordinarily have been taken in the previous expansion pass, on 
attributes, but it didn't have the extra vocabulary. </programlisting><para><code>&lt;xsl:template match='tan:group[tan:work]' mode='core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:body' mode='core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:claim' mode='core-expansion-terse' /&gt;</code></para><programlisting>subjects and verbs are the only two elements of a claim that are inheritable, since 
they are the only ones expected to be the basis for grouping claims </programlisting><para><code>&lt;xsl:template match='tan:subject | tan:object' mode='core-expansion-terse' /&gt;</code></para><bridgehead><code>TAN-A-lm-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:adjustments' mode='core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:body' mode='core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:tok' mode='core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:m' mode='core-expansion-terse' /&gt;</code></para><programlisting>This step breaks down the <code><link linkend="element-m">&lt;m&gt;</link></code> into constituent <code>&lt;f&gt;</code>s with <code><link linkend="attribute-n">@n</link></code> indicating position, and 
the values normalized (lowercase) </programlisting><bridgehead><code>TAN-mor-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*[@which]/tan:id' priority='1' mode='core-expansion-terse' /&gt;</code></para><programlisting>This template overrules the default, because TAN-mor files must cite all features 
that are allowed, and many times the name is conveniently also the perfect id. </programlisting><bridgehead><code>TAN-voc-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:body' mode='core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='*[@affects-element]/tan:affects-element' mode='core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:item | tan:verb' mode='core-expansion-terse' /&gt;</code></para><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:redivision | tan:TAN-T/tan:head/tan:companion-version | tei:TEI/tan:head/tan:companion-version' mode='core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:model' mode='core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:TAN-T | tei:TEI' mode='core-expansion-terse dependency-adjustments-pass-1' /&gt;</code></para><programlisting>Homogenize tei:TEI to tan:TAN-T </programlisting><para><code>&lt;xsl:template match='tei:body' mode='core-expansion-terse dependency-adjustments-pass-1' /&gt;</code></para><para><code>&lt;xsl:template match='tei:text' mode='core-expansion-terse dependency-adjustments-pass-1' /&gt;</code></para><programlisting>Makes sure tei:body rises rootward one level, as is customary for <code><link linkend="element-body">&lt;body&gt;</link></code> in TAN and 
HTML </programlisting><para><code>&lt;xsl:template match='tan:div | tei:div' mode='core-expansion-terse' /&gt;</code></para><programlisting>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 adjustment items to process </programlisting><para><code>&lt;xsl:template match='tei:lb | tei:pb | tei:cb' mode='core-expansion-terse dependency-adjustments-pass-1 normalize-tei-space' /&gt;</code></para><bridgehead><code>TAN-class-2-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:source | tan:morphology[not(@attr)]' mode='core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:rename' mode='core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:rename/tan:by' mode='core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:tok[not(tan:from)] | tan:tok/tan:from | tan:tok/tan:to |       tan:from-tok | tan:through-tok' mode='core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='          tan:adjustments/tan:skip/tan:div-type |          tan:adjustments/tan:*/tan:ref | tan:adjustments/tan:*/tan:n | tan:passage/tan:ref' mode='core-expansion-terse' /&gt;</code></para><bridgehead><code>TAN-class-3-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:TAN-mor/tan:body' mode='dependency-adjustments-pass-1 core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:category ' mode='dependency-adjustments-pass-1 core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:feature/tan:type' mode='dependency-adjustments-pass-1 core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:feature/tan:code' mode='dependency-adjustments-pass-1 core-expansion-terse' /&gt;</code></para><bridgehead><code>TAN-core-expand-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='/*' mode='core-expansion-terse' priority='-2' /&gt;</code></para><para><code>&lt;xsl:template match='tan:head' mode='core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:inclusion | tan:vocabulary' mode='core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='*[@which]/tan:id' mode='core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:name' mode='core-expansion-terse' /&gt;</code></para><programlisting>parameters below are populated only in TAN-voc files </programlisting><para><code>&lt;xsl:template match='tan:IRI' mode='core-expansion-terse' /&gt;</code></para><programlisting>The next param is specific to TAN-voc files </programlisting><para><code>&lt;xsl:template match='tan:token-definition' mode='core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:vocabulary-key' mode='core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:file-resp' mode='core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:to-do' mode='core-expansion-terse' /&gt;</code></para><para>Used by template <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code>.</para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>, <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>.</para><para>Relies upon <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-id-namespace">$TAN-id-namespace</link></code>, <code><link linkend="variable-TAN-namespace">$TAN-namespace</link></code>, <code><link linkend="variable-TAN-version">$TAN-version</link></code>, <code><link linkend="variable-TAN-version-is-under-development">$TAN-version-is-under-development</link></code>, <code><link linkend="variable-TAN-vocabularies">$TAN-vocabularies</link></code>, <code><link linkend="variable-TAN-vocabulary-files">$TAN-vocabulary-files</link></code>, <code><link linkend="variable-all-selector">$all-selector</link></code>, <code><link linkend="variable-datatypes-that-require-unit-specification">$datatypes-that-require-unit-specification</link></code>, <code><link linkend="variable-doc-id">$doc-id</link></code>, <code><link linkend="variable-doc-id-namespace">$doc-id-namespace</link></code>, <code><link linkend="variable-doc-is-error-test">$doc-is-error-test</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-empty-element">$empty-element</link></code>, <code><link linkend="variable-model-resolved">$model-resolved</link></code>, <code><link linkend="variable-names-of-elements-that-describe-text-bearers">$names-of-elements-that-describe-text-bearers</link></code>, <code><link linkend="variable-names-of-elements-that-describe-textual-entities">$names-of-elements-that-describe-textual-entities</link></code>, <code><link linkend="variable-objects-target-what-elements-names">$objects-target-what-elements-names</link></code>, <code><link linkend="variable-official-urn-namespaces">$official-urn-namespaces</link></code>, <code><link linkend="variable-previous-TAN-versions">$previous-TAN-versions</link></code>, <code><link linkend="variable-redivisions-resolved">$redivisions-resolved</link></code>, <code><link linkend="variable-separator-hierarchy">$separator-hierarchy</link></code>, <code><link linkend="variable-subjects-target-what-elements-names">$subjects-target-what-elements-names</link></code>, <code><link linkend="variable-token-definition-default">$token-definition-default</link></code>, <code><link linkend="function-analyze-numbers-in-string">tan:analyze-numbers-in-string</link>()</code>, <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link>()</code>, <code><link linkend="function-attribute-vocabulary">tan:attribute-vocabulary</link>()</code>, <code><link linkend="function-data-type-check">tan:data-type-check</link>()</code>, <code><link linkend="function-distinct-items">tan:distinct-items</link>()</code>, <code><link linkend="function-doc-id-namespace">tan:doc-id-namespace</link>()</code>, <code><link linkend="function-duplicate-items">tan:duplicate-items</link>()</code>, <code><link linkend="function-element-vocabulary">tan:element-vocabulary</link>()</code>, <code><link linkend="function-error">tan:error</link>()</code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</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-help-extracted">tan:help-extracted</link>()</code>, <code><link linkend="function-last-change-agent">tan:last-change-agent</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-normalize-div-text">tan:normalize-div-text</link>()</code>, <code><link linkend="function-normalize-name">tan:normalize-name</link>()</code>, <code><link linkend="function-resolve-doc">tan:resolve-doc</link>()</code>, <code><link linkend="function-shallow-copy">tan:shallow-copy</link>()</code>, <code><link linkend="function-target-element-names">tan:target-element-names</link>()</code>, <code><link linkend="function-vocabulary">tan:vocabulary</link>()</code>, <code><link linkend="template-check-referred-doc">ŧ check-referred-doc</link></code>, <code><link linkend="template-selective-shallow-skip">ŧ selective-shallow-skip</link></code>.</para></section><section xml:id="template-core-expansion-terse-attributes"><title><code>ŧ core-expansion-terse-attributes</code></title><bridgehead><code>catalog.tan-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='collection' priority='2' mode='get-undefined-idrefs resolve-critical-dependencies apply-inclusions-and-adjust-vocabulary resolve-numerals       core-expansion-terse core-expansion-normal core-expansion-verbose core-expansion-terse-attributes' /&gt;</code></para><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tei:div[not(tei:div)]/tei:*' priority='1' mode='resolve-numerals core-expansion-terse-attributes' /&gt;</code></para><bridgehead><code>TAN-core-expand-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='comment()' mode='core-expansion-terse-attributes' /&gt;</code></para><para><code>&lt;xsl:template match='/*' priority='1' mode='core-expansion-terse-attributes' /&gt;</code></para><para><code>&lt;xsl:template match='tei:teiHeader' mode='core-expansion-terse-attributes' /&gt;</code></para><para><code>&lt;xsl:template match='tan:head[tan:adjustments]' priority='1' mode='core-expansion-terse-attributes' /&gt;</code></para><para><code>&lt;xsl:template match='tan:head/tan:vocabulary[tan:location] | tan:head/tan:tan-vocabulary' priority='1' mode='core-expansion-terse-attributes' /&gt;</code></para><para><code>&lt;xsl:template match='*[@*]' mode='core-expansion-terse-attributes' /&gt;</code></para><para>Used by template <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code>.</para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>, <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>.</para><para>Relies upon <code><link linkend="variable-names-of-attributes-that-take-idrefs">$names-of-attributes-that-take-idrefs</link></code>, <code><link linkend="function-duplicate-items">tan:duplicate-items</link>()</code>, <code><link linkend="function-error">tan:error</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-normalize-name">tan:normalize-name</link>()</code>, <code><link linkend="function-target-element-names">tan:target-element-names</link>()</code>, <code><link linkend="function-vocabulary">tan:vocabulary</link>()</code>, <code><link linkend="template-core-expansion-terse-attributes-to-elements">ŧ core-expansion-terse-attributes-to-elements</link></code>, <code><link linkend="template-remove-inclusions">ŧ remove-inclusions</link></code>.</para></section><section xml:id="template-core-expansion-terse-attributes-to-elements"><title><code>ŧ core-expansion-terse-attributes-to-elements</code></title><bridgehead><code>TAN-core-expand-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='@*' mode='core-expansion-terse-attributes-to-elements' /&gt;</code></para><para><code>&lt;xsl:template match='@xml:id | @id' mode='core-expansion-terse-attributes-to-elements' /&gt;</code></para><para><code>&lt;xsl:template match='@from | @to | tan:*/@when | @ed-when | @accessed-when' mode='core-expansion-terse-attributes-to-elements' /&gt;</code></para><programlisting>We do not expand into elements any attribute that is a single value </programlisting><para><code>&lt;xsl:template match='@pattern | @matches-m | @matches-tok | @rgx' mode='core-expansion-terse-attributes-to-elements' /&gt;</code></para><para><code>&lt;xsl:template match='@href' mode='core-expansion-terse-attributes-to-elements' /&gt;</code></para><programlisting>no need to convert to element </programlisting><para><code>&lt;xsl:template match='@ref | @pos | @chars | tan:equate/@n | tan:skip/@n | tan:rename/@n' mode='core-expansion-terse-attributes-to-elements' /&gt;</code></para><programlisting>gets converted to one element per atomic value </programlisting><para><code>&lt;xsl:template match='*[@val]/@chars' priority='1' mode='core-expansion-terse-attributes-to-elements' /&gt;</code></para><para><code>&lt;xsl:template match='*[@ref]/@new' mode='core-expansion-terse-attributes-to-elements' /&gt;</code></para><programlisting>gets converted to one element per atomic value </programlisting><para><code>&lt;xsl:template match='*[@n]/@new' mode='core-expansion-terse-attributes-to-elements' /&gt;</code></para><programlisting>gets converted to one element per atomic value </programlisting><para><code>&lt;xsl:template match='@val | @by' mode='core-expansion-terse-attributes-to-elements' /&gt;</code></para><para><code>&lt;xsl:template match='@code | @div-type | @affects-element | @affects-attribute | @item-type | @in-lang' mode='core-expansion-terse-attributes-to-elements' /&gt;</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-all-ids">$all-ids</link></code>, <code><link linkend="variable-doc-uri">$doc-uri</link></code>, <code><link linkend="variable-duplicate-ids">$duplicate-ids</link></code>, <code><link linkend="variable-internet-available">$internet-available</link></code>, <code><link linkend="variable-names-of-attributes-that-are-case-indifferent">$names-of-attributes-that-are-case-indifferent</link></code>, <code><link linkend="variable-names-of-attributes-that-may-take-multiple-space-delimited-values">$names-of-attributes-that-may-take-multiple-space-delimited-values</link></code>, <code><link linkend="variable-now">$now</link></code>, <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link>()</code>, <code><link linkend="function-chop-string">tan:chop-string</link>()</code>, <code><link linkend="function-dateTime-to-decimal">tan:dateTime-to-decimal</link>()</code>, <code><link linkend="function-duplicate-values">tan:duplicate-values</link>()</code>, <code><link linkend="function-error">tan:error</link>()</code>, <code><link linkend="function-expand-numerical-sequence">tan:expand-numerical-sequence</link>()</code>, <code><link linkend="function-help-extracted">tan:help-extracted</link>()</code>, <code><link linkend="function-path">tan:path</link>()</code>, <code><link linkend="function-sequence-error">tan:sequence-error</link>()</code>, <code><link linkend="function-stamp-q-id">tan:stamp-q-id</link>()</code>, <code><link linkend="function-uri-relative-to">tan:uri-relative-to</link>()</code>, <code><link linkend="function-url-is-local">tan:url-is-local</link>()</code>.</para></section><section xml:id="template-core-expansion-verbose"><title><code>ŧ core-expansion-verbose</code></title><bridgehead><code>catalog.tan-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='collection' priority='2' mode='get-undefined-idrefs resolve-critical-dependencies apply-inclusions-and-adjust-vocabulary resolve-numerals       core-expansion-terse core-expansion-normal core-expansion-verbose core-expansion-terse-attributes' /&gt;</code></para><bridgehead><code>TAN-core-expand-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='/*' mode='core-expansion-verbose' /&gt;</code></para><para>Used by template <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code>.</para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>, <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>.</para><para>Relies upon <code><link linkend="function-catalogs">tan:catalogs</link>()</code>, <code><link linkend="function-collection">tan:collection</link>()</code>, <code><link linkend="function-error">tan:error</link>()</code>, <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>, <code><link linkend="function-resolve-doc">tan:resolve-doc</link>()</code>.</para></section><section xml:id="template-cut-faulty-hrefs"><title><code>ŧ cut-faulty-hrefs</code></title><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='/collection' mode='cut-faulty-hrefs' /&gt;</code></para><para><code>&lt;xsl:template match='doc' mode='cut-faulty-hrefs' /&gt;</code></para><para>Used by function <code><link linkend="function-catalogs">tan:catalogs</link>()</code>.</para><para>Relies upon <code><link linkend="function-error">tan:error</link>()</code>.</para></section><section xml:id="template-dependency-adjustments-pass-1"><title><code>ŧ dependency-adjustments-pass-1</code></title><bridgehead><code>TAN-A-lm-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:tan-vocabulary/tan:item[tan:affects-element = 'feature']/tan:id' mode='dependency-adjustments-pass-1' /&gt;</code></para><programlisting>ids for features are not allowed to be case-sensitive </programlisting><para><code>&lt;xsl:template match='tan:vocabulary-key/tan:feature[@xml:id][tan:IRI]' mode='dependency-adjustments-pass-1' /&gt;</code></para><programlisting>We copy <code><link linkend="attribute-xmlid">@xml:id</link></code> for an internally defined vocab key feature, to make it easier to 
match vocab items to feature codes </programlisting><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:TAN-T | tei:TEI' mode='core-expansion-terse dependency-adjustments-pass-1' /&gt;</code></para><programlisting>Homogenize tei:TEI to tan:TAN-T </programlisting><para><code>&lt;xsl:template match='tan:head' mode='dependency-adjustments-pass-1' /&gt;</code></para><para><code>&lt;xsl:template match='tei:body' mode='core-expansion-terse dependency-adjustments-pass-1' /&gt;</code></para><para><code>&lt;xsl:template match='tei:text' mode='core-expansion-terse dependency-adjustments-pass-1' /&gt;</code></para><programlisting>Makes sure tei:body rises rootward one level, as is customary for <code><link linkend="element-body">&lt;body&gt;</link></code> in TAN and 
HTML </programlisting><para><code>&lt;xsl:template match='*:body/text() | *:div[*:div]/text()' mode='dependency-adjustments-pass-1' /&gt;</code></para><para><code>&lt;xsl:template match='tan:div | tei:div' mode='dependency-adjustments-pass-1' /&gt;</code></para><programlisting>This template applies <code><link linkend="element-skip">&lt;skip&gt;</link></code>, <code><link linkend="element-rename">&lt;rename&gt;</link></code>, and <code><link linkend="element-equate">&lt;equate&gt;</link></code> in class 2 <code><link linkend="element-adjustments">&lt;adjustments&gt;</link></code> upon 
a dependency class 1 file, and expands <code>&lt;n&gt;</code> and <code>&lt;ref&gt;</code> </programlisting><programlisting>Errors in <code><link linkend="element-adjustments">&lt;adjustments&gt;</link></code> are embedded to report back to the dependent class 2 file. In 
those cases, the error is associated not with the specific instruction but its locator, 
i.e., the element + <code>@q</code> version of the the expanded forms of <code><link linkend="attribute-div-type">@div-type</link></code>, <code><link linkend="attribute-n">@n</link></code>, <code><link linkend="attribute-ref">@ref.</link></code>. </programlisting><para><code>&lt;xsl:template match='tei:lb | tei:pb | tei:cb' mode='core-expansion-terse dependency-adjustments-pass-1 normalize-tei-space' /&gt;</code></para><para><code>&lt;xsl:template match='tan:div/comment()' mode='dependency-adjustments-pass-1' /&gt;</code></para><bridgehead><code>TAN-class-3-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:TAN-mor/tan:body' mode='dependency-adjustments-pass-1 core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:category ' mode='dependency-adjustments-pass-1 core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:feature/tan:type' mode='dependency-adjustments-pass-1 core-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:feature/tan:code' mode='dependency-adjustments-pass-1 core-expansion-terse' /&gt;</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-TAN-version">$TAN-version</link></code>, <code><link linkend="variable-TAN-version-is-under-development">$TAN-version-is-under-development</link></code>, <code><link linkend="variable-all-selector">$all-selector</link></code>, <code><link linkend="variable-doc-id">$doc-id</link></code>, <code><link linkend="variable-empty-element">$empty-element</link></code>, <code><link linkend="variable-previous-TAN-versions">$previous-TAN-versions</link></code>, <code><link linkend="variable-separator-hierarchy">$separator-hierarchy</link></code>, <code><link linkend="variable-special-end-div-chars-regex">$special-end-div-chars-regex</link></code>, <code><link linkend="function-analyze-sequence">tan:analyze-sequence</link>()</code>, <code><link linkend="function-duplicate-items">tan:duplicate-items</link>()</code>, <code><link linkend="function-error">tan:error</link>()</code>, <code><link linkend="function-imprint-adjustment-locator">tan:imprint-adjustment-locator</link>()</code>, <code><link linkend="function-last-change-agent">tan:last-change-agent</link>()</code>, <code><link linkend="function-path">tan:path</link>()</code>, <code><link linkend="function-shallow-copy">tan:shallow-copy</link>()</code>, <code><link linkend="template-core-expansion-terse-attributes">ŧ core-expansion-terse-attributes</link></code>, <code><link linkend="template-selective-shallow-skip">ŧ selective-shallow-skip</link></code>.</para></section><section xml:id="template-dependency-adjustments-pass-2"><title><code>ŧ dependency-adjustments-pass-2</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='/' mode='dependency-adjustments-pass-2' /&gt;</code></para><para><code>&lt;xsl:template match='tan:head' mode='dependency-adjustments-pass-2' /&gt;</code></para><para><code>&lt;xsl:template match='tan:div' mode='dependency-adjustments-pass-2' /&gt;</code></para><programlisting>We do not break the template out according to leaf divs and non-leaf divs because in 
the course of renaming, mixed <code><link linkend="element-div">&lt;div&gt;</link></code>s might have been created </programlisting><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>.</para><para>Relies upon <code><link linkend="variable-all-selector">$all-selector</link></code>, <code><link linkend="variable-token-definition-default">$token-definition-default</link></code>, <code><link linkend="function-duplicate-items">tan:duplicate-items</link>()</code>, <code><link linkend="function-error">tan:error</link>()</code>, <code><link linkend="function-imprint-adjustment-locator">tan:imprint-adjustment-locator</link>()</code>, <code><link linkend="function-shallow-copy">tan:shallow-copy</link>()</code>, <code><link linkend="function-tokenize-text">tan:tokenize-text</link>()</code>, <code><link linkend="template-expand-reassigns">ŧ expand-reassigns</link></code>, <code><link linkend="template-mark-reassigns">ŧ mark-reassigns</link></code>, <code><link linkend="template-unmark-tokens">ŧ unmark-tokens</link></code>.</para></section><section xml:id="template-dependency-expansion-normal"><title><code>ŧ dependency-expansion-normal</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:body' mode='dependency-expansion-normal' /&gt;</code></para><para><code>&lt;xsl:template match='tan:div' mode='dependency-expansion-normal' /&gt;</code></para><bridgehead><code>TAN-core-expand-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='/*' mode='core-expansion-normal dependency-expansion-normal' /&gt;</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:template.</para><para>Relies upon <code><link linkend="function-tokenize-text">tan:tokenize-text</link>()</code>.</para></section><section xml:id="template-dependency-expansion-verbose"><title><code>ŧ dependency-expansion-verbose</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='/*' mode='dependency-expansion-verbose' /&gt;</code></para><para><code>&lt;xsl:template match='tan:div' mode='dependency-expansion-verbose' /&gt;</code></para><para><code>&lt;xsl:template match='tan:tok | tan:non-tok' mode='dependency-expansion-verbose' /&gt;</code></para><para><code>&lt;xsl:template match='text()' mode='dependency-expansion-verbose' /&gt;</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:template.</para><para>Relies upon <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><bridgehead><code>TAN-core-string-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:diff' mode='diff-to-collation' /&gt;</code></para><para><code>&lt;xsl:template match='tan:common' mode='diff-to-collation' /&gt;</code></para><para><code>&lt;xsl:template match='tan:a' mode='diff-to-collation' /&gt;</code></para><para><code>&lt;xsl:template match='tan:b' mode='diff-to-collation' /&gt;</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-element-fingerprint"><title><code>ŧ element-fingerprint</code></title><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*' mode='element-fingerprint' /&gt;</code></para><para><code>&lt;xsl:template match='comment() | processing-instruction()' mode='element-fingerprint' /&gt;</code></para><para><code>&lt;xsl:template match='text()' mode='element-fingerprint' /&gt;</code></para><para>Used by function <code><link linkend="function-element-fingerprint">tan:element-fingerprint</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><bridgehead><code>TAN-core-errors.xsl </code></bridgehead><para><code>&lt;xsl:template match='*' mode='element-to-error' /&gt;</code></para><programlisting>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 </programlisting><para>Used by template <code><link linkend="template-tan-a-lm-expansion-terse">ŧ tan-a-lm-expansion-terse</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><bridgehead><code>TAN-A-lm-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='@m-matches' mode='evaluate-conditions' /&gt;</code></para><para><code>&lt;xsl:template match='@m-has-how-many-features' mode='evaluate-conditions' /&gt;</code></para><para><code>&lt;xsl:template match='@m-has-features' mode='evaluate-conditions' /&gt;</code></para><para><code>&lt;xsl:template match='@tok-matches' mode='evaluate-conditions' /&gt;</code></para><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*' mode='evaluate-conditions' /&gt;</code></para><para><code>&lt;xsl:template match='@*' mode='evaluate-conditions' /&gt;</code></para><para>Used by function <code><link linkend="function-all-conditions-hold-evaluation-loop">tan:all-conditions-hold-evaluation-loop</link>()</code>.</para><para>Relies upon <code><link linkend="function-expand-numerical-sequence">tan:expand-numerical-sequence</link>()</code>.</para></section><section xml:id="template-expand-reassigns"><title><code>ŧ expand-reassigns</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:passage' mode='expand-reassigns' /&gt;</code></para><para><code>&lt;xsl:template match='tan:from-tok' mode='expand-reassigns' /&gt;</code></para><para><code>&lt;xsl:template match='tan:through-tok' mode='expand-reassigns' /&gt;</code></para><para>Used by template <code><link linkend="template-dependency-adjustments-pass-2">ŧ dependency-adjustments-pass-2</link></code>.</para><para>Relies upon <code><link linkend="function-error">tan:error</link>()</code>, <code><link linkend="function-expand-pos-or-chars">tan:expand-pos-or-chars</link>()</code>.</para></section><section xml:id="template-expand-standard-tan-voc"><title><code>ŧ expand-standard-tan-voc</code></title><bridgehead><code>TAN-core-resolve-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='/*' mode='expand-standard-tan-voc' /&gt;</code></para><para><code>&lt;xsl:template match='*[@href]' mode='resolve-href expand-standard-tan-voc' /&gt;</code></para><para>Used by variable <code><link linkend="variable-TAN-vocabularies">$TAN-vocabularies</link></code>.</para><para>Relies upon <code><link linkend="function-base-uri">tan:base-uri</link>()</code>, <code><link linkend="function-shallow-copy">tan:shallow-copy</link>()</code>.</para></section><section xml:id="template-first-stamp-shallow-copy"><title><code>ŧ first-stamp-shallow-copy</code></title><bridgehead><code>TAN-core-resolve-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='/*' mode='first-stamp-shallow-skip first-stamp-shallow-copy resolve-href' /&gt;</code></para><para><code>&lt;xsl:template match='processing-instruction()' mode='resolve-href first-stamp-shallow-copy' /&gt;</code></para><para><code>&lt;xsl:template match='*' mode='first-stamp-shallow-copy' /&gt;</code></para><para><code>&lt;xsl:template match='tan:head/tan:vocabulary[@which]' mode='first-stamp-shallow-copy' /&gt;</code></para><para><code>&lt;xsl:template match='tan:name' mode='first-stamp-shallow-copy' /&gt;</code></para><para><code>&lt;xsl:template match='tan:alias' mode='first-stamp-shallow-copy' /&gt;</code></para><para>Used by template <code><link linkend="template-first-stamp-shallow-skip">ŧ first-stamp-shallow-skip</link></code>, <code><link linkend="template-resolve-critical-dependencies-loop">ŧ resolve-critical-dependencies-loop</link></code>.</para><para>Used by function <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>, <code><link linkend="function-resolve-href">tan:resolve-href</link>()</code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>, <code><link linkend="function-tokenize-text">tan:tokenize-text</link>()</code>.</para><para>Relies upon <code><link linkend="variable-TAN-vocabularies">$TAN-vocabularies</link></code>, <code><link linkend="function-base-uri">tan:base-uri</link>()</code>, <code><link linkend="function-error">tan:error</link>()</code>, <code><link linkend="function-is-valid-uri">tan:is-valid-uri</link>()</code>, <code><link linkend="function-normalize-name">tan:normalize-name</link>()</code>.</para></section><section xml:id="template-first-stamp-shallow-skip"><title><code>ŧ first-stamp-shallow-skip</code></title><bridgehead><code>TAN-core-resolve-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='@* | text() | comment() | processing-instruction()' mode='first-stamp-shallow-skip' /&gt;</code></para><para><code>&lt;xsl:template match='*' mode='first-stamp-shallow-skip' /&gt;</code></para><para><code>&lt;xsl:template match='tan:head' mode='first-stamp-shallow-skip' /&gt;</code></para><para><code>&lt;xsl:template match='/*' mode='first-stamp-shallow-skip first-stamp-shallow-copy resolve-href' /&gt;</code></para><para>Used by template <code><link linkend="template-resolve-critical-dependencies-loop">ŧ resolve-critical-dependencies-loop</link></code>.</para><para>Used by function <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>.</para><para>Relies upon <code><link linkend="function-normalize-name">tan:normalize-name</link>()</code>, <code><link linkend="function-shallow-copy">tan:shallow-copy</link>()</code>, <code><link linkend="template-first-stamp-shallow-copy">ŧ first-stamp-shallow-copy</link></code>.</para></section><section xml:id="template-fragment-to-text"><title><code>ŧ fragment-to-text</code></title><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*' mode='fragment-to-text' /&gt;</code></para><para><code>&lt;xsl:template match='@*' mode='fragment-to-text' /&gt;</code></para><para><code>&lt;xsl:template match='comment()' mode='fragment-to-text' /&gt;</code></para><para><code>&lt;xsl:template match='processing-instruction()' mode='fragment-to-text' /&gt;</code></para><para><code>&lt;xsl:template match='text()' mode='fragment-to-text' /&gt;</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-get-doc-history"><title><code>ŧ get-doc-history</code></title><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='* | text() | comment() | processing-instruction() | document-node()' mode='get-doc-history' /&gt;</code></para><para><code>&lt;xsl:template match='tan:tan-vocabulary | tan:inclusion/tei:* | tan:inclusion/tan:TAN-T | tan:inclusion/tan:TAN-A | tan:inclusion/tan:TAN-A-tok | tan:inclusion/tan:TAN-A-lm | tan:inclusion/tan:TAN-mor | tan:inclusion/tan:TAN-voc' mode='get-doc-history' /&gt;</code></para><para><code>&lt;xsl:template match='*[@when or @ed-when or @accessed-when or @claim-when]' mode='get-doc-history' /&gt;</code></para><para>Used by function <code><link linkend="function-get-doc-history">tan:get-doc-history</link>()</code>.</para><para>Relies upon <code><link linkend="function-dateTime-to-decimal">tan:dateTime-to-decimal</link>()</code>.</para></section><section xml:id="template-get-IRI-name"><title><code>ŧ get-IRI-name</code></title><bridgehead><code>TAN-search-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='text() | processing-instruction() | comment()' mode='get-IRI-name' /&gt;</code></para><para><code>&lt;xsl:template match='document-node() | *' mode='get-IRI-name' /&gt;</code></para><para><code>&lt;xsl:template match='xhtml:a | a[@href]' mode='get-IRI-name' priority='2' /&gt;</code></para><programlisting>viaf results yield html in no namespace </programlisting><programlisting><code>&lt;xsl:message&gt;</code>xhtml:a found&lt;/xsl:message&gt; &lt;xsl:message 
select="<code><link linkend="function-shallow-copy">tan:shallow-copy</link>(</code>.)"/&gt; </programlisting><para><code>&lt;xsl:template match='mods:mods' mode='get-IRI-name' priority='2' /&gt;</code></para><para><code>&lt;xsl:template match='ul[@class = 'mw-search-results']/li' mode='get-IRI-name' /&gt;</code></para><programlisting>wikipedia hits </programlisting><para>Used by function <code><link linkend="function-search-results-to-IRI-name-pattern">tan:search-results-to-IRI-name-pattern</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-get-undefined-idrefs"><title><code>ŧ get-undefined-idrefs</code></title><bridgehead><code>catalog.tan-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='collection' priority='2' mode='get-undefined-idrefs resolve-critical-dependencies apply-inclusions-and-adjust-vocabulary resolve-numerals       core-expansion-terse core-expansion-normal core-expansion-verbose core-expansion-terse-attributes' /&gt;</code></para><para>Used by template <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code>.</para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>, <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-imitate-validation"><title><code>ŧ imitate-validation</code></title><bridgehead><code>TAN-extra-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*' mode='imitate-validation' /&gt;</code></para><programlisting>new stuff </programlisting><para>Used by variable <code><link linkend="variable-orig-self-validated">$orig-self-validated</link></code>.</para><para>Relies upon <code><link linkend="variable-errors-to-squelch">$errors-to-squelch</link></code>, <code><link linkend="variable-self-expanded">$self-expanded</link></code>, <code><link linkend="function-error-report">tan:error-report</link>()</code>, <code><link linkend="function-get-via-q-ref">tan:get-via-q-ref</link>()</code>.</para></section><section xml:id="template-imprint-adjustment-action"><title><code>ŧ imprint-adjustment-action</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:ref | tan:n | tan:div-type | tan:from-tok | tan:through-tok' mode='imprint-adjustment-action' /&gt;</code></para><programlisting>This template is used to leave the imprint of a class-2 adjustment action within a 
class-1 file. </programlisting><programlisting>It imprints both the ref, n, or div-type, wrapped in a copy of its parent (with 
attributes) </programlisting><para>No variables, keys, functions, or named templates depend upon this xsl:template.</para><para>Relies upon <code><link linkend="variable-errors">$errors</link></code>.</para></section><section xml:id="template-imprint-vocabulary"><title><code>ŧ imprint-vocabulary</code></title><bridgehead><code>TAN-A-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:body' mode='imprint-vocabulary' priority='1' /&gt;</code></para><bridgehead><code>TAN-voc-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:body | tan:group | tan:item' mode='imprint-vocabulary' priority='1' /&gt;</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-indent-items"><title><code>ŧ indent-items</code></title><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*' mode='indent-items' /&gt;</code></para><para><code>&lt;xsl:template match='text()' mode='indent-items' /&gt;</code></para><para>Used by function <code><link linkend="function-copy-indentation">tan:copy-indentation</link>()</code>.</para><para>Relies upon <code><link linkend="function-fill">tan:fill</link>()</code>.</para></section><section xml:id="template-infuse-tokenized-div-end-check"><title><code>ŧ infuse-tokenized-div-end-check</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:mold' mode='infuse-tokenized-div-end-check' /&gt;</code></para><para><code>&lt;xsl:template match='*:div[not(*:div)]' mode='infuse-tokenized-div-end-check' /&gt;</code></para><para>Used by function <code><link linkend="function-infuse-divs">tan:infuse-divs</link>()</code>.</para><para>Relies upon <code><link linkend="variable-zwj">$zwj</link></code>.</para></section><section xml:id="template-infuse-tokenized-text"><title><code>ŧ infuse-tokenized-text</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*:div[not(*:div)]' mode='infuse-tokenized-text' /&gt;</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-infuse-tokenized-text-cleanup"><title><code>ŧ infuse-tokenized-text-cleanup</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*:div' mode='infuse-tokenized-text-cleanup' /&gt;</code></para><para><code>&lt;xsl:template match='tan:k' mode='infuse-tokenized-text-cleanup' /&gt;</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-insert-content"><title><code>ŧ insert-content</code></title><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*' mode='insert-content' /&gt;</code></para><para>Used by function <code><link linkend="function-insert-as-last-child">tan:insert-as-last-child</link>()</code>, <code><link linkend="function-insert-as-first-child">tan:insert-as-first-child</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-integers-to-sequence"><title><code>ŧ integers-to-sequence</code></title><bridgehead><code>TAN-extra-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:n' mode='integers-to-sequence' /&gt;</code></para><para>Used by function <code><link linkend="function-integers-to-sequence">tan:integers-to-sequence</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-itemize-lms"><title><code>ŧ itemize-lms</code></title><bridgehead><code>TAN-A-lm-extra-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='node()' mode='itemize-lms' /&gt;</code></para><para><code>&lt;xsl:template match='tan:ana' mode='itemize-lms' /&gt;</code></para><para><code>&lt;xsl:template match='tan:l' mode='itemize-lms' /&gt;</code></para><para>Used by function <code><link linkend="function-merge-anas">tan:merge-anas</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-mark-dependencies-for-validation"><title><code>ŧ mark-dependencies-for-validation</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:reassign | tan:equate | tan:skip | tan:rename' mode='mark-dependencies-for-validation mark-dependencies-for-validation-skip-divs' /&gt;</code></para><para><code>&lt;xsl:template match='/*' mode='mark-dependencies-for-validation' /&gt;</code></para><para><code>&lt;xsl:template match='tan:TAN-T/tan:body' mode='mark-dependencies-for-validation' /&gt;</code></para><para><code>&lt;xsl:template match='tan:div' mode='mark-dependencies-for-validation' /&gt;</code></para><para>Used by template <code><link linkend="template-mark-dependencies-pass-2-for-validation">ŧ mark-dependencies-pass-2-for-validation</link></code>, <code><link linkend="template-mark-dependencies-for-validation">ŧ mark-dependencies-for-validation</link></code>, <code><link linkend="template-mark-dependencies-pass-1">ŧ mark-dependencies-pass-1</link></code>.</para><para>Relies upon <code><link linkend="function-shallow-copy">tan:shallow-copy</link>()</code>, <code><link linkend="function-tokenize-text">tan:tokenize-text</link>()</code>, <code><link linkend="function-xml-to-string">tan:xml-to-string</link>()</code>, <code><link linkend="template-mark-dependencies-for-validation-skip-divs">ŧ mark-dependencies-for-validation-skip-divs</link></code>.</para></section><section xml:id="template-mark-dependencies-for-validation-skip-divs"><title><code>ŧ mark-dependencies-for-validation-skip-divs</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template priority='-1' match='* | text()' mode='mark-dependencies-for-validation-skip-divs' /&gt;</code></para><para><code>&lt;xsl:template match='tan:reassign | tan:equate | tan:skip | tan:rename' mode='mark-dependencies-for-validation mark-dependencies-for-validation-skip-divs' /&gt;</code></para><para><code>&lt;xsl:template match='tan:div' mode='mark-dependencies-for-validation-skip-divs' /&gt;</code></para><para>Used by template <code><link linkend="template-mark-dependencies-pass-2-for-validation">ŧ mark-dependencies-pass-2-for-validation</link></code>, <code><link linkend="template-mark-dependencies-for-validation">ŧ mark-dependencies-for-validation</link></code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-mark-dependencies-pass-1"><title><code>ŧ mark-dependencies-pass-1</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='/' priority='1' mode='mark-dependencies-pass-1' /&gt;</code></para><para><code>&lt;xsl:template match='tan:body' mode='mark-dependencies-pass-1' /&gt;</code></para><para><code>&lt;xsl:template match='tan:div' mode='mark-dependencies-pass-1' /&gt;</code></para><para><code>&lt;xsl:template match='tan:div[not(tan:div)]/text()' mode='mark-dependencies-pass-1' /&gt;</code></para><bridgehead><code>TAN-class-3-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:TAN-mor' mode='mark-dependencies-pass-1 mark-dependencies-pass-2' /&gt;</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-token-definition-default">$token-definition-default</link></code>, <code><link linkend="function-shallow-copy">tan:shallow-copy</link>()</code>, <code><link linkend="function-tokenize-text">tan:tokenize-text</link>()</code>, <code><link linkend="function-vocabulary">tan:vocabulary</link>()</code>, <code><link linkend="function-xml-to-string">tan:xml-to-string</link>()</code>, <code><link linkend="template-mark-dependencies-for-validation">ŧ mark-dependencies-for-validation</link></code>.</para></section><section xml:id="template-mark-dependencies-pass-2"><title><code>ŧ mark-dependencies-pass-2</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*[tan:hold]' mode='mark-dependencies-pass-2' /&gt;</code></para><para><code>&lt;xsl:template match='tan:hold' mode='mark-dependencies-pass-2' /&gt;</code></para><para><code>&lt;xsl:template match='tan:tok' mode='mark-dependencies-pass-2' /&gt;</code></para><bridgehead><code>TAN-class-3-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:TAN-mor' mode='mark-dependencies-pass-1 mark-dependencies-pass-2' /&gt;</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-chop-string">tan:chop-string</link>()</code>, <code><link linkend="function-expand-pos-or-chars">tan:expand-pos-or-chars</link>()</code>, <code><link linkend="function-sequence-error">tan:sequence-error</link>()</code>.</para></section><section xml:id="template-mark-dependencies-pass-2-for-validation"><title><code>ŧ mark-dependencies-pass-2-for-validation</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='/' priority='1' mode='mark-dependencies-pass-2-for-validation' /&gt;</code></para><para><code>&lt;xsl:template match='tan:div/tan:n | tan:div/tan:ref | tan:non-tok | tan:div/tan:tok[not(*)]' mode='mark-dependencies-pass-2-for-validation' /&gt;</code></para><para><code>&lt;xsl:template match='tan:body' mode='mark-dependencies-pass-2-for-validation' /&gt;</code></para><para><code>&lt;xsl:template match='tan:div' mode='mark-dependencies-pass-2-for-validation' /&gt;</code></para><programlisting>This is quite close to the one for tan:body, but it's a shallow skip, and token 
references are a bit trickier. </programlisting><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-expand-numerical-sequence">tan:expand-numerical-sequence</link>()</code>, <code><link linkend="function-sequence-error">tan:sequence-error</link>()</code>, <code><link linkend="template-mark-dependencies-for-validation-skip-divs">ŧ mark-dependencies-for-validation-skip-divs</link></code>.</para></section><section xml:id="template-mark-reassigns"><title><code>ŧ mark-reassigns</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:tok | tan:non-tok' mode='mark-reassigns' /&gt;</code></para><para>Used by template <code><link linkend="template-dependency-adjustments-pass-2">ŧ dependency-adjustments-pass-2</link></code>.</para><para>Relies upon <code><link linkend="function-copy-of-except">tan:copy-of-except</link>()</code>, <code><link linkend="function-imprint-adjustment-locator">tan:imprint-adjustment-locator</link>()</code>, <code><link linkend="function-shallow-copy">tan:shallow-copy</link>()</code>.</para></section><section xml:id="template-mark-tok-chars"><title><code>ŧ mark-tok-chars</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:chars' mode='mark-tok-chars' /&gt;</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:template.</para><para>Relies upon <code><link linkend="function-expand-pos-or-chars">tan:expand-pos-or-chars</link>()</code>.</para></section><section xml:id="template-mark-tok-pos"><title><code>ŧ mark-tok-pos</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:pos' mode='mark-tok-pos' /&gt;</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:template.</para><para>Relies upon <code><link linkend="function-error">tan:error</link>()</code>, <code><link linkend="function-expand-pos-or-chars">tan:expand-pos-or-chars</link>()</code>.</para></section><section xml:id="template-merge-divs"><title><code>ŧ merge-divs</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:body' mode='merge-divs' /&gt;</code></para><para><code>&lt;xsl:template match='tan:group' mode='merge-divs' /&gt;</code></para><para><code>&lt;xsl:template match='tan:div[not(tan:div)]' mode='merge-divs' /&gt;</code></para><programlisting>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 </programlisting><para>Used by function <code><link linkend="function-merge-divs">tan:merge-divs</link>()</code>.</para><para>Relies upon <code><link linkend="variable-separator-hierarchy">$separator-hierarchy</link></code>, <code><link linkend="function-group-divs">tan:group-divs</link>()</code>, <code><link linkend="function-text-join">tan:text-join</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-tan-doc-leaf-divs"><title><code>ŧ merge-tan-doc-leaf-divs</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:div' mode='merge-tan-doc-leaf-divs' /&gt;</code></para><para><code>&lt;xsl:template match='tan:ref' mode='merge-tan-docs merge-tan-doc-leaf-divs' /&gt;</code></para><para><code>&lt;xsl:template match='tan:_weight | tan:_rel-pos | tan:_n-pos | tan:_n-integer | tan:non-numbered' mode='merge-tan-docs merge-tan-doc-leaf-divs stamp-with-src-attr' /&gt;</code></para><para>Used by template <code><link linkend="template-merge-tan-docs">ŧ merge-tan-docs</link></code>.</para><para>Relies upon <code><link linkend="variable-separator-hierarchy">$separator-hierarchy</link></code>.</para></section><section xml:id="template-merge-tan-docs"><title><code>ŧ merge-tan-docs</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='/*' mode='merge-tan-docs' /&gt;</code></para><programlisting>A merged TAN-T file is a collation of multiple <code>TAN-T(</code>EI) files, with each head 
preserved intact, and the single body consisting of a hierarchy of divs grouped by a common 
reference scheme, dictated by <code><link linkend="attribute-n">@n.</link></code>. This function has assumed the following principles, most 
important first: - merged output need not have everything needed to reconstruct the original 
sources, but the data must permit enough differentiation among sources to facilitate a 
variety of later uses, and therefore different configurations: - merged versions should 
retain their relative order - in a merge, <code><link linkend="element-div">&lt;div&gt;</link></code>s should be sorted by numerical order, or by 
relative order, taking the group of divs as a whole - merges on the leaf div level should not lack 
any version, including versions that span or bridge other leaf divs - if a merge results 
in multiple copies, or parts, of a div, the div should be tagged with appropriate 
metadata </programlisting><programlisting>The above list will be better understood in light of specific challenges in class 1 
merges, discussed below. </programlisting><programlisting>Some challenges in merging TAN-T files, discussed point by point: </programlisting><programlisting>Challenge: A div with a particular ref/n might be split, with other divs in-between 
Resolution: all split divs will be grouped together, because the whole point of a merge is, well, 
to merge. Suppose you had to merge a leaf div from version A with a split leaf div from 
version B. If you did not fully merge B you would need to move A into one B split or the other, or 
put one copy of A in one split and another in the other. The situation would get even more 
complicated for a version C with non-leaf divs that would need to be merged. On the other hand, the 
grouping does not mean consolidation. The two, three, or more parts of a split div will be 
preserved as sibling elements within a merge. To assist in later processing, such split divs 
will be given <code>@part</code> and <code>@part-count</code> and appropriate integers (to be able to express 
something like "part 1 of 3"). In addition, each split div element will have the same value for 
<code>@q</code>, to facilitate referencing. </programlisting><programlisting>Challenge: A particular version might have a div where numerical <code>@ns</code> do not follow 
their original sequence (remember, a TAN-T file should follow the sequence of the text 
within the scriptum, not the reference system) Resolution: A merge necessarily has to 
rearrange divs. As a general rule, the order of divs should be determined by adhering to the 
numerical value of <code>@ns.</code>. </programlisting><programlisting>Challenge: Many <code>@ns</code> are not numbers, and a non-numerical div may appear in rather 
different places in different versions. Resolution: The position of a merged div with a 
non-numerical <code><link linkend="attribute-n">@n</link></code> should be determined in accordance with principles outlined above regarding the 
order of divs. Suppose you have version one with div <code>@ns</code> of (epigraph), (1), (2); version 
two with (1), (2), (epigraph). The merge should result, for better or worse, with the 
divs ordered: (1), (epigraph), (2). Similarly, a version one with divs (title), (1), 
(2), ... (59), (60) and a version two with divs (title), (1), should result in the order of 
version one, and not something like (1), (2), ... (15), (title), (16), ... (59), (60). The 
position of non-numerical divs should be determined by nearby numerical div context, 
specifically the closest previous numerical <code><link linkend="attribute-n">@n</link></code> value, then the distance from it (i.e., calculate 
the number of intervening divs with non-numerical <code><link linkend="attribute-n">@n</link></code> values that intervene). </programlisting><programlisting>Challenge: Some non-numerical <code><link linkend="attribute-n">@n</link></code>'s appear in different orders in different 
versions. Resolution: An example of the challenge would be the Old Testament / Tanakh. Modern 
editions have an order of books that diverges from what is in the Septuagint, and a merge of 
those two versions, according to the principles outlined above, would result in an 
idiosyncractic order followed by no version. If the user wishes such divs to follow a particular 
order, it is up to a later process to re-sort the output. </programlisting><programlisting>Challenge: Some <code>@ns</code> might have multiple values, with complex overlap patterns 
Resolution: In a merge, when the algorithm encounters multiple values of <code><link linkend="attribute-n">@n</link></code>, any numerical 
values are retained, excluding any non-numerical values, and the numerals are treated as 
requiring distribution. That is, if <code><link linkend="attribute-n">@n</link></code> points to multiple numerical references, copies of the 
div are to distributed to the atomic numerical values of <code><link linkend="attribute-n">@n.</link></code>. If no non-numerical values 
are found, the values are treated as aliases, and invite merging, greedily. Numerical 
example: four divs with <code><link linkend="attribute-n">@n</link></code> values of (The_Cow, 1), (The_Cow, 2), (1), (2). The non-numerical 
values are ignored for their numerical counterparts, resulting in two merge groups, one 
for 1, another for 2. Non-numerical example: three divs with <code><link linkend="attribute-n">@n</link></code> values of (head), (head, 
title), (title). Greedy overlap of the aliases results in a single group. Mixed example: 
three divs with <code><link linkend="attribute-n">@n</link></code> values of (head), (head, title, 1), (title). Because the middle term has 
a numerical value, the non-numerical values are ignored, resulting in three merge 
groups: head, 1, and title. This group too would be merged: Numerical example with ranges: 
four divs with <code><link linkend="attribute-n">@n</link></code> values of (1), (2), (3), (1-3). The last <code><link linkend="attribute-n">@n</link></code> value, a complex/spanning 
range, requires distribution. Three merge groups are created. The three copies of the 
fourth div are each imprinted with <code>@copy</code> (value 1, 2, or 3) and <code>@copy-count</code> (value 3). Each 
copy retains intact its <code>@q</code> id, and its content. If an application using a merge requires 
the content to be reallocated proportionately, it will need to perform that operation 
upon the merged output. (There are many methods of proportional reallocation, and some 
of them require inspection of other versions that are in the merge, so there is little 
point in implementing in this merge algorithm a complex process that many users will not 
find useful or representative of their assumptions.) The position of merged divs follow 
the principles detailed earlier. Those with numerical references retain their 
position relative to their <code><link linkend="attribute-n">@n</link></code> value. Those with only non-numerical references will attract a 
position computed by their position relative to the closest preceding div with a numerical 
value for <code><link linkend="attribute-n">@n.</link></code>. </programlisting><programlisting/><para><code>&lt;xsl:template match='tan:head' mode='merge-tan-docs' /&gt;</code></para><para><code>&lt;xsl:template match='tan:body | tan:div' mode='merge-tan-docs' /&gt;</code></para><para><code>&lt;xsl:template match='tan:ref' mode='merge-tan-docs merge-tan-doc-leaf-divs' /&gt;</code></para><para><code>&lt;xsl:template match='tan:_weight | tan:_rel-pos | tan:_n-pos | tan:_n-integer | tan:non-numbered' mode='merge-tan-docs merge-tan-doc-leaf-divs stamp-with-src-attr' /&gt;</code></para><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='document-node()' mode='merge-tan-docs' /&gt;</code></para><para>Used by function <code><link linkend="function-merge-expanded-docs">tan:merge-expanded-docs</link>()</code>.</para><para>Relies upon <code><link linkend="variable-separator-hierarchy">$separator-hierarchy</link></code>, <code><link linkend="function-distinct-items">tan:distinct-items</link>()</code>, <code><link linkend="function-group-divs-by-ref">tan:group-divs-by-ref</link>()</code>, <code><link linkend="template-merge-tan-doc-leaf-divs">ŧ merge-tan-doc-leaf-divs</link></code>, <code><link linkend="template-prep-div-refs-pass-1">ŧ prep-div-refs-pass-1</link></code>.</para></section><section xml:id="template-normalize-tei-space"><title><code>ŧ normalize-tei-space</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tei:lb | tei:pb | tei:cb' mode='core-expansion-terse dependency-adjustments-pass-1 normalize-tei-space' /&gt;</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-selective-shallow-skip">ŧ selective-shallow-skip</link></code>.</para></section><section xml:id="template-normalize-xml-fragment-space"><title><code>ŧ normalize-xml-fragment-space</code></title><bridgehead><code>TAN-extra-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='text()' mode='normalize-xml-fragment-space' /&gt;</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-pluck"><title><code>ŧ pluck</code></title><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*' mode='pluck' /&gt;</code></para><para><code>&lt;xsl:template match='text()' mode='pluck' /&gt;</code></para><para><code>&lt;xsl:template match='comment() | processing-instruction()' mode='pluck' /&gt;</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-prefix-attr-include"><title><code>ŧ prefix-attr-include</code></title><bridgehead><code>TAN-core-resolve-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*[@include]' mode='prefix-attr-include' /&gt;</code></para><para>Used by template <code><link linkend="template-apply-inclusions-and-adjust-vocabulary">ŧ apply-inclusions-and-adjust-vocabulary</link></code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-prep-div-refs-pass-1"><title><code>ŧ prep-div-refs-pass-1</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:div' mode='prep-div-refs-pass-1' /&gt;</code></para><para><code>&lt;xsl:template match='tan:ref' mode='prep-div-refs-pass-1' /&gt;</code></para><para>Used by template <code><link linkend="template-merge-tan-docs">ŧ merge-tan-docs</link></code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-prep-div-refs-pass-2"><title><code>ŧ prep-div-refs-pass-2</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:div[not(tan:ref[tan:_n-integer])]' mode='prep-div-refs-pass-2' /&gt;</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-prepend-line-break"><title><code>ŧ prepend-line-break</code></title><bridgehead><code>TAN-extra-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='* | processing-instruction() | comment()' mode='prepend-line-break' /&gt;</code></para><programlisting>Useful for breaking up XML content that is not indented </programlisting><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-process-appended-div"><title><code>ŧ process-appended-div</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:group' mode='process-appended-div' /&gt;</code></para><para><code>&lt;xsl:template match='tan:div' mode='process-appended-div' /&gt;</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>, <code><link linkend="template-strip-divs-to-reset">ŧ strip-divs-to-reset</link></code>.</para></section><section xml:id="template-process-merged-div"><title><code>ŧ process-merged-div</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:div' mode='process-merged-div' /&gt;</code></para><para>Used by template <code><link linkend="template-reset-hierarchy">ŧ reset-hierarchy</link></code>.</para><para>Relies upon <code><link linkend="template-strip-divs-to-reset">ŧ strip-divs-to-reset</link></code>.</para></section><section xml:id="template-remove-duplicate-siblings"><title><code>ŧ remove-duplicate-siblings</code></title><bridgehead><code>TAN-extra-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*' mode='remove-duplicate-siblings' /&gt;</code></para><para>Used by function <code><link linkend="function-remove-duplicate-siblings">tan:remove-duplicate-siblings</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-remove-first-token"><title><code>ŧ remove-first-token</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:div[not(tan:div)]' mode='remove-first-token' /&gt;</code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-remove-inclusions"><title><code>ŧ remove-inclusions</code></title><bridgehead><code>TAN-core-expand-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:inclusion' mode='remove-inclusions' /&gt;</code></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-attribute-vocabulary">tan:attribute-vocabulary</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-reset-hierarchy"><title><code>ŧ reset-hierarchy</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='/' mode='reset-hierarchy' /&gt;</code></para><para><code>&lt;xsl:template match='tan:head' mode='reset-hierarchy' /&gt;</code></para><para><code>&lt;xsl:template match='tan:div[tan:ref/@reset]' mode='reset-hierarchy clean-reset-divs-2' /&gt;</code></para><para><code>&lt;xsl:template match='tan:body | tan:div' mode='reset-hierarchy' /&gt;</code></para><programlisting>divs to reset fall into three categories: 1. those that should be merged with the 
current div, because there's an exact match on the ref 2. those that should be passed on to 
children because of a match on the n in the next level children 3. those that should be appended 
as last children Any attempts to merge leaf divs with non-leaf divs should trigger an 
error message, to be imprinted in the adjustment action marker that caused the reset. </programlisting><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>, <code><link linkend="function-reset-hierarchy-loop">tan:reset-hierarchy-loop</link>()</code>, <code><link linkend="function-reset-hierarchy">tan:reset-hierarchy</link>()</code>.</para><para>Relies upon <code><link linkend="function-reset-hierarchy-loop">tan:reset-hierarchy-loop</link>()</code>, <code><link linkend="template-process-appended-div">ŧ process-appended-div</link></code>, <code><link linkend="template-process-merged-div">ŧ process-merged-div</link></code>.</para></section><section xml:id="template-resolve-critical-dependencies"><title><code>ŧ resolve-critical-dependencies</code></title><bridgehead><code>catalog.tan-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='collection' priority='2' mode='get-undefined-idrefs resolve-critical-dependencies apply-inclusions-and-adjust-vocabulary resolve-numerals       core-expansion-terse core-expansion-normal core-expansion-verbose core-expansion-terse-attributes' /&gt;</code></para><para>Used by template <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code>.</para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>, <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-resolve-critical-dependencies-loop"><title><code>ŧ resolve-critical-dependencies-loop</code></title><bridgehead><code>TAN-core-resolve-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:inclusion[tan:location] | tan:vocabulary[tan:location]' mode='resolve-critical-dependencies-loop' /&gt;</code></para><para><code>&lt;xsl:template match='tan:inclusion/tan:IRI | tan:vocabulary/tan:IRI' mode='resolve-critical-dependencies-loop' /&gt;</code></para><para><code>&lt;xsl:template match='tan:inclusion/tan:location[@href] | tan:vocabulary/tan:location[@href]' mode='resolve-critical-dependencies-loop' /&gt;</code></para><para><code>&lt;xsl:template match='tan:vocabulary-key' mode='resolve-critical-dependencies-loop' /&gt;</code></para><programlisting>We send all vocabulary filters through the official TAN vocabularies; these will 
come out as <code><link linkend="element-TAN-voc">&lt;TAN-voc&gt;</link></code> elements, which will get fixed in the next step </programlisting><para>Used by function <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>.</para><para>Relies upon <code><link linkend="variable-TAN-version">$TAN-version</link></code>, <code><link linkend="variable-TAN-vocabularies">$TAN-vocabularies</link></code>, <code><link linkend="variable-doc-id">$doc-id</link></code>, <code><link linkend="function-base-uri">tan:base-uri</link>()</code>, <code><link linkend="function-error">tan:error</link>()</code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>, <code><link linkend="function-is-valid-uri">tan:is-valid-uri</link>()</code>, <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>, <code><link linkend="function-shallow-copy">tan:shallow-copy</link>()</code>, <code><link linkend="template-first-stamp-shallow-skip">ŧ first-stamp-shallow-skip</link></code>.</para></section><section xml:id="template-resolve-href"><title><code>ŧ resolve-href</code></title><bridgehead><code>TAN-core-resolve-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='/*' mode='first-stamp-shallow-skip first-stamp-shallow-copy resolve-href' /&gt;</code></para><para><code>&lt;xsl:template match='processing-instruction()' mode='resolve-href first-stamp-shallow-copy' /&gt;</code></para><para><code>&lt;xsl:template match='*[@href]' mode='resolve-href expand-standard-tan-voc' /&gt;</code></para><para>Used by template <code><link linkend="template-first-stamp-shallow-skip">ŧ first-stamp-shallow-skip</link></code>, <code><link linkend="template-resolve-critical-dependencies-loop">ŧ resolve-critical-dependencies-loop</link></code>.</para><para>Used by function <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>, <code><link linkend="function-resolve-href">tan:resolve-href</link>()</code>, <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>()</code>, <code><link linkend="function-tokenize-text">tan:tokenize-text</link>()</code>.</para><para>Relies upon <code><link linkend="function-base-uri">tan:base-uri</link>()</code>, <code><link linkend="function-shallow-copy">tan:shallow-copy</link>()</code>.</para></section><section xml:id="template-resolve-numerals"><title><code>ŧ resolve-numerals</code></title><bridgehead><code>catalog.tan-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='collection' priority='2' mode='get-undefined-idrefs resolve-critical-dependencies apply-inclusions-and-adjust-vocabulary resolve-numerals       core-expansion-terse core-expansion-normal core-expansion-verbose core-expansion-terse-attributes' /&gt;</code></para><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tei:div[not(tei:div)]/tei:*' priority='1' mode='resolve-numerals core-expansion-terse-attributes' /&gt;</code></para><bridgehead><code>TAN-core-resolve-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='/*' priority='1' mode='resolve-numerals' /&gt;</code></para><para><code>&lt;xsl:template match='*[@include] | tan:inclusion' priority='1' mode='resolve-numerals' /&gt;</code></para><para><code>&lt;xsl:template match='*:div[@n]' mode='resolve-numerals' /&gt;</code></para><para><code>&lt;xsl:template match='tan:ref | tan:n' mode='resolve-numerals' priority='1' /&gt;</code></para><programlisting>This part of resolve numerals handles class 2 references that have already been 
expanded from attributes to elements. </programlisting><programlisting>Because class-2 <code><link linkend="attribute-ref">@ref</link></code> and <code><link linkend="attribute-n">@n</link></code> are never tethered to a div type, we cannot enforce the 
constraints in the source class-1 file's <code><link linkend="element-n-alias">&lt;n-alias&gt;</link></code> </programlisting><para>Used by template <code><link linkend="template-dependency-adjustments-pass-1">ŧ dependency-adjustments-pass-1</link></code>.</para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>, <code><link linkend="function-resolve-doc-loop">tan:resolve-doc-loop</link>()</code>.</para><para>Relies upon <code><link linkend="function-error">tan:error</link>()</code>, <code><link linkend="function-string-to-numerals">tan:string-to-numerals</link>()</code>.</para></section><section xml:id="template-revise-hrefs"><title><code>ŧ revise-hrefs</code></title><bridgehead><code>TAN-extra-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='node() | @*' mode='revise-hrefs' /&gt;</code></para><para><code>&lt;xsl:template match='processing-instruction()' priority='1' mode='revise-hrefs' /&gt;</code></para><para><code>&lt;xsl:template match='@href' mode='revise-hrefs' /&gt;</code></para><para><code>&lt;xsl:template match='html:script/@src' mode='revise-hrefs' /&gt;</code></para><para>Used by function <code><link linkend="function-revise-hrefs">tan:revise-hrefs</link>()</code>.</para><para>Relies upon <code><link linkend="function-uri-relative-to">tan:uri-relative-to</link>()</code>.</para></section><section xml:id="template-selective-shallow-skip"><title><code>ŧ selective-shallow-skip</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='* | comment() | processing-instruction()' mode='selective-shallow-skip' /&gt;</code></para><para>Used by template <code><link linkend="template-core-expansion-terse">ŧ core-expansion-terse</link></code> dependency-adjustments-pass-1 normalize-tei-space.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-sequence-to-tree"><title><code>ŧ sequence-to-tree</code></title><bridgehead><code>TAN-extra-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*' mode='sequence-to-tree' /&gt;</code></para><para>Used by function <code><link linkend="function-sequence-to-tree">tan:sequence-to-tree</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-shallow-copy"><title><code>ŧ shallow-copy</code></title><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='node() | document-node()' mode='shallow-copy' /&gt;</code></para><para>Used by function <code><link linkend="function-shallow-copy">tan:shallow-copy</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-snap-to-word-pass-1"><title><code>ŧ snap-to-word-pass-1</code></title><bridgehead><code>TAN-core-string-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:common' mode='snap-to-word-pass-1' /&gt;</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-stamp-q-id"><title><code>ŧ stamp-q-id</code></title><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*' mode='stamp-q-id' /&gt;</code></para><para>Used by function <code><link linkend="function-stamp-q-id">tan:stamp-q-id</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-stamp-with-src-attr"><title><code>ŧ stamp-with-src-attr</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:_weight | tan:_rel-pos | tan:_n-pos | tan:_n-integer | tan:non-numbered' mode='merge-tan-docs merge-tan-doc-leaf-divs stamp-with-src-attr' /&gt;</code></para><para>Used by template <code><link linkend="template-merge-tan-docs">ŧ merge-tan-docs</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="template-string-to-numerals"><title><code>ŧ string-to-numerals</code></title><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:tok' mode='string-to-numerals' /&gt;</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="variable-n-type">$n-type</link></code>, <code><link linkend="variable-n-type-pattern">$n-type-pattern</link></code>, <code><link linkend="variable-separator-hierarchy-minor">$separator-hierarchy-minor</link></code>, <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="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><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*' mode='strip-all-attributes-except' /&gt;</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-dependencies-to-markers"><title><code>ŧ strip-dependencies-to-markers</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:head | text()' mode='strip-dependencies-to-markers' /&gt;</code></para><para><code>&lt;xsl:template match='/*' mode='strip-dependencies-to-markers' /&gt;</code></para><para><code>&lt;xsl:template match='*' mode='strip-dependencies-to-markers' /&gt;</code></para><para><code>&lt;xsl:template match='tan:skip | tan:rename | tan:equate | tan:reassign | tan:ref | tan:pos | tan:chars | tan:tok[@val]' mode='strip-dependencies-to-markers' /&gt;</code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-strip-divs-to-reset"><title><code>ŧ strip-divs-to-reset</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:rename | tan:reassign' mode='strip-divs-to-reset' /&gt;</code></para><para><code>&lt;xsl:template match='tan:ref[@reset]' mode='strip-divs-to-reset' /&gt;</code></para><para><code>&lt;xsl:template match='tan:div[tan:ref[@reset]]' mode='strip-divs-to-reset' /&gt;</code></para><para>Used by template <code><link linkend="template-process-merged-div">ŧ process-merged-div</link></code>, <code><link linkend="template-process-appended-div">ŧ process-appended-div</link></code>.</para><para>Used by function <code><link linkend="function-reset-hierarchy-loop">tan:reset-hierarchy-loop</link>()</code>.</para><para>Relies upon <code><link linkend="function-error">tan:error</link>()</code>.</para></section><section xml:id="template-strip-duplicate-children-by-attribute-value"><title><code>ŧ strip-duplicate-children-by-attribute-value</code></title><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*' mode='strip-duplicate-children-by-attribute-value' /&gt;</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-for-validation"><title><code>ŧ strip-for-validation</code></title><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='* | text()' priority='-3' mode='strip-for-validation' /&gt;</code></para><para><code>&lt;xsl:template match='*[tan:error | tan:help | tan:warning | tan:fix | tan:fatal | tan:info]' priority='-2' mode='strip-for-validation' /&gt;</code></para><para><code>&lt;xsl:template match='tan:error | tan:help | tan:warning | tan:fix | tan:fatal | tan:info' priority='-1' mode='strip-for-validation' /&gt;</code></para><para><code>&lt;xsl:template match='/*' priority='-1' mode='strip-for-validation' /&gt;</code></para><para>Used by function <code><link linkend="function-expand-doc">tan:expand-doc</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><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*' mode='strip-specific-attributes' /&gt;</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><bridgehead><code>TAN-extra-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='text()' mode='strip-text' /&gt;</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-tan-a-lm-expansion-terse"><title><code>ŧ tan-a-lm-expansion-terse</code></title><bridgehead><code>TAN-A-lm-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:m' mode='tan-a-lm-expansion-terse' /&gt;</code></para><para><code>&lt;xsl:template match='tan:f[text()]' mode='tan-a-lm-expansion-terse' /&gt;</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-all-conditions-hold">tan:all-conditions-hold</link>()</code>, <code><link linkend="function-error">tan:error</link>()</code>, <code><link linkend="function-shallow-copy">tan:shallow-copy</link>()</code>, <code><link linkend="function-vocabulary">tan:vocabulary</link>()</code>, <code><link linkend="function-xml-to-string">tan:xml-to-string</link>()</code>, <code><link linkend="template-element-to-error">ŧ element-to-error</link></code>.</para></section><section xml:id="template-text-join"><title><code>ŧ text-join</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='* | text()' mode='text-join' /&gt;</code></para><para><code>&lt;xsl:template match='/tan:*/tan:expanded[1]' mode='text-join' /&gt;</code></para><para><code>&lt;xsl:template match='*:div[not(*:div)]' mode='text-join' /&gt;</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="function-text-join">tan:text-join</link>()</code>.</para></section><section xml:id="template-text-only"><title><code>ŧ text-only</code></title><bridgehead><code>TAN-extra-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='* | comment() | processing-instruction()' mode='text-only' /&gt;</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-title-case"><title><code>ŧ title-case</code></title><bridgehead><code>TAN-extra-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:word[1] | tan:word[last()]' mode='title-case' /&gt;</code></para><para>Used by function <code><link linkend="function-title-case">tan:title-case</link>()</code>.</para><para>Relies upon <code><link linkend="function-initial-upper-case">tan:initial-upper-case</link>()</code>.</para></section><section xml:id="template-tokenize-div"><title><code>ŧ tokenize-div</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:div[not((tan:div, tan:tok))]/text()' mode='tokenize-div' /&gt;</code></para><para>Used by function <code><link linkend="function-tokenize-div">tan:tokenize-div</link>()</code>.</para><para>Relies upon <code><link linkend="variable-special-end-div-chars-regex">$special-end-div-chars-regex</link></code>, <code><link linkend="function-normalize-div-text">tan:normalize-div-text</link>()</code>, <code><link linkend="function-tokenize-text">tan:tokenize-text</link>()</code>.</para></section><section xml:id="template-tree-to-sequence"><title><code>ŧ tree-to-sequence</code></title><bridgehead><code>TAN-extra-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*' mode='tree-to-sequence' /&gt;</code></para><para>Used by function <code><link linkend="function-tree-to-sequence">tan:tree-to-sequence</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-trim-long-text"><title><code>ŧ trim-long-text</code></title><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='text()' mode='trim-long-text' /&gt;</code></para><para>Used by function <code><link linkend="function-trim-long-text">tan:trim-long-text</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-trim-or-add-text"><title><code>ŧ trim-or-add-text</code></title><bridgehead><code>TAN-core-3-0-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:a | tan:b | tan:common' mode='trim-or-add-text' /&gt;</code></para><para>Used by function <code><link linkend="function-adjust-diff">tan:adjust-diff</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-unmark-tokens"><title><code>ŧ unmark-tokens</code></title><bridgehead><code>TAN-class-1-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='tan:tok/* | tan:non-tok/*' mode='unmark-tokens' /&gt;</code></para><para>Used by template <code><link linkend="template-dependency-adjustments-pass-2">ŧ dependency-adjustments-pass-2</link></code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-uri-relative-to"><title><code>ŧ uri-relative-to</code></title><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='node() | @*' mode='uri-relative-to' /&gt;</code></para><para><code>&lt;xsl:template match='@href' mode='uri-relative-to' /&gt;</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:template.</para><para>Relies upon <code><link linkend="function-base-uri">tan:base-uri</link>()</code>, <code><link linkend="function-uri-relative-to">tan:uri-relative-to</link>()</code>.</para></section><section xml:id="template-vocabulary-all-vals"><title><code>ŧ vocabulary-all-vals</code></title><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*' mode='vocabulary-all-vals vocabulary-by-id vocabulary-by-name' /&gt;</code></para><programlisting>vocab trawling shallow skips by default </programlisting><para><code>&lt;xsl:template match='text() | comment() | processing-instruction()' mode='vocabulary-all-vals vocabulary-by-id vocabulary-by-name' /&gt;</code></para><para><code>&lt;xsl:template priority='1' match='tan:vocabulary | tan:tan-vocabulary' mode='vocabulary-all-vals vocabulary-by-id vocabulary-by-name' /&gt;</code></para><para><code>&lt;xsl:template priority='1' match='tan:vocabulary/tan:IRI | tan:vocabulary/tan:name | tan:vocabulary/tan:location |                      tan:tan-vocabulary/tan:IRI | tan:tan-vocabulary/tan:name | tan:tan-vocabulary/tan:location' mode='vocabulary-all-vals vocabulary-by-id vocabulary-by-name' /&gt;</code></para><para><code>&lt;xsl:template match='*[tan:IRI] | tan:token-definition | tan:item[tan:token-definition] | tan:claim' mode='vocabulary-all-vals' /&gt;</code></para><para>Used by function <code><link linkend="function-vocabulary">tan:vocabulary</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-vocabulary-by-id"><title><code>ŧ vocabulary-by-id</code></title><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*' mode='vocabulary-all-vals vocabulary-by-id vocabulary-by-name' /&gt;</code></para><programlisting>vocab trawling shallow skips by default </programlisting><para><code>&lt;xsl:template match='text() | comment() | processing-instruction()' mode='vocabulary-all-vals vocabulary-by-id vocabulary-by-name' /&gt;</code></para><para><code>&lt;xsl:template priority='1' match='tan:vocabulary | tan:tan-vocabulary' mode='vocabulary-all-vals vocabulary-by-id vocabulary-by-name' /&gt;</code></para><para><code>&lt;xsl:template priority='1' match='tan:vocabulary/tan:IRI | tan:vocabulary/tan:name | tan:vocabulary/tan:location |                      tan:tan-vocabulary/tan:IRI | tan:tan-vocabulary/tan:name | tan:tan-vocabulary/tan:location' mode='vocabulary-all-vals vocabulary-by-id vocabulary-by-name' /&gt;</code></para><para><code>&lt;xsl:template match='*[tan:id][tan:IRI] | tan:claim[tan:id]' mode='vocabulary-by-id' /&gt;</code></para><para>Used by function <code><link linkend="function-vocabulary">tan:vocabulary</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-vocabulary-by-name"><title><code>ŧ vocabulary-by-name</code></title><bridgehead><code>TAN-core-functions.xsl </code></bridgehead><para><code>&lt;xsl:template match='*' mode='vocabulary-all-vals vocabulary-by-id vocabulary-by-name' /&gt;</code></para><programlisting>vocab trawling shallow skips by default </programlisting><para><code>&lt;xsl:template match='text() | comment() | processing-instruction()' mode='vocabulary-all-vals vocabulary-by-id vocabulary-by-name' /&gt;</code></para><para><code>&lt;xsl:template priority='1' match='tan:vocabulary | tan:tan-vocabulary' mode='vocabulary-all-vals vocabulary-by-id vocabulary-by-name' /&gt;</code></para><para><code>&lt;xsl:template priority='1' match='tan:vocabulary/tan:IRI | tan:vocabulary/tan:name | tan:vocabulary/tan:location |                      tan:tan-vocabulary/tan:IRI | tan:tan-vocabulary/tan:name | tan:tan-vocabulary/tan:location' mode='vocabulary-all-vals vocabulary-by-id vocabulary-by-name' /&gt;</code></para><para><code>&lt;xsl:template match='*[tan:IRI][tan:name] | tan:token-definition | tan:item[tan:token-definition]' mode='vocabulary-by-name' /&gt;</code></para><para>Used by function <code><link linkend="function-vocabulary">tan:vocabulary</link>()</code>.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section></section><section><title>Cross-format functions</title><para>Some function definitions differ from one TAN format to
                           another.</para><section xml:id="function-collate"><title><code>tan:collate()</code></title><bridgehead><code>TAN-core-3-0-functions.xsl </code></bridgehead><programlisting>3-parameter version of fuller one, below </programlisting><programlisting>Input: a sequence of strings to be collated; a sequence of strings that label each 
string; a boolean indicating whether the sequence of input strings should be optimized; a 
boolean indicating whether the results of <code><link linkend="function-diff">tan:diff</link>()</code> should be processed and weighed; a 
boolean indicating whether the collation should be cleaned up. </programlisting><programlisting>Output: a <code>&lt;collation&gt;</code> with (1) one <code>&lt;witness&gt;</code> per string (and if the last parameter is 
true, then a sequence of children <code>&lt;commonality&gt;</code>s, signifying how close that string is 
with every other, and (2) a sequence of <code>&lt;c&gt;</code>s and <code>&lt;u&gt;</code>s, each with a <code>&lt;txt&gt;</code> and one or more &lt;wit 
ref="" pos=""/&gt;, indicating which string witness attests to the [c]ommon or [u]nique 
reading, and what position in that string the particular text fragment starts at. </programlisting><programlisting>If there are not enough labels (2nd parameter) for the input strings, the numerical 
position of the input string will be used as the string label / witness id. </programlisting><programlisting>If the third parameter is true, then <code><link linkend="function-diff">tan:diff</link>()</code> will be performed against each pair 
of strings. Each diff output will be weighed by closeness of the two texts, and sorted 
accordingly. The results of this operation will be stored in collation/witness/commonality. 
This requires (n-1)! operations, so should be efficient for a few input strings, but will 
grow progressively longer according to the number and size of the input strings. 
Preoptimizing strings will likely produces greater congruence in the <code>&lt;u&gt;</code> fragments. </programlisting><programlisting>If the last parameter is true, then cleanup will not be performed. This parameter was 
introduced because the cleanup process itself invokes <code><link linkend="function-collate">tan:collate</link>()</code> and one does not want to 
get into an endless loop because of a mishmash of differences that can never be 
reconciled or brought closer together. </programlisting><programlisting>This version of tan:collate was written in XSLT 3.0 to take advantage of 
xsl:iterate, and has an arity of 3 and 5 parameters to distinguish it from its XSLT 2.0 
predecessors, which used a different approach to collation. Tests comparing the two versions of 
<code><link linkend="function-collate">tan:collate</link>()</code> may be profitable. </programlisting><programlisting>Changes in output from previous version of <code><link linkend="function-collate">tan:collate</link>()</code>: - <code>@w</code> is now <code>&lt;wit&gt;</code> with <code><link linkend="attribute-ref">@ref</link></code> 
and <code><link linkend="attribute-pos">@pos</link></code> - the text node of <code>&lt;u&gt;</code> or <code>&lt;c&gt;</code> is now wrapped in <code>&lt;txt&gt;</code> - <code>@length</code> is ignored (the value 
is easily calculated) With these changes, any witness can be easily reconstructed 
with the XPath expression tan:collation/() </programlisting><bridgehead><code>TAN-core-string-functions.xsl </code></bridgehead><programlisting>one parameter version of full one below </programlisting><programlisting>Input: any number of strings </programlisting><programlisting>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. </programlisting><programlisting>This function was written to deal with multiple OCR results of the same page of text, 
to find agreement wherever possible. </programlisting><programlisting>This function was rewritten in 2020 as an XSLT 3.0 function, with 5-arity. </programlisting><para>Used by template <code><link linkend="template-clean-up-collation-pass-1">ŧ clean-up-collation-pass-1</link></code>.</para><para>Used by function <code><link linkend="function-collate">tan:collate</link>()</code>.</para><para>Relies upon <code><link linkend="function-adjust-diff">tan:adjust-diff</link>()</code>, <code><link linkend="function-collate">tan:collate</link>()</code>, <code><link linkend="function-collate-loop-outer">tan:collate-loop-outer</link>()</code>, <code><link linkend="function-diff">tan:diff</link>()</code>, <code><link linkend="function-diff-cache">tan:diff-cache</link>()</code>, <code><link linkend="function-diff-to-collation">tan:diff-to-collation</link>()</code>, <code><link linkend="function-most-common-item-count">tan:most-common-item-count</link>()</code>, <code><link linkend="function-trim-long-text">tan:trim-long-text</link>()</code>, <code><link linkend="template-clean-up-collation-pass-1">ŧ clean-up-collation-pass-1</link></code>, <code><link linkend="template-clean-up-collation-pass-2">ŧ clean-up-collation-pass-2</link></code>, <code><link linkend="template-diff-to-collation">ŧ diff-to-collation</link></code>.</para></section></section></chapter>