<?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 93 global variables, 3 keys, 161 functions, and 80 templates (Ŧ = named template; ŧ = template mode) defined in the TAN function library, are the following (ʞ = key):</para><para>ŧ #all </para>
<para><code><link linkend="function-aaa-to-int">tan:aaa-to-int</link></code>() <code><link linkend="template-add-lm-to-tok">ŧ add-lm-to-tok</link></code> <code><link linkend="template-add-square-brackets">ŧ add-square-brackets</link></code> <code><link linkend="function-add-tok-val">tan:add-tok-val</link></code>() <code><link linkend="template-add-tok-val">ŧ add-tok-val</link></code> <code><link linkend="variable-all-body-iris">$all-body-iris</link></code> <code><link linkend="variable-all-function-uses-of-error">$all-function-uses-of-error</link></code> <code><link linkend="variable-all-functions">$all-functions</link></code> <code><link linkend="variable-all-ids">$all-ids</link></code> <code><link linkend="variable-all-iris">$all-iris</link></code> <code><link linkend="variable-all-keywords">$all-keywords</link></code> <code><link linkend="function-all-morph-codes">tan:all-morph-codes</link></code>() <code><link linkend="variable-all-schema-uses-of-error">$all-schema-uses-of-error</link></code> <code><link linkend="variable-all-schemas">$all-schemas</link></code> <code><link linkend="variable-alphabet-numeral-key">$alphabet-numeral-key</link></code> <code><link linkend="function-ana-grouping-key">tan:ana-grouping-key</link></code>() <code><link linkend="template-analysis-stamp">ŧ analysis-stamp</link></code> <code><link linkend="function-analyze-elements-with-numeral-attributes">tan:analyze-elements-with-numeral-attributes</link></code>() <code><link linkend="function-analyze-ref">tan:analyze-ref</link></code>() <code><link linkend="template-analyze-ref">ŧ analyze-ref</link></code> <code><link linkend="function-analyze-stats">tan:analyze-stats</link></code>() <code><link linkend="function-analyze-string-length">tan:analyze-string-length</link></code>() <code><link linkend="function-analyze-tok-chars">tan:analyze-tok-chars</link></code>() <code><link linkend="variable-apos">$apos</link></code> <code><link linkend="function-arabic-numerals">tan:arabic-numerals</link></code>() <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code> </para>
<para><code><link linkend="function-base-uri">tan:base-uri</link></code>() <code><link linkend="function-batch-replace">tan:batch-replace</link></code>() <code><link linkend="variable-body">$body</link></code> </para>
<para><code><link linkend="template-c1-add-ref">ŧ c1-add-ref</link></code> <code><link linkend="template-c1-stamp-string-length">ŧ c1-stamp-string-length</link></code> <code><link linkend="template-c1-stamp-string-pos">ŧ c1-stamp-string-pos</link></code> <code><link linkend="function-cfn">tan:cfn</link></code>() <code><link linkend="variable-char-reg-exp">$char-reg-exp</link></code> <code><link linkend="template-char-setup">ŧ char-setup</link></code> <code><link linkend="function-chop-string">tan:chop-string</link></code>() <code><link linkend="template-class-1-copy-errors">ŧ class-1-copy-errors</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-class-2-errors">ŧ class-2-errors</link></code> <code><link linkend="function-class-number">tan:class-number</link></code>() <code><link linkend="function-compare-copies">tan:compare-copies</link></code>() <code><link linkend="template-compare-copies">ŧ compare-copies</link></code> <code><link linkend="variable-contexts-resolved">$contexts-resolved</link></code> <code><link linkend="function-convert-code-to-features">tan:convert-code-to-features</link></code>() <code><link linkend="template-convert-code-to-features">ŧ convert-code-to-features</link></code> <code><link linkend="function-convert-ref-to-div-fragment">tan:convert-ref-to-div-fragment</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-attribute-errors">ŧ core-attribute-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-count-tokenized-class-1">ŧ count-tokenized-class-1</link></code> <code><link linkend="template-count-tokens">ŧ count-tokens</link></code> <code><link linkend="function-counts-to-firsts">tan:counts-to-firsts</link></code>() <code><link linkend="function-counts-to-lasts">tan:counts-to-lasts</link></code>() <code><link linkend="template-cull-prepped-class-1">ŧ cull-prepped-class-1</link></code> <code><link linkend="function-cull-prepped-class-1-data">tan:cull-prepped-class-1-data</link></code>() </para>
<para><code><link linkend="function-data-type-check">tan:data-type-check</link></code>() <code><link linkend="function-dateTime-to-decimal">tan:dateTime-to-decimal</link></code>() <code><link linkend="function-dec-to-hex">tan:dec-to-hex</link></code>() <code><link linkend="function-diff">tan:diff</link></code>() <code><link linkend="function-diff-core">tan:diff-core</link></code>() <code><link linkend="function-diff-core-draft">tan:diff-core-draft</link></code>() <code><link linkend="function-diff-loop">tan:diff-loop</link></code>() <code><link linkend="template-diff-rectify">ŧ diff-rectify</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="variable-doc-id">$doc-id</link></code> <code><link linkend="variable-doc-namespace">$doc-namespace</link></code> <code><link linkend="variable-doc-parent-directory">$doc-parent-directory</link></code> <code><link linkend="variable-doc-uri">$doc-uri</link></code> <code><link linkend="template-drop-tokenization">ŧ drop-tokenization</link></code> <code><link linkend="variable-duplicate-ids">$duplicate-ids</link></code> <code><link linkend="variable-duplicate-iris">$duplicate-iris</link></code> <code><link linkend="function-duplicate-values">tan:duplicate-values</link></code>() </para>
<para><code><link linkend="function-element-key">tan:element-key</link></code>() <code><link linkend="variable-elements-that-must-always-refer-to-tan-files">$elements-that-must-always-refer-to-tan-files</link></code> <code><link linkend="variable-empty-doc">$empty-doc</link></code> <code><link linkend="variable-erroneously-looped-doc">$erroneously-looped-doc</link></code> <code><link linkend="function-error">tan:error</link></code>() <code><link linkend="function-error-report">tan:error-report</link></code>() <code><link linkend="variable-errors">$errors</link></code> <code><link linkend="variable-errors-not-used">$errors-not-used</link></code> <code><link linkend="function-escape">tan:escape</link></code>() <code><link linkend="template-expand-lm">ŧ expand-lm</link></code> <code><link linkend="function-expand-m">tan:expand-m</link></code>() <code><link linkend="function-expand-per-lm">tan:expand-per-lm</link></code>() <code><link linkend="function-expand-search">tan:expand-search</link></code>() <code><link linkend="function-expand-src-and-div-type-ref">tan:expand-src-and-div-type-ref</link></code>() <code><link linkend="function-expand-tok">tan:expand-tok</link></code>() </para>
<para><code><link linkend="function-feature-test-check">tan:feature-test-check</link></code>() <code><link linkend="function-feature-test-to-groups">tan:feature-test-to-groups</link></code>() <code><link linkend="variable-features-grouped">$features-grouped</link></code> <code><link linkend="variable-features-prepped">$features-prepped</link></code> <code><link linkend="function-first-loc-available">tan:first-loc-available</link></code>() <code><link linkend="template-first-stamp">ŧ first-stamp</link></code> <code><link linkend="function-fix">tan:fix</link></code>() <code><link linkend="function-flatref">tan:flatref</link></code>() <code><link linkend="function-fragment-to-text">tan:fragment-to-text</link></code>() <code><link linkend="template-fragment-to-text">ŧ fragment-to-text</link></code> <code><link linkend="variable-function-error-ids">$function-error-ids</link></code> </para>
<para><code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code>() <code><link linkend="function-get-context-prepped">tan:get-context-prepped</link></code>() <code><link linkend="template-get-div-hierarchy-fragment">ŧ get-div-hierarchy-fragment</link></code> <code><link linkend="function-get-doc-hist">tan:get-doc-hist</link></code>() <code><link linkend="function-get-lm-ids">tan:get-lm-ids</link></code>() <code><link linkend="function-get-matching-lm-combos">tan:get-matching-lm-combos</link></code>() <code><link linkend="function-get-matching-ls-or-ms">tan:get-matching-ls-or-ms</link></code>() <code><link linkend="template-get-mismatched-text">ŧ get-mismatched-text</link></code> <code><link linkend="function-get-n-types">tan:get-n-types</link></code>() <code><link linkend="function-get-parent-elements">tan:get-parent-elements</link></code>() <code><link linkend="function-get-picked-srcs-id-refs">tan:get-picked-srcs-id-refs</link></code>() <code><link linkend="function-get-ref-seq">tan:get-ref-seq</link></code>() <code><link linkend="function-get-src-1st-da">tan:get-src-1st-da</link></code>() <code><link linkend="function-get-src-1st-da-analysis-stamped">tan:get-src-1st-da-analysis-stamped</link></code>() <code><link linkend="function-get-src-1st-da-chars-picked">tan:get-src-1st-da-chars-picked</link></code>() <code><link linkend="function-get-src-1st-da-resolved">tan:get-src-1st-da-resolved</link></code>() <code><link linkend="function-get-src-1st-da-segmented">tan:get-src-1st-da-segmented</link></code>() <code><link linkend="function-get-src-1st-da-statted">tan:get-src-1st-da-statted</link></code>() <code><link linkend="function-get-src-1st-da-tokenized">tan:get-src-1st-da-tokenized</link></code>() <code><link linkend="function-get-src-1st-da-with-lms">tan:get-src-1st-da-with-lms</link></code>() <code><link linkend="function-get-src-skeleton">tan:get-src-skeleton</link></code>() <code><link linkend="function-get-toks">tan:get-toks</link></code>() <code><link linkend="function-get-ucd-decomp">tan:get-ucd-decomp</link></code>() <code><link linkend="function-get-via-q-ref">tan:get-via-q-ref</link></code>() <code><link linkend="function-glossary">tan:glossary</link></code>() <code><link linkend="function-grc-to-int">tan:grc-to-int</link></code>() <code><link linkend="variable-greek-letter-numeral-pattern">$greek-letter-numeral-pattern</link></code> <code><link linkend="function-group-adjacent-elements">tan:group-adjacent-elements</link></code>() <code><link linkend="function-group-by-IRIs">tan:group-by-IRIs</link></code>() <code><link linkend="function-group-by-IRIs-loop">tan:group-by-IRIs-loop</link></code>() <code><link linkend="function-group-tok-elements">tan:group-tok-elements</link></code>() </para>
<para><code><link linkend="function-has-relationship">tan:has-relationship</link></code>() <code><link linkend="variable-head">$head</link></code> <code><link linkend="function-help">tan:help</link></code>() <code><link linkend="function-help-or-info">tan:help-or-info</link></code>() <code><link linkend="function-help-requested">tan:help-requested</link></code>() <code><link linkend="variable-help-trigger-regex">$help-trigger-regex</link></code> <code><link linkend="variable-hex-key">$hex-key</link></code> <code><link linkend="function-hex-to-dec">tan:hex-to-dec</link></code>() </para>
<para><code><link linkend="variable-id-idrefs">$id-idrefs</link></code> <code><link linkend="function-idrefs">tan:idrefs</link></code>() <code><link linkend="function-idrefs-loop">tan:idrefs-loop</link></code>() <code><link linkend="template-include">ŧ include</link></code> <code><link linkend="variable-inclusions-1st-da">$inclusions-1st-da</link></code> <code><link linkend="variable-inclusions-resolved">$inclusions-resolved</link></code> <code><link linkend="function-info">tan:info</link></code>() <code><link linkend="template-infuse-tokenized-div">ŧ infuse-tokenized-div</link></code> <code><link linkend="template-infuse-tokenized-text">ŧ infuse-tokenized-text</link></code> <code><link linkend="template-insert-seg-into-leaf-divs-in-hierarchy-fragment">ŧ insert-seg-into-leaf-divs-in-hierarchy-fragment</link></code> <code><link linkend="function-interpret-n-vals">tan:interpret-n-vals</link></code>() <code><link linkend="key-item-via-node-name">ʞ item-via-node-name</link></code>') </para>
<para><code><link linkend="variable-keys-1st-da">$keys-1st-da</link></code> <code><link linkend="variable-keys-prepped">$keys-prepped</link></code> <code><link linkend="variable-keys-resolved">$keys-resolved</link></code> </para>
<para><code><link linkend="variable-l-grouping-key-key">$l-grouping-key-key</link></code> <code><link linkend="variable-latin-letter-numeral-pattern">$latin-letter-numeral-pattern</link></code> <code><link linkend="function-letter-to-number">tan:letter-to-number</link></code>() </para>
<para><code><link linkend="variable-m-grouping-key-key">$m-grouping-key-key</link></code> <code><link linkend="function-mark-splits">tan:mark-splits</link></code>() <code><link linkend="template-mark-splits">ŧ mark-splits</link></code> <code><link linkend="template-mark-splits-in-fragment">ŧ mark-splits-in-fragment</link></code> <code><link linkend="template-mark-tok-chars">ŧ mark-tok-chars</link></code> <code><link linkend="function-matches">tan:matches</link></code>() <code><link linkend="function-max-integer">tan:max-integer</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="template-merge-nodes">Ŧ merge-nodes</link></code> <code><link linkend="function-merge-source-loop">tan:merge-source-loop</link></code>() <code><link linkend="function-merge-sources">tan:merge-sources</link></code>() <code><link linkend="function-merge-tan-a-div-prepped">tan:merge-tan-a-div-prepped</link></code>() <code><link linkend="function-min-last">tan:min-last</link></code>() <code><link linkend="variable-morphologies-prepped">$morphologies-prepped</link></code> <code><link linkend="function-most-common-value">tan:most-common-value</link></code>() <code><link linkend="function-most-recent-dateTime">tan:most-recent-dateTime</link></code>() <code><link linkend="function-must-refer-to-external-tan-file">tan:must-refer-to-external-tan-file</link></code>() </para>
<para><code><link linkend="variable-n-type">$n-type</link></code> <code><link linkend="variable-n-type-label">$n-type-label</link></code> <code><link linkend="variable-n-type-pattern">$n-type-pattern</link></code> <code><link linkend="function-no-outliers">tan:no-outliers</link></code>() <code><link linkend="variable-nonlatin-letter-numeral-pattern">$nonlatin-letter-numeral-pattern</link></code> <code><link linkend="function-normalize-div-text">tan:normalize-div-text</link></code>() <code><link linkend="function-normalize-doc-space">tan:normalize-doc-space</link></code>() <code><link linkend="function-normalize-refs">tan:normalize-refs</link></code>() <code><link linkend="template-normalize-space">ŧ normalize-space</link></code> <code><link linkend="function-normalize-text">tan:normalize-text</link></code>() <code><link linkend="variable-now">$now</link></code> <code><link linkend="function-number-sort">tan:number-sort</link></code>() <code><link linkend="function-number-type">tan:number-type</link></code>() </para>
<para><code><link linkend="function-obeyed-by-m">tan:obeyed-by-m</link></code>() <code><link linkend="function-ordinal">tan:ordinal</link></code>() <code><link linkend="function-outliers">tan:outliers</link></code>() </para>
<para><code><link linkend="template-pick-prepped-class-1">ŧ pick-prepped-class-1</link></code> <code><link linkend="function-pick-prepped-class-1-data">tan:pick-prepped-class-1-data</link></code>() <code><link linkend="function-pluck">tan:pluck</link></code>() <code><link linkend="template-pluck">ŧ pluck</link></code> <code><link linkend="template-prep-class-1">ŧ prep-class-1</link></code> <code><link linkend="template-prep-class-2-doc-pass-1">ŧ prep-class-2-doc-pass-1</link></code> <code><link linkend="function-prep-class-2-doc-pass-2">tan:prep-class-2-doc-pass-2</link></code>() <code><link linkend="template-prep-class-2-doc-pass-2">ŧ prep-class-2-doc-pass-2</link></code> <code><link linkend="function-prep-class-2-doc-pass-3">tan:prep-class-2-doc-pass-3</link></code>() <code><link linkend="template-prep-class-2-doc-pass-3">ŧ prep-class-2-doc-pass-3</link></code> <code><link linkend="template-prep-class-2-doc-pass-3-old">ŧ prep-class-2-doc-pass-3-old</link></code> <code><link linkend="function-prep-class-2-doc-pass-4">tan:prep-class-2-doc-pass-4</link></code>() <code><link linkend="template-prep-class-2-doc-pass-4">ŧ prep-class-2-doc-pass-4</link></code> <code><link linkend="template-prep-regex-char-class">ŧ prep-regex-char-class</link></code> <code><link linkend="function-prep-resolved-class-1-doc">tan:prep-resolved-class-1-doc</link></code>() <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>() <code><link linkend="function-prep-resolved-tan-a-div-doc">tan:prep-resolved-tan-a-div-doc</link></code>() <code><link linkend="template-prep-rim-pass-1">ŧ prep-rim-pass-1</link></code> <code><link linkend="template-prep-rim-pass-2">ŧ prep-rim-pass-2</link></code> <code><link linkend="template-prep-srcs-verbosely">ŧ prep-srcs-verbosely</link></code> <code><link linkend="template-prep-tan-a-div-pass-3-prelim">ŧ prep-tan-a-div-pass-3-prelim</link></code> <code><link linkend="template-prep-tan-a-div-pass-a">ŧ prep-tan-a-div-pass-a</link></code> <code><link linkend="template-prep-tan-a-div-pass-b">ŧ prep-tan-a-div-pass-b</link></code> <code><link linkend="function-prep-tan-a-div-sources-for-merge">tan:prep-tan-a-div-sources-for-merge</link></code>() <code><link linkend="function-prep-TAN-claims">tan:prep-TAN-claims</link></code>() <code><link linkend="template-prep-tan-claims">ŧ prep-tan-claims</link></code> <code><link linkend="template-prep-tan-key">ŧ prep-tan-key</link></code> <code><link linkend="template-prep-tan-lm">ŧ prep-tan-lm</link></code> <code><link linkend="function-prep-TAN-LM-doc-prepped">tan:prep-TAN-LM-doc-prepped</link></code>() <code><link linkend="function-prep-TAN-mor">tan:prep-TAN-mor</link></code>() <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> <code><link linkend="function-prep-verbosely">tan:prep-verbosely</link></code>() <code><link linkend="template-prep-verbosely">ŧ prep-verbosely</link></code> <code><link linkend="template-prepare-class-1-doc-for-merge">ŧ prepare-class-1-doc-for-merge</link></code> <code><link linkend="function-prepend-id-or-idrefs">tan:prepend-id-or-idrefs</link></code>() <code><link linkend="template-prepend-id-or-idrefs">ŧ prepend-id-or-idrefs</link></code> <code><link linkend="variable-primary-agent">$primary-agent</link></code> <code><link linkend="function-process-regex-escape-k">tan:process-regex-escape-k</link></code>() <code><link linkend="function-process-splits">tan:process-splits</link></code>() <code><link linkend="template-process-splits">ŧ process-splits</link></code> <code><link linkend="function-product">tan:product</link></code>() <code><link linkend="function-product-loop">tan:product-loop</link></code>() </para>
<para><code><link linkend="key-q-ref">ʞ q-ref</link></code>') <code><link linkend="function-q-ref">tan:q-ref</link></code>() <code><link linkend="variable-quot">$quot</link></code> </para>
<para><code><link linkend="function-raw-diff">tan:raw-diff</link></code>() <code><link linkend="function-raw-diff-loop">tan:raw-diff-loop</link></code>() <code><link linkend="template-realign-tan-a-div-sources">ŧ realign-tan-a-div-sources</link></code> <code><link linkend="function-rebuild-ana-fragment">tan:rebuild-ana-fragment</link></code>() <code><link linkend="function-recombine-docs">tan:recombine-docs</link></code>() <code><link linkend="template-referenced-doc-errors">ŧ referenced-doc-errors</link></code> <code><link linkend="function-regex">tan:regex</link></code>() <code><link linkend="variable-regex-characters-not-permitted">$regex-characters-not-permitted</link></code> <code><link linkend="variable-regex-escaping-characters">$regex-escaping-characters</link></code> <code><link linkend="variable-relationship-keywords-for-tan-files">$relationship-keywords-for-tan-files</link></code> <code><link linkend="function-remodel-div-ref">tan:remodel-div-ref</link></code>() <code><link linkend="function-replace">tan:replace</link></code>() <code><link linkend="template-resolve-attr-include">ŧ resolve-attr-include</link></code> <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>() <code><link linkend="template-resolve-href">ŧ resolve-href</link></code> <code><link linkend="function-resolve-keyword">tan:resolve-keyword</link></code>() <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code> <code><link linkend="variable-rng-collection">$rng-collection</link></code> <code><link linkend="variable-rng-collection-without-TEI">$rng-collection-without-TEI</link></code> <code><link linkend="function-rom-to-int">tan:rom-to-int</link></code>() <code><link linkend="variable-roman-numeral-pattern">$roman-numeral-pattern</link></code> <code><link linkend="variable-root">$root</link></code> </para>
<para><code><link linkend="variable-schema-collection">$schema-collection</link></code> <code><link linkend="variable-schema-error-ids">$schema-error-ids</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-segment-tokd-prepped-class-1">ŧ segment-tokd-prepped-class-1</link></code> <code><link linkend="variable-self-and-sources-prepped">$self-and-sources-prepped</link></code> <code><link linkend="variable-self-and-sources-prepped-prelim">$self-and-sources-prepped-prelim</link></code> <code><link linkend="variable-self-class-1-errors-marked">$self-class-1-errors-marked</link></code> <code><link linkend="variable-self-core-errors-marked">$self-core-errors-marked</link></code> <code><link linkend="variable-self-leaf-div-flatref-duplicates">$self-leaf-div-flatref-duplicates</link></code> <code><link linkend="variable-self-leaf-div-flatrefs">$self-leaf-div-flatrefs</link></code> <code><link linkend="variable-self-prepped">$self-prepped</link></code> <code><link linkend="variable-self-resolved">$self-resolved</link></code> <code><link linkend="variable-sep-1">$sep-1</link></code> <code><link linkend="variable-sep-2">$sep-2</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-hierarchy-minor-regex">$separator-hierarchy-minor-regex</link></code> <code><link linkend="variable-separator-hierarchy-regex">$separator-hierarchy-regex</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-expand">tan:sequence-expand</link></code>() <code><link linkend="function-shallow-copy">tan:shallow-copy</link></code>() <code><link linkend="function-shallow-equal">tan:shallow-equal</link></code>() <code><link linkend="template-snap-to-word-pass-1">ŧ snap-to-word-pass-1</link></code> <code><link linkend="variable-soft-hyphen">$soft-hyphen</link></code> <code><link linkend="variable-source-ids">$source-ids</link></code> <code><link linkend="variable-source-lacks-id">$source-lacks-id</link></code> <code><link linkend="variable-sources-1st-da">$sources-1st-da</link></code> <code><link linkend="variable-sources-prepped">$sources-prepped</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="template-split-marked-fragment">ŧ split-marked-fragment</link></code> <code><link linkend="variable-src-elements">$src-elements</link></code> <code><link linkend="variable-src-ids">$src-ids</link></code> <code><link linkend="template-stamp-element-id">ŧ stamp-element-id</link></code> <code><link linkend="function-stamp-id">tan:stamp-id</link></code>() <code><link linkend="function-string-base">tan:string-base</link></code>() <code><link linkend="function-string-composite">tan:string-composite</link></code>() <code><link linkend="function-string-length">tan:string-length</link></code>() <code><link linkend="function-strings-to-numeral-or-numeral-type">tan:strings-to-numeral-or-numeral-type</link></code>() <code><link linkend="template-strip-all-attributes-except">ŧ strip-all-attributes-except</link></code> <code><link linkend="function-strip-duplicate-nodes">tan:strip-duplicate-nodes</link></code>() <code><link linkend="function-strip-duplicates">tan:strip-duplicates</link></code>() <code><link linkend="template-strip-duplicates">ŧ strip-duplicates</link></code> <code><link linkend="template-strip-specific-attributes">ŧ strip-specific-attributes</link></code> <code><link linkend="template-strip-text">ŧ strip-text</link></code> <code><link linkend="function-syc-to-int">tan:syc-to-int</link></code>() <code><link linkend="function-synthesize-merged-group">tan:synthesize-merged-group</link></code>() <code><link linkend="template-synthesize-merged-sources">ŧ synthesize-merged-sources</link></code> <code><link linkend="variable-syriac-letter-numeral-pattern">$syriac-letter-numeral-pattern</link></code> </para>
<para><code><link linkend="variable-tag-urn-regex-pattern">$tag-urn-regex-pattern</link></code> <code><link linkend="template-tan-a-div-merge-pass1">ŧ tan-a-div-merge-pass1</link></code> <code><link linkend="template-tan-key-errors">ŧ tan-key-errors</link></code> <code><link linkend="function-tan-type">tan:tan-type</link></code>() <code><link linkend="function-text-join">tan:text-join</link></code>() <code><link linkend="variable-tok-grouping-key-key">$tok-grouping-key-key</link></code> <code><link linkend="variable-token-definitions-reserved">$token-definitions-reserved</link></code> <code><link linkend="variable-tokenization-nonspace">$tokenization-nonspace</link></code> <code><link linkend="function-tokenize">tan:tokenize</link></code>() <code><link linkend="function-tokenize-div">tan:tokenize-div</link></code>() <code><link linkend="function-tokenize-leaf-div">tan:tokenize-leaf-div</link></code>() <code><link linkend="template-tokenize-prepped-class-1">ŧ tokenize-prepped-class-1</link></code> </para>
<para><code><link linkend="template-TAN-A-div-errors">ŧ TAN-A-div-errors</link></code> <code><link linkend="variable-TAN-elements-that-take-the-attribute-which">$TAN-elements-that-take-the-attribute-which</link></code> <code><link linkend="variable-TAN-keyword-files">$TAN-keyword-files</link></code> <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code> <code><link linkend="variable-TAN-namespace">$TAN-namespace</link></code> </para>
<para><code><link linkend="template-unconsolidate-anas">ŧ unconsolidate-anas</link></code> <code><link linkend="function-unconsolidate-tan-lm">tan:unconsolidate-tan-lm</link></code>() <code><link linkend="function-uri-directory">tan:uri-directory</link></code>() <code><link linkend="function-uri-relative-to">tan:uri-relative-to</link></code>() </para>
<para><code><link linkend="function-value-of">tan:value-of</link></code>() </para>
<para><code><link linkend="function-zip-uris">tan:zip-uris</link></code>() <code><link linkend="variable-zwj">$zwj</link></code> </para>
<para>The contents of this chapter have been generated automatically. Although much effort has
         been spent to ensure accurate representation of the schemas and function library, you may
         find errors or inconsistencies. In such cases, the functions and schemas (particularly the
         RELAX-NG, compact syntax) are to be given priority.</para><section><title>TAN-core global variables, keys, and functions summarized</title><section><title>variables</title><section xml:id="variable-all-functions"><title><code>$all-functions</code></title><para>Definition: <code>collection('../collection.xml')</code></para><para>Used by variable <code><link linkend="variable-all-function-uses-of-error">$all-function-uses-of-error</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-all-ids"><title><code>$all-ids</code></title><para>Definition: <code>(<link linkend="variable-head">$head</link>//<link linkend="attribute-xmlid">@xml:id</link>, /tei:TEI//descendant-or-self::tei:*/<link linkend="attribute-xmlid">@xml:id</link>)</code></para><para>Used by variable <code><link linkend="variable-duplicate-ids">$duplicate-ids</link></code></para><para>Used by template <code><link linkend="template-core-attribute-errors">ŧ core-attribute-errors</link></code></para><para>Relies upon <code><link linkend="variable-head">$head</link></code> .</para></section>
<section xml:id="variable-all-iris"><title><code>$all-iris</code></title><para>Definition: <code><link linkend="variable-head">$head</link>//tan:IRI[not(ancestor::tan:error)]</code></para><para>Used by variable <code><link linkend="variable-duplicate-iris">$duplicate-iris</link></code></para><para>Relies upon <code><link linkend="variable-head">$head</link></code> .</para></section>
<section xml:id="variable-all-keywords"><title><code>$all-keywords</code></title><para>Definition: <code>(<link linkend="variable-keys-resolved">$keys-resolved</link>, <link linkend="variable-TAN-keywords">$TAN-keywords</link>)</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-keys-resolved">$keys-resolved</link></code> <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code> .</para></section>
<section xml:id="variable-all-schemas"><title><code>$all-schemas</code></title><para>Definition: <code>collection('../../schemas/collection.xml')</code></para><para>Used by variable <code><link linkend="variable-all-schema-uses-of-error">$all-schema-uses-of-error</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-alphabet-numeral-key"><title><code>$alphabet-numeral-key</code></title><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>Used by function <code><link linkend="function-letter-to-number">tan:letter-to-number</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-apos"><title><code>$apos</code></title><para>Definition: <code>"'"</code></para><para>Used by variable <code><link linkend="variable-all-function-uses-of-error">$all-function-uses-of-error</link></code> <code><link linkend="variable-function-error-ids">$function-error-ids</link></code> <code><link linkend="variable-schema-error-ids">$schema-error-ids</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-body"><title><code>$body</code></title><para>Definition: <code><link linkend="variable-self-resolved">$self-resolved</link>/*/(tan:body, tei:text/tei:body)</code></para><para>Used by variable <code><link linkend="variable-all-body-iris">$all-body-iris</link></code></para><para>Used by template <code><link linkend="template-prep-class-2-doc-pass-2">ŧ prep-class-2-doc-pass-2</link></code></para><para>Used by function <code><link linkend="function-merge-sources">tan:merge-sources</link></code>() <code><link linkend="function-prep-class-2-doc-pass-2">tan:prep-class-2-doc-pass-2</link></code>()</para><para>Relies upon <code><link linkend="variable-self-resolved">$self-resolved</link></code> .</para></section>
<section xml:id="variable-contexts-resolved"><title><code>$contexts-resolved</code></title><para>Definition: <code><link linkend="variable-see-alsos-resolved">$see-alsos-resolved</link>[*/self::tan:TAN-c]</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-resolved">$see-alsos-resolved</link></code> .</para></section>
<section xml:id="variable-doc-id"><title><code>$doc-id</code></title><para>Definition: <code>/*/<link linkend="attribute-id">@id</link></code></para><para>Used by variable <code><link linkend="variable-doc-namespace">$doc-namespace</link></code></para><para>Used by template <code><link linkend="template-core-errors">ŧ core-errors</link></code></para><para>Used by function <code><link linkend="function-prep-TAN-mor">tan:prep-TAN-mor</link></code>() <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-doc-namespace"><title><code>$doc-namespace</code></title><para>Definition: <code>substring-before(substring-after(<link linkend="variable-doc-id">$doc-id</link>, 'tag:'), ':')</code></para><para>Used by variable <code><link linkend="variable-primary-agent">$primary-agent</link></code></para><para>Used by template <code><link linkend="template-core-errors">ŧ core-errors</link></code></para><para>Relies upon <code><link linkend="variable-doc-id">$doc-id</link></code> .</para></section>
<section xml:id="variable-doc-parent-directory"><title><code>$doc-parent-directory</code></title><para>Definition: <code><link linkend="function-uri-directory">tan:uri-directory</link>(<link linkend="variable-doc-uri">$doc-uri</link>)</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="function-uri-directory">tan:uri-directory</link></code> <code><link linkend="variable-doc-uri">$doc-uri</link></code> .</para></section>
<section xml:id="variable-doc-uri"><title><code>$doc-uri</code></title><para>Definition: <code>base-uri(/*)</code></para><para>Used by variable <code><link linkend="variable-doc-parent-directory">$doc-parent-directory</link></code></para><para>Used by template <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-attribute-errors">ŧ core-attribute-errors</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-duplicate-ids"><title><code>$duplicate-ids</code></title><para>Definition: <code><link linkend="variable-all-ids">$all-ids</link>[index-of(<link linkend="variable-all-ids">$all-ids</link>, .)[2]]</code></para><para>Used by template <code><link linkend="template-core-attribute-errors">ŧ core-attribute-errors</link></code></para><para>Relies upon <code><link linkend="variable-all-ids">$all-ids</link></code> .</para></section>
<section xml:id="variable-duplicate-iris"><title><code>$duplicate-iris</code></title><para>Definition: <code><link linkend="variable-all-iris">$all-iris</link>[index-of(<link linkend="variable-all-iris">$all-iris</link>, .)[2]]</code></para><para>Used by template <code><link linkend="template-core-errors">ŧ core-errors</link></code></para><para>Relies upon <code><link linkend="variable-all-iris">$all-iris</link></code> .</para></section>
<section xml:id="variable-elements-that-must-always-refer-to-tan-files"><title><code>$elements-that-must-always-refer-to-tan-files</code></title><para>Definition: <code>          ('morphology',          'inclusion',          'key')</code></para><para>Used by function <code><link linkend="function-must-refer-to-external-tan-file">tan:must-refer-to-external-tan-file</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-empty-doc"><title><code>$empty-doc</code></title><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>Used by template <code><link linkend="template-core-errors">ŧ core-errors</link></code></para><para>Used by function <code><link linkend="function-get-lm-ids">tan:get-lm-ids</link></code>() <code><link linkend="function-get-src-1st-da">tan:get-src-1st-da</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-erroneously-looped-doc"><title><code>$erroneously-looped-doc</code></title><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> .</para></section>
<section xml:id="variable-greek-letter-numeral-pattern"><title><code>$greek-letter-numeral-pattern</code></title><para>Definition: <code>'͵?([α-θΑ-ΘϛϚ]?[ρ-ωΡ-ΩϠϡ]?[ι-πΙ-ΠϘϙϞϟ]?[α-θΑ-ΘϛϚ]|[α-θΑ-ΘϛϚ]?[ρ-ωΡ-ΩϠϡ]?[ι-πΙ-ΠϘϙϞϟ][α-θΑ-ΘϛϚ]?|[α-θΑ-ΘϛϚ]?[ρ-ωΡ-ΩϠϡ][ι-πΙ-ΠϘϙϞϟ]?[α-θΑ-ΘϛϚ]?)ʹ?'</code></para><para>Used by variable <code><link linkend="variable-nonlatin-letter-numeral-pattern">$nonlatin-letter-numeral-pattern</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-head"><title><code>$head</code></title><para>Definition: <code><link linkend="variable-self-resolved">$self-resolved</link>/*/tan:head</code></para><para>Used by variable <code><link linkend="variable-morphologies-prepped">$morphologies-prepped</link></code> <code><link linkend="variable-source-lacks-id">$source-lacks-id</link></code> <code><link linkend="variable-src-elements">$src-elements</link></code> <code><link linkend="variable-source-ids">$source-ids</link></code> <code><link linkend="variable-all-ids">$all-ids</link></code> <code><link linkend="variable-all-iris">$all-iris</link></code> <code><link linkend="variable-primary-agent">$primary-agent</link></code> <code><link linkend="variable-keys-1st-da">$keys-1st-da</link></code> <code><link linkend="variable-sources-1st-da">$sources-1st-da</link></code> <code><link linkend="variable-see-alsos-1st-da">$see-alsos-1st-da</link></code></para><para>Used by template <code><link linkend="template-prep-class-2-doc-pass-1">ŧ prep-class-2-doc-pass-1</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-attribute-errors">ŧ core-attribute-errors</link></code></para><para>Used by function <code><link linkend="function-raw-diff-loop">tan:raw-diff-loop</link></code>()</para><para>Relies upon <code><link linkend="variable-self-resolved">$self-resolved</link></code> .</para></section>
<section xml:id="variable-id-idrefs"><title><code>$id-idrefs</code></title><para>Definition: <code>doc('TAN-idrefs.xml')</code></para><para>Used by template <code><link linkend="template-prepend-id-or-idrefs">ŧ prepend-id-or-idrefs</link></code> <code><link linkend="template-core-attribute-errors">ŧ core-attribute-errors</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-inclusions-1st-da"><title><code>$inclusions-1st-da</code></title><para>Definition: <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>(/*/tan:head/tan:inclusion)</code></para><para>Used by variable <code><link linkend="variable-inclusions-resolved">$inclusions-resolved</link></code></para><para>Used by function <code><link linkend="function-prep-TAN-mor">tan:prep-TAN-mor</link></code>()</para><para>Relies upon <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code> .</para></section>
<section xml:id="variable-inclusions-resolved"><title><code>$inclusions-resolved</code></title><para>Definition: <code><link linkend="function-resolve-doc">tan:resolve-doc</link>(<link linkend="variable-inclusions-1st-da">$inclusions-1st-da</link>, false(), 'incl', /*/tan:head/tan:inclusion/<link linkend="attribute-xmlid">@xml:id</link>, (), ())</code></para><para>Used by template <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code></para><para>Relies upon <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> <code><link linkend="variable-inclusions-1st-da">$inclusions-1st-da</link></code> .</para></section>
<section xml:id="variable-keys-1st-da"><title><code>$keys-1st-da</code></title><para>Definition: <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>(<link linkend="variable-head">$head</link>/tan:key)</code></para><para>Used by variable <code><link linkend="variable-keys-resolved">$keys-resolved</link></code></para><para>Used by template <code><link linkend="template-core-errors">ŧ core-errors</link></code></para><para>Used by function <code><link linkend="function-glossary">tan:glossary</link></code>()</para><para>Relies upon <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code> <code><link linkend="variable-head">$head</link></code> .</para></section>
<section xml:id="variable-keys-prepped"><title><code>$keys-prepped</code></title><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-keys-resolved">$keys-resolved</link></code> <code><link linkend="template-prep-tan-key">ŧ prep-tan-key</link></code> .</para></section>
<section xml:id="variable-keys-resolved"><title><code>$keys-resolved</code></title><para>Definition: <code><link linkend="function-resolve-doc">tan:resolve-doc</link>(<link linkend="variable-keys-1st-da">$keys-1st-da</link>)</code></para><para>Used by variable <code><link linkend="variable-keys-prepped">$keys-prepped</link></code> <code><link linkend="variable-all-keywords">$all-keywords</link></code></para><para>Used by template <code><link linkend="template-core-errors">ŧ core-errors</link></code></para><para>Relies upon <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> <code><link linkend="variable-keys-1st-da">$keys-1st-da</link></code> .</para></section>
<section xml:id="variable-latin-letter-numeral-pattern"><title><code>$latin-letter-numeral-pattern</code></title><para>Definition: <code>'a+|b+|c+|d+|e+|f+|g+|h+|i+|j+|k+|l+|m+|n+|o+|p+|q+|r+|s+|t+|u+|v+|w+|x+|y+|z+'</code></para><para>Used by variable <code><link linkend="variable-n-type-pattern">$n-type-pattern</link></code></para><para>Used by function <code><link linkend="function-aaa-to-int">tan:aaa-to-int</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-n-type"><title><code>$n-type</code></title><para>Definition: <code>('i', '1', '1a', 'a', 'a1', 'α', '$', 'i-or-a')</code></para><para>Used by template <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code> <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code> <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code></para><para>Used by function <code><link linkend="function-strings-to-numeral-or-numeral-type">tan:strings-to-numeral-or-numeral-type</link></code>() <code><link linkend="function-get-n-types">tan:get-n-types</link></code>() <code><link linkend="function-normalize-refs">tan:normalize-refs</link></code>() <code><link linkend="function-interpret-n-vals">tan:interpret-n-vals</link></code>() <code><link linkend="function-analyze-elements-with-numeral-attributes">tan:analyze-elements-with-numeral-attributes</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-n-type-label"><title><code>$n-type-label</code></title><para>Definition: <code>          ('Roman numerals', 'Arabic numerals', 'Arabic numerals + alphabet numeral', 'alphabet numeral', 'alphabet numeral + Arabic numeral',          'non-Latin-alphabet numeral', 'string', 'Roman or alphabet numeral')</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-n-type-pattern"><title><code>$n-type-pattern</code></title><para>Definition: <code>          (concat('^(', <link linkend="variable-roman-numeral-pattern">$roman-numeral-pattern</link>, ')$'),          '^(\d+)$',          concat('^(\d+)(', <link linkend="variable-latin-letter-numeral-pattern">$latin-letter-numeral-pattern</link>, ')$'),          concat('^(', <link linkend="variable-latin-letter-numeral-pattern">$latin-letter-numeral-pattern</link>, ')$'),          concat('^(', <link linkend="variable-latin-letter-numeral-pattern">$latin-letter-numeral-pattern</link>, ')(\d+)$'),          concat('^(', <link linkend="variable-nonlatin-letter-numeral-pattern">$nonlatin-letter-numeral-pattern</link>, ')$'),          '(.)')</code></para><para>Used by function <code><link linkend="function-strings-to-numeral-or-numeral-type">tan:strings-to-numeral-or-numeral-type</link></code>() <code><link linkend="function-interpret-n-vals">tan:interpret-n-vals</link></code>() <code><link linkend="function-analyze-elements-with-numeral-attributes">tan:analyze-elements-with-numeral-attributes</link></code>()</para><para>Relies upon <code><link linkend="variable-roman-numeral-pattern">$roman-numeral-pattern</link></code> <code><link linkend="variable-latin-letter-numeral-pattern">$latin-letter-numeral-pattern</link></code> <code><link linkend="variable-nonlatin-letter-numeral-pattern">$nonlatin-letter-numeral-pattern</link></code> .</para></section>
<section xml:id="variable-nonlatin-letter-numeral-pattern"><title><code>$nonlatin-letter-numeral-pattern</code></title><para>Definition: <code>string-join((<link linkend="variable-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-greek-letter-numeral-pattern">$greek-letter-numeral-pattern</link></code> <code><link linkend="variable-syriac-letter-numeral-pattern">$syriac-letter-numeral-pattern</link></code> .</para></section>
<section xml:id="variable-now"><title><code>$now</code></title><para>Definition: <code><link linkend="function-dateTime-to-decimal">tan:dateTime-to-decimal</link>(current-dateTime())</code></para><para>Used by template <code><link linkend="template-core-attribute-errors">ŧ core-attribute-errors</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-primary-agent"><title><code>$primary-agent</code></title><para>Definition: <code>(<link linkend="variable-head">$head</link>/tan:agent[tan:IRI[matches(., concat('^tag:', <link linkend="variable-doc-namespace">$doc-namespace</link>))]])[1]</code></para><para>Used by template <code><link linkend="template-core-errors">ŧ core-errors</link></code></para><para>Relies upon <code><link linkend="variable-head">$head</link></code> <code><link linkend="variable-doc-namespace">$doc-namespace</link></code> .</para></section>
<section xml:id="variable-quot"><title><code>$quot</code></title><para>Definition: <code>'"'</code></para><para>Used by variable <code><link linkend="variable-all-function-uses-of-error">$all-function-uses-of-error</link></code> <code><link linkend="variable-function-error-ids">$function-error-ids</link></code> <code><link linkend="variable-schema-error-ids">$schema-error-ids</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-regex-characters-not-permitted"><title><code>$regex-characters-not-permitted</code></title><para>Definition: <code>'[  - ]'</code></para><para>Used by template <code><link linkend="template-core-errors">ŧ core-errors</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-regex-escaping-characters"><title><code>$regex-escaping-characters</code></title><para>Definition: <code>'[\.\[\]\\\|\-\^\$\?\*\+\{\}\(\)]'</code></para><para>Used by function <code><link linkend="function-escape">tan:escape</link></code>() <code><link linkend="function-expand-search">tan:expand-search</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-relationship-keywords-for-tan-files"><title><code>$relationship-keywords-for-tan-files</code></title><para>Definition: <code><link linkend="function-glossary">tan:glossary</link>('relationship', (), 'TAN files')</code></para><para>Used by function <code><link linkend="function-must-refer-to-external-tan-file">tan:must-refer-to-external-tan-file</link></code>()</para><para>Relies upon <code><link linkend="function-glossary">tan:glossary</link></code> .</para></section>
<section xml:id="variable-roman-numeral-pattern"><title><code>$roman-numeral-pattern</code></title><para>Definition: <code>'m{0,4}(cm|cd|d?c{0,3})(xc|xl|l?x{0,3})(ix|iv|v?i{0,3})'</code></para><para>Used by variable <code><link linkend="variable-n-type-pattern">$n-type-pattern</link></code></para><para>Used by function <code><link linkend="function-rom-to-int">tan:rom-to-int</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-root"><title><code>$root</code></title><para>Definition: <code>/</code></para><para>Used by template <code><link linkend="template-merge-nodes">Ŧ merge-nodes</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-see-alsos-1st-da"><title><code>$see-alsos-1st-da</code></title><para>Definition: <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>(<link linkend="variable-head">$head</link>/tan:see-also)</code></para><para>Used by variable <code><link linkend="variable-see-alsos-resolved">$see-alsos-resolved</link></code></para><para>Relies upon <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code> <code><link linkend="variable-head">$head</link></code> .</para></section>
<section xml:id="variable-see-alsos-resolved"><title><code>$see-alsos-resolved</code></title><para>Definition: <code><link linkend="function-resolve-doc">tan:resolve-doc</link>(<link linkend="variable-see-alsos-1st-da">$see-alsos-1st-da</link>)</code></para><para>Used by variable <code><link linkend="variable-contexts-resolved">$contexts-resolved</link></code></para><para>Used by template <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code></para><para>Relies upon <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> <code><link linkend="variable-see-alsos-1st-da">$see-alsos-1st-da</link></code> .</para></section>
<section xml:id="variable-self-core-errors-marked"><title><code>$self-core-errors-marked</code></title><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>Used by variable <code><link linkend="variable-self-and-sources-prepped-prelim">$self-and-sources-prepped-prelim</link></code> <code><link linkend="variable-self-and-sources-prepped">$self-and-sources-prepped</link></code> <code><link linkend="variable-self-prepped">$self-prepped</link></code> <code><link linkend="variable-self-prepped">$self-prepped</link></code> <code><link linkend="variable-self-and-sources-prepped">$self-and-sources-prepped</link></code> <code><link linkend="variable-self-prepped">$self-prepped</link></code> <code><link linkend="variable-self-prepped">$self-prepped</link></code></para><para>Relies upon <code><link linkend="variable-self-resolved">$self-resolved</link></code> <code><link linkend="template-core-attribute-errors">ŧ core-attribute-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> .</para></section>
<section xml:id="variable-self-resolved"><title><code>$self-resolved</code></title><para>Definition: <code><link linkend="function-resolve-doc">tan:resolve-doc</link>(/)</code></para><para>Used by variable <code><link linkend="variable-self-core-errors-marked">$self-core-errors-marked</link></code> <code><link linkend="variable-head">$head</link></code> <code><link linkend="variable-body">$body</link></code></para><para>Relies upon <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> .</para></section>
<section xml:id="variable-separator-hierarchy"><title><code>$separator-hierarchy</code></title><para>Definition: <code>' '</code></para><para>Used by variable <code><link linkend="variable-separator-hierarchy-regex">$separator-hierarchy-regex</link></code> <code><link linkend="variable-separator-hierarchy-minor-regex">$separator-hierarchy-minor-regex</link></code></para><para>Used by template <code><link linkend="template-prep-class-1">ŧ prep-class-1</link></code> <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code></para><para>Used by function <code><link linkend="function-flatref">tan:flatref</link></code>() <code><link linkend="function-normalize-refs">tan:normalize-refs</link></code>() <code><link linkend="function-interpret-n-vals">tan:interpret-n-vals</link></code>() <code><link linkend="function-analyze-elements-with-numeral-attributes">tan:analyze-elements-with-numeral-attributes</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-separator-hierarchy-minor"><title><code>$separator-hierarchy-minor</code></title><para>Definition: <code>'#'</code></para><para>Used by variable <code><link linkend="variable-separator-hierarchy-minor-regex">$separator-hierarchy-minor-regex</link></code></para><para>Used by function <code><link linkend="function-interpret-n-vals">tan:interpret-n-vals</link></code>() <code><link linkend="function-analyze-elements-with-numeral-attributes">tan:analyze-elements-with-numeral-attributes</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-separator-hierarchy-minor-regex"><title><code>$separator-hierarchy-minor-regex</code></title><para>Definition: <code><link linkend="function-escape">tan:escape</link>(<link linkend="variable-separator-hierarchy-minor">$separator-hierarchy-minor</link>)</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="function-escape">tan:escape</link></code> <code><link linkend="variable-separator-hierarchy-minor">$separator-hierarchy-minor</link></code> .</para></section>
<section xml:id="variable-separator-hierarchy-regex"><title><code>$separator-hierarchy-regex</code></title><para>Definition: <code><link linkend="function-escape">tan:escape</link>(<link linkend="variable-separator-hierarchy">$separator-hierarchy</link>)</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="function-escape">tan:escape</link></code> <code><link linkend="variable-separator-hierarchy">$separator-hierarchy</link></code> .</para></section>
<section xml:id="variable-source-ids"><title><code>$source-ids</code></title><para>Definition: <code>          if (exists(<link linkend="variable-head">$head</link>/tan:source/<link linkend="attribute-xmlid">@xml:id</link>)) then             <link linkend="variable-head">$head</link>/tan:source/<link linkend="attribute-xmlid">@xml:id</link>          else             for $i in (1 to count(<link linkend="variable-head">$head</link>/tan:source))             return                string($i)</code></para><para>Used by variable <code><link linkend="variable-sources-resolved">$sources-resolved</link></code></para><para>Relies upon <code><link linkend="variable-head">$head</link></code> .</para></section>
<section xml:id="variable-sources-1st-da"><title><code>$sources-1st-da</code></title><para>Definition: <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link>(<link linkend="variable-head">$head</link>/tan:source)</code></para><para>Used by variable <code><link linkend="variable-sources-resolved">$sources-resolved</link></code></para><para>Relies upon <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code> <code><link linkend="variable-head">$head</link></code> .</para></section>
<section xml:id="variable-sources-resolved"><title><code>$sources-resolved</code></title><para>Definition: <code><link linkend="function-resolve-doc">tan:resolve-doc</link>(<link linkend="variable-sources-1st-da">$sources-1st-da</link>, false(), 'src', <link linkend="variable-source-ids">$source-ids</link>, (), ())</code></para><para>Used by template <code><link linkend="template-core-errors">ŧ core-errors</link></code></para><para>Used by function <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>()</para><para>Relies upon <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> <code><link linkend="variable-sources-1st-da">$sources-1st-da</link></code> <code><link linkend="variable-source-ids">$source-ids</link></code> .</para></section>
<section xml:id="variable-syriac-letter-numeral-pattern"><title><code>$syriac-letter-numeral-pattern</code></title><para>Definition: <code>'[ܐܒܓܕܗܘܙܚܛ]?\p{Mc}?(ܬ?[ܩܪܫܬ]|[ܢܣܥܦܨ]\p{Mc})?\p{Mc}?[ܝܟܠܡܢܣܥܦܨ]?\p{Mc}?[ܐܒܓܕܗܘܙܚܛ]\p{Mc}?|[ܐܒܓܕܗܘܙܚܛ]?\p{Mc}?(ܬ?[ܩܪܫܬ]|[ܢܣܥܦܨ]\p{Mc})?\p{Mc}?[ܝܟܠܡܢܣܥܦܨ]\p{Mc}?[ܐܒܓܕܗܘܙܚܛ]?\p{Mc}?|[ܐܒܓܕܗܘܙܚܛ]?\p{Mc}?(ܬ?[ܩܪܫܬ]|[ܢܣܥܦܨ]\p{Mc})\p{Mc}?[ܝܟܠܡܢܣܥܦܨ]?\p{Mc}?[ܐܒܓܕܗܘܙܚܛ]?\p{Mc}?'</code></para><para>Used by variable <code><link linkend="variable-nonlatin-letter-numeral-pattern">$nonlatin-letter-numeral-pattern</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-tag-urn-regex-pattern"><title><code>$tag-urn-regex-pattern</code></title><para>Definition: <code>'tag:([\-a-zA-Z0-9._%+]+@)?[\-a-zA-Z0-9.]+\.[A-Za-z]{2,4},\d{4}(-(0\d|1[0-2]))?(-([0-2]\d|3[01]))?:\S+'</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-TAN-keyword-files"><title><code>$TAN-keyword-files</code></title><para>Definition: <code>collection('../../TAN-key/collection.xml')</code></para><para>Used by variable <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-TAN-keywords"><title><code>$TAN-keywords</code></title><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>Used by variable <code><link linkend="variable-all-keywords">$all-keywords</link></code> <code><link linkend="variable-token-definitions-reserved">$token-definitions-reserved</link></code></para><para>Used by template <code><link linkend="template-tan-key-errors">ŧ tan-key-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code></para><para>Used by function <code><link linkend="function-has-relationship">tan:has-relationship</link></code>() <code><link linkend="function-glossary">tan:glossary</link></code>()</para><para>Relies upon <code><link linkend="variable-TAN-keyword-files">$TAN-keyword-files</link></code> <code><link linkend="template-resolve-href">ŧ resolve-href</link></code> <code><link linkend="template-prep-tan-key">ŧ prep-tan-key</link></code> .</para></section>
<section xml:id="variable-TAN-namespace"><title><code>$TAN-namespace</code></title><para>Definition: <code>'tag:textalign.net,2015'</code></para><para>Used by template <code><link linkend="template-tan-key-errors">ŧ tan-key-errors</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-token-definitions-reserved"><title><code>$token-definitions-reserved</code></title><para>Definition: <code><link linkend="variable-TAN-keywords">$TAN-keywords</link>//tan:token-definition</code></para><para>Used by variable <code><link linkend="variable-tokenization-nonspace">$tokenization-nonspace</link></code></para><para>Used by function <code><link linkend="function-prep-class-2-doc-pass-2">tan:prep-class-2-doc-pass-2</link></code>() <code><link linkend="function-tokenize-leaf-div">tan:tokenize-leaf-div</link></code>()</para><para>Relies upon <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code> .</para></section>
</section>
<section><title>keys</title><section xml:id="key-item-via-node-name"><title><code>ʞ item-via-node-name')</code></title><para>Looks for elements matching <code>tan:item</code></para><para>Used by template <code><link linkend="template-tan-key-errors">ŧ tan-key-errors</link></code></para><para>Used by function <code><link linkend="function-glossary">tan:glossary</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="key-q-ref"><title><code>ʞ q-ref')</code></title><para>Looks for elements matching <code>*</code></para><para>Used by function <code><link linkend="function-get-via-q-ref">tan:get-via-q-ref</link></code>()</para><para>Relies upon <code><link linkend="function-q-ref">tan:q-ref</link></code> .</para></section>
</section>
<section><title>functions</title><section xml:id="function-aaa-to-int"><title><code>tan:aaa-to-int()</code></title><para><code>tan:aaa-to-int($arg as xs:string*) as xs:integer*</code></para><para> Input: any alphabet numerals </para><para> Output:the integer equivalent </para><para> Sequence goes a, b, c, ... z, aa, bb, ..., aaa, bbb, ....  E.g., 'ccc' - &gt; 55 </para><para>Used by function <code><link linkend="function-strings-to-numeral-or-numeral-type">tan:strings-to-numeral-or-numeral-type</link></code>() <code><link linkend="function-interpret-n-vals">tan:interpret-n-vals</link></code>() <code><link linkend="function-analyze-elements-with-numeral-attributes">tan:analyze-elements-with-numeral-attributes</link></code>()</para><para>Relies upon <code><link linkend="variable-latin-letter-numeral-pattern">$latin-letter-numeral-pattern</link></code> .</para></section>
<section xml:id="function-analyze-elements-with-numeral-attributes"><title><code>tan:analyze-elements-with-numeral-attributes()</code></title><para><code>tan:analyze-elements-with-numeral-attributes($elements as node()*, $group-by-what-attr-value as xs:string?, $analyze-only-ambiguous-types as xs:boolean, $shallow-analysis as xs:boolean) as element()*</code></para><para> Input: any sequence of elements that contain (either in themselves or their descendants) <code><link linkend="attribute-n">@n</link></code>, <code><link linkend="attribute-old">@old</link></code>, or <code><link linkend="attribute-ref">@ref</link></code>; an optional string indicating an attribute whose tokenized value should be used as a basis for grouping the results; two booleans indicating whether only ambiguous types should be checked and whether the analysis should be performed only shallowly (i.e., not on any descendants of the input elements) </para><para> Output: zero or more <code>&lt;ns&gt;</code>s (one per group, and with <code>@type-i</code>, <code>@type-a</code>, and type-i-or-a if only ambiguous types are intended), each with one or more <code>&lt;n&gt;</code>s (one per atomic value in <code><link linkend="attribute-n">@n</link></code> or <code><link linkend="attribute-ref">@ref</link></code> of the group picked), each with one or more &lt;val type="[i, 1, 1a, a, a1, or $, depending on the type]"&gt;[VALUE]&lt;/val&gt;, where VALUE is what the item is when converted. If the item is <code><link linkend="attribute-ref">@ref</link></code> then any non-word strings that are used to separate refs or <code><link linkend="attribute-n">@n</link></code> values (hyphen, comma, etc.) are retained in <code>&lt;sep&gt;</code>s. </para><para> This function is used to help other functions determine whether there is an error, or how ambiguous numerals should be interpreted </para><para>Used by template <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code> <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code> <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code></para><para>Used by function <code><link linkend="function-normalize-refs">tan:normalize-refs</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>()</para><para>Relies upon <code><link linkend="function-aaa-to-int">tan:aaa-to-int</link></code> <code><link linkend="variable-n-type">$n-type</link></code> <code><link linkend="function-normalize-text">tan:normalize-text</link></code> <code><link linkend="variable-n-type-pattern">$n-type-pattern</link></code> <code><link linkend="function-rom-to-int">tan:rom-to-int</link></code> <code><link linkend="variable-separator-hierarchy-minor">$separator-hierarchy-minor</link></code> <code><link linkend="variable-help-trigger-regex">$help-trigger-regex</link></code> .</para></section>
<section xml:id="function-base-uri"><title><code>tan:base-uri()</code></title><para><code>tan:base-uri($any-node as node()?) as xs:anyURI?</code></para><para> Input: any node </para><para> Output: the base uri of the node's document </para><para> NB, this function differs from fn:base-uri in that it first looks for a <code>@base-uri</code> stamped at the document node. This is important because many TAN documents will be transformed, bound to variables, and so divorced from an original context dectable only through <code>@base-uri.</code> </para><para>Used by template <code><link linkend="template-first-stamp">ŧ first-stamp</link></code> <code><link linkend="template-resolve-href">ŧ resolve-href</link></code></para><para>Used by function <code><link linkend="function-cfn">tan:cfn</link></code>() <code><link linkend="function-first-loc-available">tan:first-loc-available</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-batch-replace"><title><code>tan:batch-replace()</code></title><para><code>tan:batch-replace($string as xs:string?, $replace-elements as element()*) as xs:string?</code></para><para> Input: a string, a sequence of &lt;[ANY NAME] pattern="" replacement="" [flags=""]&gt; </para><para> Output: the string, after those replaces are processed in order </para><para>Used by function <code><link linkend="function-batch-replace">tan:batch-replace</link></code>()</para><para>Relies upon <code><link linkend="function-replace">tan:replace</link></code> <code><link linkend="function-batch-replace">tan:batch-replace</link></code> .</para></section>
<section xml:id="function-cfn"><title><code>tan:cfn()</code></title><para><code>tan:cfn($item as item()*) as xs:string*</code></para><para> Input: any items </para><para> Output: the Current File Name, without extension, of the host document node of each item </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-base-uri">tan:base-uri</link></code> .</para></section>
<section xml:id="function-class-number"><title><code>tan:class-number()</code></title><para><code>tan:class-number($nodes as node()*) as xs:integer*</code></para><para> Input: any nodes of a TAN document </para><para> Output: one digit per node, specifying which TAN class the file fits, based on the name of the root element. If no match is found in the root element, 0 is returned </para><para>Used by template <code><link linkend="template-core-errors">ŧ core-errors</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-get-1st-doc">tan:get-1st-doc</link></code>()</para><para>Relies upon <code><link linkend="function-tan-type">tan:tan-type</link></code> .</para></section>
<section xml:id="function-copy-of"><title><code>tan:copy-of()</code></title><para><code>tan:copy-of($doc-fragment as item()*, $exclude-elements-beyond-what-depth as xs:integer?) as item()*</code></para><para> Input: any document fragment, and an optional integer specifying the depth of copy requested </para><para> Output: a copy of the fragment to the depth specified </para><para> This function depends upon the full version of <code><link linkend="function-copy-of-except">tan:copy-of-except</link></code>(); it is particularly useful for diagnostics, e.g., retrieving a long document's root element and its children, without descendants </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-copy-of-except">tan:copy-of-except</link></code> .</para></section>
<section xml:id="function-copy-of-except"><title><code>tan:copy-of-except()</code></title><para><emphasis>Option 1 (TAN-core-functions)</emphasis></para><para><code>tan:copy-of-except($doc-fragment as item()*, $exclude-elements-named as xs:string*, $exclude-attributes-named as xs:string*, $exclude-elements-with-attributes-named as xs:string*) as item()*</code></para><para> short version of the full function, below </para><para>Used by template <code><link linkend="template-tokenize-prepped-class-1">ŧ tokenize-prepped-class-1</link></code></para><para>Used by function <code><link linkend="function-merge-tan-a-div-prepped">tan:merge-tan-a-div-prepped</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>()</para><para>Relies upon <code><link linkend="function-copy-of-except">tan:copy-of-except</link></code> .</para><para><emphasis>Option 2 (TAN-core-functions)</emphasis></para><para><code>tan:copy-of-except($doc-fragment as item()*, $exclude-elements-named as xs:string*, $exclude-attributes-named as xs:string*, $exclude-elements-with-attributes-named as xs:string*, $exclude-elements-beyond-what-depth as xs:integer?, $shallow-skip-elements-named as xs:string*) as item()*</code></para><para> Input: any document fragment; sequences of strings specifying names of elements to exclude, names of attributes to exclude, and names of attributes whose parent elements should be excluded; an integer beyond which depth copies should not be made </para><para> Output: the same fragment, filtered </para><para> This function was written primarily to service the merge of TAN-A-div sources, where realigned divs could be extracted from their source documents </para><para>Used by template <code><link linkend="template-tokenize-prepped-class-1">ŧ tokenize-prepped-class-1</link></code></para><para>Used by function <code><link linkend="function-merge-tan-a-div-prepped">tan:merge-tan-a-div-prepped</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>()</para><para>Relies upon <code><link linkend="template-copy-of-except">ŧ copy-of-except</link></code> .</para></section>
<section xml:id="function-dateTime-to-decimal"><title><code>tan:dateTime-to-decimal()</code></title><para><code>tan:dateTime-to-decimal($time-or-dateTime as item()*) as xs:decimal*</code></para><para> Input: any xs:date or xs:dateTime </para><para> Output: decimal between 0 and 1 that acts as a proxy for the date and time. These decimal values can then be sorted and compared. </para><para> Example: (2015-05-10) - &gt; 0.2015051 </para><para> If input is not castable as a date or dateTime, 0 is returned </para><para>Used by variable <code><link linkend="variable-now">$now</link></code></para><para>Used by template <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-attribute-errors">ŧ core-attribute-errors</link></code></para><para>Used by function <code><link linkend="function-most-recent-dateTime">tan:most-recent-dateTime</link></code>() <code><link linkend="function-get-doc-hist">tan:get-doc-hist</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-distinct-items"><title><code>tan:distinct-items()</code></title><para><code>tan:distinct-items($items as item()*) as item()*</code></para><para> Input: any sequence of items </para><para> Output: Those items that are not deeply equal to any other item in the sequence </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-duplicate-values"><title><code>tan:duplicate-values()</code></title><para><code>tan:duplicate-values($sequence as item()*) as item()*</code></para><para> Input: any sequence of items </para><para> Output: those items that appear in the sequence more than once </para><para> This function parallels the standard <code>fn:distinct-values(</code>) </para><para>Used by variable <code><link linkend="variable-self-leaf-div-flatref-duplicates">$self-leaf-div-flatref-duplicates</link></code></para><para>Used by template <code><link linkend="template-prep-verbosely">ŧ prep-verbosely</link></code> <code><link linkend="template-segment-tokd-prepped-class-1">ŧ segment-tokd-prepped-class-1</link></code> <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> <code><link linkend="template-TAN-A-div-errors">ŧ TAN-A-div-errors</link></code></para><para>Used by function <code><link linkend="function-mark-splits">tan:mark-splits</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-escape"><title><code>tan:escape()</code></title><para><code>tan:escape($strings as xs:string*) as xs:string*</code></para><para> Input: any sequence of strings </para><para> Output: each string prepared for regular expression searches, i.e., with reserved characters escaped out. </para><para>Used by variable <code><link linkend="variable-separator-hierarchy-regex">$separator-hierarchy-regex</link></code> <code><link linkend="variable-separator-hierarchy-minor-regex">$separator-hierarchy-minor-regex</link></code> <code><link linkend="variable-help-trigger-regex">$help-trigger-regex</link></code></para><para>Used by template <code><link linkend="template-prep-tan-lm">ŧ prep-tan-lm</link></code> <code><link linkend="template-compare-copies">ŧ compare-copies</link></code></para><para>Used by function <code><link linkend="function-feature-test-check">tan:feature-test-check</link></code>() <code><link linkend="function-raw-diff-loop">tan:raw-diff-loop</link></code>() <code><link linkend="function-diff-core">tan:diff-core</link></code>() <code><link linkend="function-diff-core-draft">tan:diff-core-draft</link></code>()</para><para>Relies upon <code><link linkend="variable-regex-escaping-characters">$regex-escaping-characters</link></code> .</para></section>
<section xml:id="function-first-loc-available"><title><code>tan:first-loc-available()</code></title><para><code>tan:first-loc-available($elements-that-are-locations-or-parents-of-locations as element()*) as xs:string*</code></para><para> Input: An element that contains one or more tan:location elements </para><para> Output: the value of the first tan:location/<code><link linkend="attribute-href">@href</link></code> to point to a document available, resolved If no location is available nothing is returned. </para><para>Used by function <code><link linkend="function-get-src-1st-da">tan:get-src-1st-da</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> .</para></section>
<section xml:id="function-get-1st-doc"><title><code>tan:get-1st-doc()</code></title><para><code>tan:get-1st-doc($TAN-elements as element()*) as document-node()*</code></para><para> Input: any TAN elements naming files (e.g., <code><link linkend="element-source">&lt;source&gt;</link></code>, <code><link linkend="element-see-also">&lt;see-also&gt;</link></code>, <code><link linkend="element-inclusion">&lt;inclusion&gt;</link></code>, <code><link linkend="element-key">&lt;key&gt;</link></code>; an indication whether some basic errors should be checked if the retrieved file is a TAN document </para><para> Output: the first document available for each element, plus/or any relevant error messages. </para><para>Used by variable <code><link linkend="variable-morphologies-prepped">$morphologies-prepped</link></code> <code><link linkend="variable-inclusions-1st-da">$inclusions-1st-da</link></code> <code><link linkend="variable-keys-1st-da">$keys-1st-da</link></code> <code><link linkend="variable-sources-1st-da">$sources-1st-da</link></code> <code><link linkend="variable-see-alsos-1st-da">$see-alsos-1st-da</link></code></para><para>Used by template <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code></para><para>Used by function <code><link linkend="function-prep-TAN-mor">tan:prep-TAN-mor</link></code>() <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-class-number">tan:class-number</link></code> <code><link linkend="function-tan-type">tan:tan-type</link></code> <code><link linkend="function-first-loc-available">tan:first-loc-available</link></code> .</para></section>
<section xml:id="function-get-doc-hist"><title><code>tan:get-doc-hist()</code></title><para><code>tan:get-doc-hist($TAN-doc as document-node()*) as element()*</code></para><para> Input: any TAN document </para><para> Output: a sequence of elements with <code><link linkend="attribute-when">@when</link></code>, <code><link linkend="attribute-ed-when">@ed-when</link></code>, and <code><link linkend="attribute-when-accessed">@when-accessed</link></code>, sorted from most recent to least; each element includes <code>@when-sort</code>, a decimal that represents the value of the most recent time-date stamp in that element </para><para>Used by template <code><link linkend="template-core-errors">ŧ core-errors</link></code></para><para>Relies upon <code><link linkend="function-dateTime-to-decimal">tan:dateTime-to-decimal</link></code> .</para></section>
<section xml:id="function-get-via-q-ref"><title><code>tan:get-via-q-ref()</code></title><para><code>tan:get-via-q-ref($q-ref as xs:string*, $q-reffed-document as document-node()*) as node()*</code></para><para> Input: any number of qrefs, any number of q-reffed documents </para><para> Output: the elements corresponding to the q-refs </para><para> This function is used by the core validation routine, especially to associate errors in included elements with the primary including element </para><para>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-glossary"><title><code>tan:glossary()</code></title><para><emphasis>Option 1 (TAN-core-functions)</emphasis></para><para><code>tan:glossary($element-that-takes-attribute-which as item()) as element()*</code></para><para> one-parameter version of the master one, below </para><para>Used by variable <code><link linkend="variable-relationship-keywords-for-tan-files">$relationship-keywords-for-tan-files</link></code></para><para>Used by template <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code></para><para>Used by function <code><link linkend="function-has-relationship">tan:has-relationship</link></code>() <code><link linkend="function-glossary">tan:glossary</link></code>()</para><para>Relies upon <code><link linkend="function-glossary">tan:glossary</link></code> <code><link linkend="variable-keys-1st-da">$keys-1st-da</link></code> .</para><para><emphasis>Option 2 (TAN-core-functions)</emphasis></para><para><code>tan:glossary($element-that-takes-attribute-which as item(), $extra-TAN-key-docs as document-node()*, $group-name-filter as xs:string?) as element()*</code></para><para> Input: any element that has <code><link linkend="attribute-which">@which</link></code> (or a string value of the name of an element that takes <code><link linkend="attribute-which">@which</link></code>); any TAN-key documents other than the standard TAN ones; and an optional name that restricts the search to a particular group </para><para> Output: the tan:items that are valid keywords for the element in question, filtered by matches on <code><link linkend="attribute-which">@which</link></code>, if present in the first parameter </para><para>Used by variable <code><link linkend="variable-relationship-keywords-for-tan-files">$relationship-keywords-for-tan-files</link></code></para><para>Used by template <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code></para><para>Used by function <code><link linkend="function-has-relationship">tan:has-relationship</link></code>() <code><link linkend="function-glossary">tan:glossary</link></code>()</para><para>Relies upon <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code> <code><link linkend="template-prep-tan-key">ŧ prep-tan-key</link></code> .</para></section>
<section xml:id="function-grc-to-int"><title><code>tan:grc-to-int()</code></title><para><code>tan:grc-to-int($greek-numerals as xs:string*) as xs:integer*</code></para><para> Input: Greek letters that represent numerals </para><para> Output: the numerical value of the letters </para><para> NB, this does not take into account the use of letters representing numbers 1000 and greater </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-letter-to-number">tan:letter-to-number</link></code> .</para></section>
<section xml:id="function-has-relationship"><title><code>tan:has-relationship()</code></title><para><code>tan:has-relationship($see-also-element as element(), $keyword as xs:string*, $extra-keys as document-node()*) as xs:boolean</code></para><para> Input: a <code><link linkend="element-see-also">&lt;see-also&gt;</link></code> element, a sequence of strings identifying names of keywords, and any extra TAN-key files you want to check, other than the standard TAN-key files. </para><para> Output: boolean value specifying whether the <code><link linkend="element-see-also">&lt;see-also&gt;</link></code> has a <code><link linkend="element-relationship">&lt;relationship&gt;</link></code> that has the keyword defined </para><para> This function will first check to see if IRIs in a <code><link linkend="element-relationship">&lt;relationship&gt;</link></code> match, and if no IRIs are found then the check is performed on <code><link linkend="attribute-which">@which</link></code> (against a <code><link linkend="element-name">&lt;name&gt;</link></code> in the key definition). </para><para>Used by template <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code></para><para>Relies upon <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code> <code><link linkend="function-glossary">tan:glossary</link></code> <code><link linkend="function-normalize-text">tan:normalize-text</link></code> .</para></section>
<section xml:id="function-interpret-n-vals"><title><code>tan:interpret-n-vals()</code></title><para><code>tan:interpret-n-vals($ns as xs:string*) as element()*</code></para><para> Input: any strings representing values of <code><link linkend="attribute-n">@n</link></code> </para><para> Output: one element per <code><link linkend="attribute-n">@n</link></code>, with at least one &lt;val <code><link linkend="attribute-type">@type</link></code>="[n-type]"&gt; corresponding to the six types of numeral patterns/strings; if the input can be legitimately interpreted as that type, its converted value is in the element, otherwise it is empty </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="variable-n-type-pattern">$n-type-pattern</link></code> <code><link linkend="function-letter-to-number">tan:letter-to-number</link></code> <code><link linkend="variable-n-type">$n-type</link></code> <code><link linkend="variable-separator-hierarchy-minor">$separator-hierarchy-minor</link></code> <code><link linkend="function-aaa-to-int">tan:aaa-to-int</link></code> <code><link linkend="function-rom-to-int">tan:rom-to-int</link></code> .</para></section>
<section xml:id="function-letter-to-number"><title><code>tan:letter-to-number()</code></title><para><code>tan:letter-to-number($numerical-letters as xs:anyAtomicType*) as xs:integer*</code></para><para> Input: any sequence of strings that represent alphabetic numerals </para><para> Output: those numerals </para><para> NB, currently works only for Greek and Syriac; anything else produces null results </para><para>Used by function <code><link linkend="function-strings-to-numeral-or-numeral-type">tan:strings-to-numeral-or-numeral-type</link></code>() <code><link linkend="function-interpret-n-vals">tan:interpret-n-vals</link></code>() <code><link linkend="function-grc-to-int">tan:grc-to-int</link></code>() <code><link linkend="function-syc-to-int">tan:syc-to-int</link></code>()</para><para>Relies upon <code><link linkend="variable-alphabet-numeral-key">$alphabet-numeral-key</link></code> .</para></section>
<section xml:id="function-most-common-value"><title><code>tan:most-common-value()</code></title><para><code>tan:most-common-value($sequence as item()*) as item()?</code></para><para> Input: any sequence of items </para><para> Output: the one item that appears most frequently </para><para> If two or more items appear equally frequently, only the first is returned </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-most-recent-dateTime"><title><code>tan:most-recent-dateTime()</code></title><para><code>tan:most-recent-dateTime($dateTimes as item()*) as item()?</code></para><para> Input: a series of ISO-compliant date or dateTimes </para><para> Output: the most recent one </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-dateTime-to-decimal">tan:dateTime-to-decimal</link></code> .</para></section>
<section xml:id="function-must-refer-to-external-tan-file"><title><code>tan:must-refer-to-external-tan-file()</code></title><para><code>tan:must-refer-to-external-tan-file($node as node()) as xs:boolean</code></para><para> Input: node in a TAN document. </para><para> Output: boolean value indicating whether the node or its parent must name or refer to a TAN file. </para><para>Used by template <code><link linkend="template-core-errors">ŧ core-errors</link></code></para><para>Relies upon <code><link linkend="function-class-number">tan:class-number</link></code> <code><link linkend="variable-elements-that-must-always-refer-to-tan-files">$elements-that-must-always-refer-to-tan-files</link></code> <code><link linkend="variable-relationship-keywords-for-tan-files">$relationship-keywords-for-tan-files</link></code> .</para></section>
<section xml:id="function-normalize-text"><title><code>tan:normalize-text()</code></title><para><emphasis>Option 1 (TAN-core-functions)</emphasis></para><para><code>tan:normalize-text($text as xs:string*) as xs:string*</code></para><para> one-parameter version of full function below </para><para>Used by template <code><link linkend="template-tan-key-errors">ŧ tan-key-errors</link></code> <code><link linkend="template-prep-tan-lm">ŧ prep-tan-lm</link></code> <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code> <code><link linkend="template-prep-class-1">ŧ prep-class-1</link></code> <code><link linkend="template-prep-class-1">ŧ prep-class-1</link></code> <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> <code><link linkend="template-prep-class-2-doc-pass-1">ŧ prep-class-2-doc-pass-1</link></code> <code><link linkend="template-prep-class-2-doc-pass-1">ŧ prep-class-2-doc-pass-1</link></code> <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code> <code><link linkend="template-prep-class-2-doc-pass-2">ŧ prep-class-2-doc-pass-2</link></code> <code><link linkend="template-prep-class-2-doc-pass-3">ŧ prep-class-2-doc-pass-3</link></code> <code><link linkend="template-prep-tan-key">ŧ prep-tan-key</link></code> <code><link linkend="template-resolve-attr-include">ŧ resolve-attr-include</link></code> <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-attribute-errors">ŧ core-attribute-errors</link></code></para><para>Used by function <code><link linkend="function-text-join">tan:text-join</link></code>() <code><link linkend="function-feature-test-to-groups">tan:feature-test-to-groups</link></code>() <code><link linkend="function-convert-ref-to-div-fragment">tan:convert-ref-to-div-fragment</link></code>() <code><link linkend="function-get-toks">tan:get-toks</link></code>() <code><link linkend="function-sequence-expand">tan:sequence-expand</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-has-relationship">tan:has-relationship</link></code>() <code><link linkend="function-analyze-elements-with-numeral-attributes">tan:analyze-elements-with-numeral-attributes</link></code>() <code><link linkend="function-idrefs">tan:idrefs</link></code>() <code><link linkend="function-idrefs-loop">tan:idrefs-loop</link></code>()</para><para>Relies upon <code><link linkend="function-normalize-text">tan:normalize-text</link></code> .</para><para><emphasis>Option 2 (TAN-core-functions)</emphasis></para><para><code>tan:normalize-text($text as xs:string*, $render-common as xs:boolean) as xs:string*</code></para><para> Input: any sequence of strings; a boolean indicating whether the results should be normalized further to a common form </para><para> Output: that sequence, with each item's space normalized, and removal of any help requested </para><para> A common form is one where the string is converted to lower-case, and hyphens are replaced by spaces </para><para>Used by template <code><link linkend="template-tan-key-errors">ŧ tan-key-errors</link></code> <code><link linkend="template-prep-tan-lm">ŧ prep-tan-lm</link></code> <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code> <code><link linkend="template-prep-class-1">ŧ prep-class-1</link></code> <code><link linkend="template-prep-class-1">ŧ prep-class-1</link></code> <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> <code><link linkend="template-prep-class-2-doc-pass-1">ŧ prep-class-2-doc-pass-1</link></code> <code><link linkend="template-prep-class-2-doc-pass-1">ŧ prep-class-2-doc-pass-1</link></code> <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code> <code><link linkend="template-prep-class-2-doc-pass-2">ŧ prep-class-2-doc-pass-2</link></code> <code><link linkend="template-prep-class-2-doc-pass-3">ŧ prep-class-2-doc-pass-3</link></code> <code><link linkend="template-prep-tan-key">ŧ prep-tan-key</link></code> <code><link linkend="template-resolve-attr-include">ŧ resolve-attr-include</link></code> <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-attribute-errors">ŧ core-attribute-errors</link></code></para><para>Used by function <code><link linkend="function-text-join">tan:text-join</link></code>() <code><link linkend="function-feature-test-to-groups">tan:feature-test-to-groups</link></code>() <code><link linkend="function-convert-ref-to-div-fragment">tan:convert-ref-to-div-fragment</link></code>() <code><link linkend="function-get-toks">tan:get-toks</link></code>() <code><link linkend="function-sequence-expand">tan:sequence-expand</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-has-relationship">tan:has-relationship</link></code>() <code><link linkend="function-analyze-elements-with-numeral-attributes">tan:analyze-elements-with-numeral-attributes</link></code>() <code><link linkend="function-idrefs">tan:idrefs</link></code>() <code><link linkend="function-idrefs-loop">tan:idrefs-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-pluck"><title><code>tan:pluck()</code></title><para><code>tan:pluck($fragment as item()*, $pluck-beyond-level as xs:integer, $keep-short-branch-leaves as xs:boolean) as item()*</code></para><para> Input: any document fragment or element; a number indicating a level in the hierarchy of the fragment; a boolean indicating whether leaf elements that fall short of the previous parameter should be included </para><para> Output: the fragment of the tree that is beyond the point indicated, and perhaps (depending upon the third parameter) with other leafs that are not quite at that level </para><para> This function was written primarily to serve <code><link linkend="function-convert-ref-to-div-fragment">tan:convert-ref-to-div-fragment</link></code>(), to get a slice of divs that correspond to a range, without the ancestry of those divs </para><para>Used by function <code><link linkend="function-convert-ref-to-div-fragment">tan:convert-ref-to-div-fragment</link></code>()</para><para>Relies upon <code><link linkend="template-pluck">ŧ pluck</link></code> .</para></section>
<section xml:id="function-prepend-id-or-idrefs"><title><code>tan:prepend-id-or-idrefs()</code></title><para><code>tan:prepend-id-or-idrefs($elements-with-id-or-id-refs as element(), $string-to-prepend as xs:string?) as element()*</code></para><para> Input: any elements with <code><link linkend="attribute-xmlid">@xml:id</link></code> or an attribute that points to an element with an <code><link linkend="attribute-xmlid">@xml:id</link></code> value; some string that should be prepended to every value of every attribute found</para><para> Output: the same elements, but with each value prepended with the string and a double hyphen </para><para> This function is critical for disambiguating during the inclusion process. </para><para>Used by template <code><link linkend="template-resolve-attr-include">ŧ resolve-attr-include</link></code></para><para>Relies upon <code><link linkend="template-prepend-id-or-idrefs">ŧ prepend-id-or-idrefs</link></code> .</para></section>
<section xml:id="function-q-ref"><title><code>tan:q-ref()</code></title><para><code>tan:q-ref($elements as element()*) as xs:string*</code></para><para> Input: any elements </para><para> Output: the q-ref of each element</para><para> A q-ref is defined as a concatenated string  consisting of, for each ancestor and self, the name plus the number indicating which sibling it is of that type of element. </para><para> This function is useful when trying to correlate an unbreadmarked file (an original TAN file) against its breadcrumbed counterpart (e.g., <code><link linkend="variable-self-resolved">$self-resolved</link></code>), to check for errors. If any changes in element names, e.g., TEI - &gt; TAN-T, are made during the standard preparation process, those changes are made here as well. </para><para>Used by key <code><link linkend="key-q-ref">ʞ q-ref</link></code>')</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-resolve-doc"><title><code>tan:resolve-doc()</code></title><para><emphasis>Option 1 (TAN-core-functions)</emphasis></para><para><code>tan:resolve-doc($TAN-documents as document-node()*) as document-node()*</code></para><para> one-parameter version of the fuller one, below </para><para>Used by variable <code><link linkend="variable-morphologies-prepped">$morphologies-prepped</link></code> <code><link linkend="variable-self-resolved">$self-resolved</link></code> <code><link linkend="variable-inclusions-resolved">$inclusions-resolved</link></code> <code><link linkend="variable-keys-resolved">$keys-resolved</link></code> <code><link linkend="variable-sources-resolved">$sources-resolved</link></code> <code><link linkend="variable-see-alsos-resolved">$see-alsos-resolved</link></code></para><para>Used by template <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code></para><para>Used by function <code><link linkend="function-prep-TAN-mor">tan:prep-TAN-mor</link></code>() <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>() <code><link linkend="function-get-src-1st-da-resolved">tan:get-src-1st-da-resolved</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>()</para><para>Relies upon <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> .</para><para><emphasis>Option 2 (TAN-core-functions)</emphasis></para><para><code>tan:resolve-doc($TAN-documents as document-node()*, $leave-breadcrumbs as xs:boolean, $add-attr-to-root-element-named-what as xs:string?, $add-what-val-to-new-root-attribute as xs:string*, $restrict-inclusion-to-what-element-names as xs:string*, $doc-ids-already-checked as xs:string*) as document-node()*</code></para><para> Input: any number of TAN documents; boolean indicating whether documents should be breadcrumbed or not; optional name of an attribute and a sequence of strings to stamp in each document's root element as a way of providing another identifier for the document; a list of element names to which any inclusion should be restricted; a list of ids for documents that should not be used to generate inclusions.</para><para>      Output: those same documents, resolved, along the following steps:</para><para>           1. Stamp each document with <code>@base-uri</code> and the optional root attribute; resolve <code><link linkend="attribute-href">@href</link></code>, putting the original (if different) in <code>@orig-href</code></para><para>           2. Normalize <code><link linkend="attribute-ref">@ref</link></code> and <code><link linkend="attribute-n">@n</link></code>, converting them whenever possible to Arabic numerals, and keeping the old versions as <code>@orig-ref</code> and <code>@orig-n</code>; if <code><link linkend="attribute-n">@n</link></code> is a range or series, it will be expanded</para><para>           3. Resolve every element that has <code>@include.</code></para><para>           4. Resolve every element that has <code>@which.</code></para><para>           5. If anything happened at #3, remove any duplicate elements. </para><para> This function and the functions connected with it are among the most important in the TAN library, since they provide critical stamping (for validation and diagnosing problems) and expand abbreviated parts (to explicitly state what is implied by <code><link linkend="attribute-include">@include</link></code> and <code><link linkend="attribute-which">@which</link></code>) of a TAN file. Perhaps more importantly, it is a recursive function that is used to resolve not only the beginning of the inclusion process but its middle and endpoints as well. </para><para>Used by variable <code><link linkend="variable-morphologies-prepped">$morphologies-prepped</link></code> <code><link linkend="variable-self-resolved">$self-resolved</link></code> <code><link linkend="variable-inclusions-resolved">$inclusions-resolved</link></code> <code><link linkend="variable-keys-resolved">$keys-resolved</link></code> <code><link linkend="variable-sources-resolved">$sources-resolved</link></code> <code><link linkend="variable-see-alsos-resolved">$see-alsos-resolved</link></code></para><para>Used by template <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code></para><para>Used by function <code><link linkend="function-prep-TAN-mor">tan:prep-TAN-mor</link></code>() <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>() <code><link linkend="function-get-src-1st-da-resolved">tan:get-src-1st-da-resolved</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>() <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>()</para><para>Relies upon <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code> <code><link linkend="function-normalize-text">tan:normalize-text</link></code> <code><link linkend="template-resolve-attr-include">ŧ resolve-attr-include</link></code> <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code> <code><link linkend="template-first-stamp">ŧ first-stamp</link></code> <code><link linkend="function-strip-duplicates">tan:strip-duplicates</link></code> <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code> <code><link linkend="function-analyze-elements-with-numeral-attributes">tan:analyze-elements-with-numeral-attributes</link></code> <code><link linkend="function-error">tan:error</link></code> .</para></section>
<section xml:id="function-resolve-keyword"><title><code>tan:resolve-keyword()</code></title><para><code>tan:resolve-keyword($items as item()*, $extra-keys as document-node()*) as item()*</code></para><para> Input: any items; any extra keys </para><para> Output: the same items, but with elements with <code><link linkend="attribute-which">@which</link></code> expanded into their full form, using the predefined TAN vocabulary and the extra keys supplied </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code> .</para></section>
<section xml:id="function-rom-to-int"><title><code>tan:rom-to-int()</code></title><para><code>tan:rom-to-int($arg as xs:string*) as xs:integer*</code></para><para> Input: any roman numeral less than 5000 </para><para> Output: the numeral converted to an integer </para><para>Used by function <code><link linkend="function-strings-to-numeral-or-numeral-type">tan:strings-to-numeral-or-numeral-type</link></code>() <code><link linkend="function-interpret-n-vals">tan:interpret-n-vals</link></code>() <code><link linkend="function-analyze-elements-with-numeral-attributes">tan:analyze-elements-with-numeral-attributes</link></code>()</para><para>Relies upon <code><link linkend="variable-roman-numeral-pattern">$roman-numeral-pattern</link></code> .</para></section>
<section xml:id="function-sequence-collapse"><title><code>tan:sequence-collapse()</code></title><para><code>tan:sequence-collapse($integers as xs:integer*) as xs:string?</code></para><para> Input: a sequence of integers </para><para> Output: a string that puts them in a TAN-like compact string </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-sequence-error"><title><code>tan:sequence-error()</code></title><para><emphasis>Option 1 (TAN-core-functions)</emphasis></para><para><code>tan:sequence-error($results-of-sequence-expand as xs:integer*) as element()*</code></para><para>Used by template <code><link linkend="template-prep-tan-a-div-pass-a">ŧ prep-tan-a-div-pass-a</link></code> <code><link linkend="template-mark-tok-chars">ŧ mark-tok-chars</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><para> Input: any results of the function <code><link linkend="function-sequence-expand">tan:sequence-expand</link></code>() </para><para> Output: error nodes, if any </para><para>Used by template <code><link linkend="template-prep-tan-a-div-pass-a">ŧ prep-tan-a-div-pass-a</link></code> <code><link linkend="template-mark-tok-chars">ŧ mark-tok-chars</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-sequence-expand"><title><code>tan:sequence-expand()</code></title><para><code>tan:sequence-expand($selector as xs:string?, $max as xs:integer?) as xs:integer*</code></para><para> Input: a string representing a TAN selector (used by <code><link linkend="attribute-pos">@pos</link></code>, <code>@char</code>, <code><link linkend="attribute-seg">@seg</link></code>), and an integer defining the value of 'last' </para><para> Output: a sequence of numbers representing the positions selected, unsorted, and retaining duplicate values.</para><para>            Example: ("2 - 4, last-5 - last, 36", 50) -&gt; (2, 3, 4, 45, 46, 47, 48, 49, 50, 36)</para><para>            Errors will be flagged as follows:</para><para>            0 = value that falls below 1</para><para>            -1 = value that surpasses the value of <code>$max</code></para><para>            -2 = ranges that call for negative steps, e.g., '4 - 2' </para><para>Used by template <code><link linkend="template-prep-tan-a-div-pass-a">ŧ prep-tan-a-div-pass-a</link></code> <code><link linkend="template-insert-seg-into-leaf-divs-in-hierarchy-fragment">ŧ insert-seg-into-leaf-divs-in-hierarchy-fragment</link></code> <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> <code><link linkend="template-mark-tok-chars">ŧ mark-tok-chars</link></code> <code><link linkend="template-unconsolidate-anas">ŧ unconsolidate-anas</link></code></para><para>Used by function <code><link linkend="function-get-picked-srcs-id-refs">tan:get-picked-srcs-id-refs</link></code>() <code><link linkend="function-get-toks">tan:get-toks</link></code>() <code><link linkend="function-group-tok-elements">tan:group-tok-elements</link></code>()</para><para>Relies upon <code><link linkend="function-normalize-text">tan:normalize-text</link></code> .</para></section>
<section xml:id="function-shallow-copy"><title><code>tan:shallow-copy()</code></title><para><emphasis>Option 1 (TAN-core-functions)</emphasis></para><para><code>tan:shallow-copy($elements as element()*) as element()*</code></para><para> one-parameter version of the fuller one, below </para><para>Used by function <code><link linkend="function-convert-ref-to-div-fragment">tan:convert-ref-to-div-fragment</link></code>() <code><link linkend="function-shallow-copy">tan:shallow-copy</link></code>()</para><para>Relies upon <code><link linkend="function-shallow-copy">tan:shallow-copy</link></code> .</para><para><emphasis>Option 2 (TAN-core-functions)</emphasis></para><para><code>tan:shallow-copy($elements as element()*, $keep-attributes as xs:boolean) as element()*</code></para><para> Input: any document fragment; boolean indicating whether attributes should be kept </para><para> Output: a shallow copy of the fragment, perhaps with attributes </para><para>Used by function <code><link linkend="function-convert-ref-to-div-fragment">tan:convert-ref-to-div-fragment</link></code>() <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="function-stamp-id"><title><code>tan:stamp-id()</code></title><para><emphasis>Option 1 (TAN-core-functions)</emphasis></para><para><code>tan:stamp-id($nodes as item()*, $names-of-elements-to-imprint-with-gloss-id as xs:string*) as item()*</code></para><para> 2-parameter form of the fuller version, below </para><para>Used by function <code><link linkend="function-stamp-id">tan:stamp-id</link></code>()</para><para>Relies upon <code><link linkend="function-stamp-id">tan:stamp-id</link></code> .</para><para><emphasis>Option 2 (TAN-core-functions)</emphasis></para><para><code>tan:stamp-id($nodes as item()*, $names-of-elements-to-imprint-with-gloss-id as xs:string*, $name-of-attribute-to-hold-id as xs:string?) as item()*</code></para><para> Input: any element or document fragment, one or more strings of the names of elements that should be imprinted with <code><link linkend="attribute-id">@id</link></code> </para><para> Output: the same, with any elements whose names match the input with <code><link linkend="attribute-id">@id</link></code> added, consisting of the name of the element appended with the number of its position relative to all preceding elements of the same name. </para><para>Used by function <code><link linkend="function-stamp-id">tan:stamp-id</link></code>()</para><para>Relies upon <code><link linkend="template-stamp-element-id">ŧ stamp-element-id</link></code> .</para></section>
<section xml:id="function-strip-duplicates"><title><code>tan:strip-duplicates()</code></title><para><code>tan:strip-duplicates($tan-docs as document-node()*, $element-names-to-check as xs:string*) as document-node()*</code></para><para> Input: any documents, sequence of strings of element names </para><para> Output: the same documents after removing duplicate elements whose names match the second parameter. </para><para>Used by function <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>()</para><para>Relies upon <code><link linkend="template-strip-duplicates">ŧ strip-duplicates</link></code> .</para></section>
<section xml:id="function-syc-to-int"><title><code>tan:syc-to-int()</code></title><para><code>tan:syc-to-int($syriac-numerals as xs:string*) as xs:integer*</code></para><para> Input: Syriac letters that represent numerals </para><para> Output: the numerical value of the letters </para><para> NB, this does not take into account the use of letters representing numbers 1000 and greater </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-letter-to-number">tan:letter-to-number</link></code> .</para></section>
<section xml:id="function-tan-type"><title><code>tan:tan-type()</code></title><para><code>tan:tan-type($nodes as node()*) as xs:string*</code></para><para> Input: any nodes </para><para> Output: the names of the root elements; if not present, a zero-length string is returned </para><para>Used by function <code><link linkend="function-class-number">tan:class-number</link></code>() <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-tokenize-leaf-div"><title><code>tan:tokenize-leaf-div()</code></title><para><code>tan:tokenize-leaf-div($text as xs:string?, $token-definition as element(tan:token-definition)?, $count-toks as xs:boolean?) as element()?</code></para><para> Input: single string and a <code><link linkend="element-token-definition">&lt;token-definition&gt;</link></code>. </para><para> Output: <code>&lt;result&gt;</code> with matches and non matches enclosed by <code><link linkend="element-tok">&lt;tok&gt;</link></code> and <code>&lt;non-tok&gt;</code>, respectively </para><para>Used by template <code><link linkend="template-tokenize-prepped-class-1">ŧ tokenize-prepped-class-1</link></code></para><para>Relies upon <code><link linkend="variable-token-definitions-reserved">$token-definitions-reserved</link></code> <code><link linkend="template-count-tokens">ŧ count-tokens</link></code> .</para></section>
<section xml:id="function-uri-directory"><title><code>tan:uri-directory()</code></title><para><code>tan:uri-directory($uris as xs:string*) as xs:string*</code></para><para> Input: any URIs, as strings </para><para> Output: the file path </para><para> NB, this function does not assume any URIs have been resolved </para><para>Used by variable <code><link linkend="variable-doc-parent-directory">$doc-parent-directory</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-uri-relative-to"><title><code>tan:uri-relative-to()</code></title><para><code>tan:uri-relative-to($uri-to-revise as xs:string?, $uri-to-revise-against as xs:string?) as xs:string?</code></para><para> Input: two strings representing URIs </para><para> Output: the first string resolved relative to the second string </para><para>Used by template <code><link linkend="template-core-attribute-errors">ŧ core-attribute-errors</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-value-of"><title><code>tan:value-of()</code></title><para><code>tan:value-of($items as item()*) as xs:string?</code></para><para> Input: any sequence of items </para><para> Output: the value of each item </para><para> Puts &lt;xsl:value-of/&gt; into a concise function </para><para>Used by template <code><link linkend="template-prep-tan-a-div-pass-b">ŧ prep-tan-a-div-pass-b</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-zip-uris"><title><code>tan:zip-uris()</code></title><para><code>tan:zip-uris($uris as xs:string*) as xs:anyURI*</code></para><para> Input: any string representing a uri </para><para> Output: the same string with 'zip:' prepended if it represents a uri to a file in an archive (docx, jar, zip, etc.) </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
</section>
</section>
<section><title>TAN-core-errors global variables, keys, and functions summarized</title><section><title>variables</title><section xml:id="variable-all-function-uses-of-error"><title><code>$all-function-uses-of-error</code></title><para>Definition: <code><link linkend="variable-all-functions">$all-functions</link>//*[matches(@select, concat('tan:error\([', <link linkend="variable-quot">$quot</link>, <link linkend="variable-apos">$apos</link>, ']'))]</code></para><para>Used by variable <code><link linkend="variable-function-error-ids">$function-error-ids</link></code></para><para>Relies upon <code><link linkend="variable-all-functions">$all-functions</link></code> <code><link linkend="variable-quot">$quot</link></code> <code><link linkend="variable-apos">$apos</link></code> .</para></section>
<section xml:id="variable-all-schema-uses-of-error"><title><code>$all-schema-uses-of-error</code></title><para>Definition: <code>          <link linkend="variable-all-schemas">$all-schemas</link>/sch:*//*[some $i in @*             satisfies matches($i, 'tan:error\(')]</code></para><para>Used by variable <code><link linkend="variable-schema-error-ids">$schema-error-ids</link></code></para><para>Relies upon <code><link linkend="variable-all-schemas">$all-schemas</link></code> .</para></section>
<section xml:id="variable-errors"><title><code>$errors</code></title><para>Definition: <code>doc('TAN-errors.xml')</code></para><para>Used by variable <code><link linkend="variable-errors-not-used">$errors-not-used</link></code></para><para>Used by template <code><link linkend="template-referenced-doc-errors">ŧ referenced-doc-errors</link></code></para><para>Used by function <code><link linkend="function-error">tan:error</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-errors-not-used"><title><code>$errors-not-used</code></title><para>Definition: <code><link linkend="variable-errors">$errors</link>//tan:error[not(<link linkend="attribute-xmlid">@xml:id</link> = (<link linkend="variable-function-error-ids">$function-error-ids</link>, <link linkend="variable-schema-error-ids">$schema-error-ids</link>))]</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-errors">$errors</link></code> <code><link linkend="variable-function-error-ids">$function-error-ids</link></code> <code><link linkend="variable-schema-error-ids">$schema-error-ids</link></code> .</para></section>
<section xml:id="variable-function-error-ids"><title><code>$function-error-ids</code></title><para>Definition: <code>          for $i in <link linkend="variable-all-function-uses-of-error">$all-function-uses-of-error</link>/@select          return             replace($i, concat('.*tan:error\([', <link linkend="variable-apos">$apos</link>, <link linkend="variable-quot">$quot</link>, '](\w+).+'), '$1')</code></para><para>Used by variable <code><link linkend="variable-errors-not-used">$errors-not-used</link></code></para><para>Relies upon <code><link linkend="variable-all-function-uses-of-error">$all-function-uses-of-error</link></code> <code><link linkend="variable-apos">$apos</link></code> <code><link linkend="variable-quot">$quot</link></code> .</para></section>
<section xml:id="variable-help-trigger-regex"><title><code>$help-trigger-regex</code></title><para>Definition: <code><link linkend="function-escape">tan:escape</link>($help-trigger)</code></para><para>Used by template <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code></para><para>Used by function <code><link linkend="function-convert-ref-to-div-fragment">tan:convert-ref-to-div-fragment</link></code>() <code><link linkend="function-normalize-text">tan:normalize-text</link></code>() <code><link linkend="function-analyze-elements-with-numeral-attributes">tan:analyze-elements-with-numeral-attributes</link></code>() <code><link linkend="function-help-requested">tan:help-requested</link></code>()</para><para>Relies upon <code><link linkend="function-escape">tan:escape</link></code> .</para></section>
<section xml:id="variable-schema-error-ids"><title><code>$schema-error-ids</code></title><para>Definition: <code>          for $i in <link linkend="variable-all-schema-uses-of-error">$all-schema-uses-of-error</link>/(@select, @value)[matches(., 'tan:error\(')]          return             replace($i, concat('.*tan:error\([', <link linkend="variable-apos">$apos</link>, <link linkend="variable-quot">$quot</link>, '](\w+).+'), '$1')</code></para><para>Used by variable <code><link linkend="variable-errors-not-used">$errors-not-used</link></code></para><para>Relies upon <code><link linkend="variable-all-schema-uses-of-error">$all-schema-uses-of-error</link></code> <code><link linkend="variable-apos">$apos</link></code> <code><link linkend="variable-quot">$quot</link></code> .</para></section>
</section>
<section><title>functions</title><section xml:id="function-error"><title><code>tan:error()</code></title><para><emphasis>Option 1 (TAN-core-errors)</emphasis></para><para><code>tan:error($idref as xs:string) as element()?</code></para><para> one-parameter function of the master version, below </para><para>Used by variable <code><link linkend="variable-erroneously-looped-doc">$erroneously-looped-doc</link></code></para><para>Used by template <code><link linkend="template-prep-tan-a-div-pass-a">ŧ prep-tan-a-div-pass-a</link></code> <code><link linkend="template-prep-tan-a-div-pass-b">ŧ prep-tan-a-div-pass-b</link></code> <code><link linkend="template-insert-seg-into-leaf-divs-in-hierarchy-fragment">ŧ insert-seg-into-leaf-divs-in-hierarchy-fragment</link></code> <code><link linkend="template-insert-seg-into-leaf-divs-in-hierarchy-fragment">ŧ insert-seg-into-leaf-divs-in-hierarchy-fragment</link></code> <code><link linkend="template-prep-verbosely">ŧ prep-verbosely</link></code> <code><link linkend="template-segment-tokd-prepped-class-1">ŧ segment-tokd-prepped-class-1</link></code> <code><link linkend="template-tan-key-errors">ŧ tan-key-errors</link></code> <code><link linkend="template-tan-key-errors">ŧ tan-key-errors</link></code> <code><link linkend="template-tan-key-errors">ŧ tan-key-errors</link></code> <code><link linkend="template-tan-key-errors">ŧ tan-key-errors</link></code> <code><link linkend="template-prep-tan-lm">ŧ prep-tan-lm</link></code> <code><link linkend="template-prep-tan-lm">ŧ prep-tan-lm</link></code> <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code> <code><link linkend="template-prep-class-1">ŧ prep-class-1</link></code> <code><link linkend="template-prep-class-1">ŧ prep-class-1</link></code> <code><link linkend="template-prep-class-1">ŧ prep-class-1</link></code> <code><link linkend="template-prep-tan-claims">ŧ prep-tan-claims</link></code> <code><link linkend="template-prep-tan-claims">ŧ prep-tan-claims</link></code> <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> <code><link linkend="template-prep-class-2-doc-pass-2">ŧ prep-class-2-doc-pass-2</link></code> <code><link linkend="template-prep-class-2-doc-pass-2">ŧ prep-class-2-doc-pass-2</link></code> <code><link linkend="template-resolve-attr-include">ŧ resolve-attr-include</link></code> <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code> <code><link linkend="template-TAN-A-div-errors">ŧ TAN-A-div-errors</link></code> <code><link linkend="template-TAN-A-div-errors">ŧ TAN-A-div-errors</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-class-1-copy-errors">ŧ class-1-copy-errors</link></code> <code><link linkend="template-class-2-errors">ŧ class-2-errors</link></code> <code><link linkend="template-class-2-errors">ŧ class-2-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-attribute-errors">ŧ core-attribute-errors</link></code></para><para>Used by function <code><link linkend="function-merge-analyzed-stats">tan:merge-analyzed-stats</link></code>() <code><link linkend="function-prep-class-2-doc-pass-2">tan:prep-class-2-doc-pass-2</link></code>() <code><link linkend="function-group-by-IRIs">tan:group-by-IRIs</link></code>() <code><link linkend="function-pick-prepped-class-1-data">tan:pick-prepped-class-1-data</link></code>() <code><link linkend="function-cull-prepped-class-1-data">tan:cull-prepped-class-1-data</link></code>() <code><link linkend="function-convert-ref-to-div-fragment">tan:convert-ref-to-div-fragment</link></code>() <code><link linkend="function-get-toks">tan:get-toks</link></code>() <code><link linkend="function-get-context-prepped">tan:get-context-prepped</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-resolve-doc">tan:resolve-doc</link></code>() <code><link linkend="function-error">tan:error</link></code>() <code><link linkend="function-error">tan:error</link></code>() <code><link linkend="function-error-report">tan:error-report</link></code>() <code><link linkend="function-idrefs-loop">tan:idrefs-loop</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> .</para><para><emphasis>Option 2 (TAN-core-errors)</emphasis></para><para><code>tan:error($idref as xs:string, $diagnostic-message as item()*) as element()?</code></para><para> two-parameter function of the master version, below </para><para>Used by variable <code><link linkend="variable-erroneously-looped-doc">$erroneously-looped-doc</link></code></para><para>Used by template <code><link linkend="template-prep-tan-a-div-pass-a">ŧ prep-tan-a-div-pass-a</link></code> <code><link linkend="template-prep-tan-a-div-pass-b">ŧ prep-tan-a-div-pass-b</link></code> <code><link linkend="template-insert-seg-into-leaf-divs-in-hierarchy-fragment">ŧ insert-seg-into-leaf-divs-in-hierarchy-fragment</link></code> <code><link linkend="template-insert-seg-into-leaf-divs-in-hierarchy-fragment">ŧ insert-seg-into-leaf-divs-in-hierarchy-fragment</link></code> <code><link linkend="template-prep-verbosely">ŧ prep-verbosely</link></code> <code><link linkend="template-segment-tokd-prepped-class-1">ŧ segment-tokd-prepped-class-1</link></code> <code><link linkend="template-tan-key-errors">ŧ tan-key-errors</link></code> <code><link linkend="template-tan-key-errors">ŧ tan-key-errors</link></code> <code><link linkend="template-tan-key-errors">ŧ tan-key-errors</link></code> <code><link linkend="template-tan-key-errors">ŧ tan-key-errors</link></code> <code><link linkend="template-prep-tan-lm">ŧ prep-tan-lm</link></code> <code><link linkend="template-prep-tan-lm">ŧ prep-tan-lm</link></code> <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code> <code><link linkend="template-prep-class-1">ŧ prep-class-1</link></code> <code><link linkend="template-prep-class-1">ŧ prep-class-1</link></code> <code><link linkend="template-prep-class-1">ŧ prep-class-1</link></code> <code><link linkend="template-prep-tan-claims">ŧ prep-tan-claims</link></code> <code><link linkend="template-prep-tan-claims">ŧ prep-tan-claims</link></code> <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> <code><link linkend="template-prep-class-2-doc-pass-2">ŧ prep-class-2-doc-pass-2</link></code> <code><link linkend="template-prep-class-2-doc-pass-2">ŧ prep-class-2-doc-pass-2</link></code> <code><link linkend="template-resolve-attr-include">ŧ resolve-attr-include</link></code> <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code> <code><link linkend="template-TAN-A-div-errors">ŧ TAN-A-div-errors</link></code> <code><link linkend="template-TAN-A-div-errors">ŧ TAN-A-div-errors</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-class-1-copy-errors">ŧ class-1-copy-errors</link></code> <code><link linkend="template-class-2-errors">ŧ class-2-errors</link></code> <code><link linkend="template-class-2-errors">ŧ class-2-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-attribute-errors">ŧ core-attribute-errors</link></code></para><para>Used by function <code><link linkend="function-merge-analyzed-stats">tan:merge-analyzed-stats</link></code>() <code><link linkend="function-prep-class-2-doc-pass-2">tan:prep-class-2-doc-pass-2</link></code>() <code><link linkend="function-group-by-IRIs">tan:group-by-IRIs</link></code>() <code><link linkend="function-pick-prepped-class-1-data">tan:pick-prepped-class-1-data</link></code>() <code><link linkend="function-cull-prepped-class-1-data">tan:cull-prepped-class-1-data</link></code>() <code><link linkend="function-convert-ref-to-div-fragment">tan:convert-ref-to-div-fragment</link></code>() <code><link linkend="function-get-toks">tan:get-toks</link></code>() <code><link linkend="function-get-context-prepped">tan:get-context-prepped</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-resolve-doc">tan:resolve-doc</link></code>() <code><link linkend="function-error">tan:error</link></code>() <code><link linkend="function-error">tan:error</link></code>() <code><link linkend="function-error-report">tan:error-report</link></code>() <code><link linkend="function-idrefs-loop">tan:idrefs-loop</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> .</para><para><emphasis>Option 3 (TAN-core-errors)</emphasis></para><para><code>tan:error($idref as xs:string, $diagnostic-message as item()*, $fix as item()*, $fix-type as xs:string?) as element()?</code></para><para> Input: idref of an error, and optional diagnostic messages</para><para>         Output: the appropriate <code>&lt;error&gt;</code> with each diagnostic inserted as a child <code>&lt;message&gt;</code></para><para>      </para><para>Used by variable <code><link linkend="variable-erroneously-looped-doc">$erroneously-looped-doc</link></code></para><para>Used by template <code><link linkend="template-prep-tan-a-div-pass-a">ŧ prep-tan-a-div-pass-a</link></code> <code><link linkend="template-prep-tan-a-div-pass-b">ŧ prep-tan-a-div-pass-b</link></code> <code><link linkend="template-insert-seg-into-leaf-divs-in-hierarchy-fragment">ŧ insert-seg-into-leaf-divs-in-hierarchy-fragment</link></code> <code><link linkend="template-insert-seg-into-leaf-divs-in-hierarchy-fragment">ŧ insert-seg-into-leaf-divs-in-hierarchy-fragment</link></code> <code><link linkend="template-prep-verbosely">ŧ prep-verbosely</link></code> <code><link linkend="template-segment-tokd-prepped-class-1">ŧ segment-tokd-prepped-class-1</link></code> <code><link linkend="template-tan-key-errors">ŧ tan-key-errors</link></code> <code><link linkend="template-tan-key-errors">ŧ tan-key-errors</link></code> <code><link linkend="template-tan-key-errors">ŧ tan-key-errors</link></code> <code><link linkend="template-tan-key-errors">ŧ tan-key-errors</link></code> <code><link linkend="template-prep-tan-lm">ŧ prep-tan-lm</link></code> <code><link linkend="template-prep-tan-lm">ŧ prep-tan-lm</link></code> <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code> <code><link linkend="template-prep-class-1">ŧ prep-class-1</link></code> <code><link linkend="template-prep-class-1">ŧ prep-class-1</link></code> <code><link linkend="template-prep-class-1">ŧ prep-class-1</link></code> <code><link linkend="template-prep-tan-claims">ŧ prep-tan-claims</link></code> <code><link linkend="template-prep-tan-claims">ŧ prep-tan-claims</link></code> <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> <code><link linkend="template-prep-class-2-doc-pass-2">ŧ prep-class-2-doc-pass-2</link></code> <code><link linkend="template-prep-class-2-doc-pass-2">ŧ prep-class-2-doc-pass-2</link></code> <code><link linkend="template-resolve-attr-include">ŧ resolve-attr-include</link></code> <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code> <code><link linkend="template-TAN-A-div-errors">ŧ TAN-A-div-errors</link></code> <code><link linkend="template-TAN-A-div-errors">ŧ TAN-A-div-errors</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-class-1-copy-errors">ŧ class-1-copy-errors</link></code> <code><link linkend="template-class-2-errors">ŧ class-2-errors</link></code> <code><link linkend="template-class-2-errors">ŧ class-2-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-attribute-errors">ŧ core-attribute-errors</link></code></para><para>Used by function <code><link linkend="function-merge-analyzed-stats">tan:merge-analyzed-stats</link></code>() <code><link linkend="function-prep-class-2-doc-pass-2">tan:prep-class-2-doc-pass-2</link></code>() <code><link linkend="function-group-by-IRIs">tan:group-by-IRIs</link></code>() <code><link linkend="function-pick-prepped-class-1-data">tan:pick-prepped-class-1-data</link></code>() <code><link linkend="function-cull-prepped-class-1-data">tan:cull-prepped-class-1-data</link></code>() <code><link linkend="function-convert-ref-to-div-fragment">tan:convert-ref-to-div-fragment</link></code>() <code><link linkend="function-get-toks">tan:get-toks</link></code>() <code><link linkend="function-get-context-prepped">tan:get-context-prepped</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-resolve-doc">tan:resolve-doc</link></code>() <code><link linkend="function-error">tan:error</link></code>() <code><link linkend="function-error">tan:error</link></code>() <code><link linkend="function-error-report">tan:error-report</link></code>() <code><link linkend="function-idrefs-loop">tan:idrefs-loop</link></code>()</para><para>Relies upon <code><link linkend="variable-errors">$errors</link></code> <code><link linkend="function-fix">tan:fix</link></code> .</para></section>
<section xml:id="function-error-report"><title><code>tan:error-report()</code></title><para><code>tan:error-report($error as item()*) as xs:string*</code></para><para> Input: strings corresponding to an error id or tan:error elements </para><para>      Output: a sequence of strings constituting a report to the user </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> .</para></section>
<section xml:id="function-fix"><title><code>tan:fix()</code></title><para><code>tan:fix($fix as item()*, $fix-type as xs:string?) as element()?</code></para><para> Input: any items; a string representing a fix type </para><para> Ouput: a tan:fix element with <code><link linkend="attribute-type">@type</link></code> </para><para> This function is used to populate a file with material to be used by Schematron Quick Fixes </para><para>Used by template <code><link linkend="template-core-attribute-errors">ŧ core-attribute-errors</link></code></para><para>Used by function <code><link linkend="function-error">tan:error</link></code>() <code><link linkend="function-help-or-info">tan:help-or-info</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-fragment-to-text"><title><code>tan:fragment-to-text()</code></title><para><code>tan:fragment-to-text($fragment as item()*) as xs:string?</code></para><para> Input: any document fragment </para><para> Output: a string representation of the fragment </para><para> This function is used to represent XML fragments in a plain text message, used particularly in validation reports </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-fragment-to-text">ŧ fragment-to-text</link></code> .</para></section>
<section xml:id="function-help"><title><code>tan:help()</code></title><para><code>tan:help($diagnostic-message as item()*, $fix as item()*, $fix-type as xs:string?) as element()</code></para><para>Used by template <code><link linkend="template-prep-tan-a-div-pass-a">ŧ prep-tan-a-div-pass-a</link></code> <code><link linkend="template-prep-tan-a-div-pass-a">ŧ prep-tan-a-div-pass-a</link></code> <code><link linkend="template-prep-class-1">ŧ prep-class-1</link></code> <code><link linkend="template-prep-class-2-doc-pass-1">ŧ prep-class-2-doc-pass-1</link></code> <code><link linkend="template-prep-class-2-doc-pass-2">ŧ prep-class-2-doc-pass-2</link></code> <code><link linkend="template-resolve-keyword">ŧ resolve-keyword</link></code> <code><link linkend="template-core-attribute-errors">ŧ core-attribute-errors</link></code></para><para>Used by function <code><link linkend="function-convert-ref-to-div-fragment">tan:convert-ref-to-div-fragment</link></code>() <code><link linkend="function-get-toks">tan:get-toks</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-or-info"><title><code>tan:help-or-info()</code></title><para><code>tan:help-or-info($diagnostic-message as item()*, $fix as item()*, $fix-type as xs:string?, $is-info as xs:boolean) as element()</code></para><para> Input: a sequence of items to populate a message, a series of items to be used in a SQFix, and a boolean value indicating whether the output element should be named info (rather than help) </para><para> Output: an element with the appropriate help or info message </para><para>Used by function <code><link linkend="function-help">tan:help</link></code>() <code><link linkend="function-info">tan:info</link></code>()</para><para>Relies upon <code><link linkend="function-fix">tan:fix</link></code> .</para></section>
<section xml:id="function-help-requested"><title><code>tan:help-requested()</code></title><para><code>tan:help-requested($node as node()?) as xs:boolean</code></para><para>Used by template <code><link linkend="template-prep-tan-a-div-pass-a">ŧ prep-tan-a-div-pass-a</link></code> <code><link linkend="template-prep-tan-a-div-pass-a">ŧ prep-tan-a-div-pass-a</link></code> <code><link linkend="template-prep-tan-lm">ŧ prep-tan-lm</link></code> <code><link linkend="template-prep-class-1">ŧ prep-class-1</link></code> <code><link linkend="template-prep-class-2-doc-pass-1">ŧ prep-class-2-doc-pass-1</link></code> <code><link linkend="template-prep-class-2-doc-pass-2">ŧ prep-class-2-doc-pass-2</link></code> <code><link linkend="template-prep-class-2-doc-pass-3">ŧ prep-class-2-doc-pass-3</link></code> <code><link linkend="template-core-attribute-errors">ŧ core-attribute-errors</link></code></para><para>Used by function <code><link linkend="function-get-toks">tan:get-toks</link></code>()</para><para>Relies upon <code><link linkend="variable-help-trigger-regex">$help-trigger-regex</link></code> .</para></section>
<section xml:id="function-idrefs"><title><code>tan:idrefs()</code></title><para><code>tan:idrefs($idrefs as xs:string?, $nodes as node()*) as node()*</code></para><para> Input: a string; documents or document fragments </para><para> Output: the elements that have an <code><link linkend="attribute-xmlid">@xml:id</link></code> value that matches the string, after it has been normalized and resolved for proxies </para><para>Used by template <code><link linkend="template-core-errors">ŧ core-errors</link></code></para><para>Relies upon <code><link linkend="function-normalize-text">tan:normalize-text</link></code> <code><link linkend="function-idrefs-loop">tan:idrefs-loop</link></code> .</para></section>
<section xml:id="function-idrefs-loop"><title><code>tan:idrefs-loop()</code></title><para><code>tan:idrefs-loop($id-refs-to-check as xs:string*, $results-so-far as node()*, $nodes-to-check as node()*, $alias-ids-already-checked as xs:string*) as node()*</code></para><para> Loop function for tan:idrefs </para><para>Used by function <code><link linkend="function-idrefs">tan:idrefs</link></code>() <code><link linkend="function-idrefs-loop">tan:idrefs-loop</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-normalize-text">tan:normalize-text</link></code> <code><link linkend="function-idrefs-loop">tan:idrefs-loop</link></code> .</para></section>
<section xml:id="function-info"><title><code>tan:info()</code></title><para><code>tan:info($diagnostic-message as item()*, $fix as item()*, $fix-type as xs:string?) as element()</code></para><para>Used by template <code><link linkend="template-prep-verbosely">ŧ prep-verbosely</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code></para><para>Used by function <code><link linkend="function-convert-ref-to-div-fragment">tan:convert-ref-to-div-fragment</link></code>()</para><para>Relies upon <code><link linkend="function-help-or-info">tan:help-or-info</link></code> .</para></section>
</section>
</section>
<section><title>TAN-class-1 global variables, keys, and functions summarized</title><section><title>variables</title><section xml:id="variable-self-class-1-errors-marked"><title><code>$self-class-1-errors-marked</code></title><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="variable-self-prepped">$self-prepped</link></code> <code><link linkend="function-analyze-string-length">tan:analyze-string-length</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-class-1-copy-errors">ŧ class-1-copy-errors</link></code> .</para></section>
<section xml:id="variable-self-leaf-div-flatref-duplicates"><title><code>$self-leaf-div-flatref-duplicates</code></title><para>Definition: <code><link linkend="function-duplicate-values">tan:duplicate-values</link>(<link linkend="variable-self-leaf-div-flatrefs">$self-leaf-div-flatrefs</link>)</code></para><para>Used by template <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code></para><para>Relies upon <code><link linkend="function-duplicate-values">tan:duplicate-values</link></code> <code><link linkend="variable-self-leaf-div-flatrefs">$self-leaf-div-flatrefs</link></code> .</para></section>
<section xml:id="variable-self-leaf-div-flatrefs"><title><code>$self-leaf-div-flatrefs</code></title><para>Definition: <code><link linkend="variable-self-prepped">$self-prepped</link>/tan:TAN-T/tan:body//tan:div[not(tan:div)]/<link linkend="attribute-ref">@ref</link></code></para><para>Used by variable <code><link linkend="variable-self-leaf-div-flatref-duplicates">$self-leaf-div-flatref-duplicates</link></code></para><para>Relies upon <code><link linkend="variable-self-prepped">$self-prepped</link></code> .</para></section>
</section>
<section><title>functions</title><section xml:id="function-compare-copies"><title><code>tan:compare-copies()</code></title><para><code>tan:compare-copies($document as document-node(), $copy as document-node()) as document-node()</code></para><para> Input: two class-1 documents, one treated as a master and the other as a copy </para><para> Output: addition of <code>@copy-loc</code> to the first document's leaf divs, indicating at what character number a div's text is found in the copy. If the text is not found in the copy, the corresponding text from the copy is placed in <code>@copy-text</code> and <code><link linkend="attribute-ref">@ref</link></code>, with the faulty div's ref, is returned. </para><para> This function is useful for diagnosing and fixing discrepancies between copies, especially those that have a different segmentation / div structure. </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-text-join">tan:text-join</link></code> <code><link linkend="template-compare-copies">ŧ compare-copies</link></code> <code><link linkend="template-get-mismatched-text">ŧ get-mismatched-text</link></code> .</para></section>
<section xml:id="function-get-ref-seq"><title><code>tan:get-ref-seq()</code></title><para><code>tan:get-ref-seq($resolved-class-1-doc as document-node()) as xs:string*</code></para><para> Input: any resolved class 1 document </para><para> Output: a sequence of flatrefs for the document </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-flatref">tan:flatref</link></code> .</para></section>
<section xml:id="function-mark-splits"><title><code>tan:mark-splits()</code></title><para><code>tan:mark-splits($c1-doc-prepped as document-node()) as document-node()</code></para><para> Input: any prepped class 1 doc </para><para> Output: the same document, but with <code><link linkend="attribute-pos">@pos</link></code> added to <code><link linkend="element-div">&lt;div&gt;</link></code>s that are split.</para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-prep-resolved-class-1-doc">tan:prep-resolved-class-1-doc</link></code> <code><link linkend="function-duplicate-values">tan:duplicate-values</link></code> <code><link linkend="template-mark-splits">ŧ mark-splits</link></code> .</para></section>
<section xml:id="function-normalize-doc-space"><title><code>tan:normalize-doc-space()</code></title><para><code>tan:normalize-doc-space($doc as document-node()+) as document-node()+</code></para><para> Input: any document </para><para> Output: that same document, but with each <code>text(</code>) space-normalized </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-normalize-space">ŧ normalize-space</link></code> .</para></section>
</section>
</section>
<section><title>TAN-class-2 global variables, keys, and functions summarized</title><section><title>variables</title><section xml:id="variable-source-lacks-id"><title><code>$source-lacks-id</code></title><para>Definition: <code>          if (<link linkend="variable-head">$head</link>/tan:source/<link linkend="attribute-xmlid">@xml:id</link>) then             false()          else             true()</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-src-elements"><title><code>$src-elements</code></title><para>Definition: <code><link linkend="variable-head">$head</link>/tan:source</code></para><para>Used by variable <code><link linkend="variable-src-ids">$src-ids</link></code></para><para>Used by function <code><link linkend="function-get-src-1st-da">tan:get-src-1st-da</link></code>() <code><link linkend="function-get-picked-srcs-id-refs">tan:get-picked-srcs-id-refs</link></code>()</para><para>Relies upon <code><link linkend="variable-head">$head</link></code> .</para></section>
<section xml:id="variable-src-ids"><title><code>$src-ids</code></title><para>Definition: <code>          if (<link linkend="variable-src-elements">$src-elements</link>/<link linkend="attribute-xmlid">@xml:id</link>) then             <link linkend="variable-src-elements">$src-elements</link>/<link linkend="attribute-xmlid">@xml:id</link>          else             '1'</code></para><para>Used by function <code><link linkend="function-get-src-1st-da">tan:get-src-1st-da</link></code>() <code><link linkend="function-get-picked-srcs-id-refs">tan:get-picked-srcs-id-refs</link></code>() <code><link linkend="function-get-src-1st-da-resolved">tan:get-src-1st-da-resolved</link></code>()</para><para>Relies upon <code><link linkend="variable-src-elements">$src-elements</link></code> .</para></section>
</section>
<section><title>keys</title><section xml:id="key-div-via-ref"><title><code>ʞ div-via-ref')</code></title><para>Looks for elements matching <code>tan:div</code></para><para>Used by function <code><link linkend="function-convert-ref-to-div-fragment">tan:convert-ref-to-div-fragment</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-ref"><title><code>tan:analyze-ref()</code></title><para><code>tan:analyze-ref($ref as xs:string) as element()</code></para><para> Input: any <code><link linkend="attribute-ref">@ref</link></code>'s value </para><para> Output: series of <code>&lt;ref&gt;</code>s, punctuated by <code>&lt;comma&gt;</code> or <code>&lt;dash&gt;</code>; each <code>&lt;ref&gt;</code> holds the likely best value; if that differs from the original, <code>@orig</code> holds the original value of the ref </para><para>Used by function <code><link linkend="function-convert-ref-to-div-fragment">tan:convert-ref-to-div-fragment</link></code>()</para><para>Relies upon <code><link linkend="template-analyze-ref">ŧ analyze-ref</link></code> .</para></section>
<section xml:id="function-convert-ref-to-div-fragment"><title><code>tan:convert-ref-to-div-fragment()</code></title><para><code>tan:convert-ref-to-div-fragment($prepped-src-doc as document-node()*, $element-with-ref-attr as element(), $keep-text as xs:boolean, $missing-ref-returned-as-info-not-error as xs:boolean) as item()*</code></para><para> Input: source document, at least prepped; an element with an unresolved <code><link linkend="attribute-ref">@ref</link></code>; indication whether the text should be retrieved or not </para><para> Output: a fragment from the source document with the hierarchies of only those divs that correspond to the range specified by <code><link linkend="attribute-ref">@ref</link></code> </para><para> It is assumed that the second parameter refers to the first; that is, the source document really is the one that the element with <code><link linkend="attribute-ref">@ref</link></code> is trying to cite. </para><para> It is also assumed that in any range where the second element has fewer <code><link linkend="attribute-n">@n</link></code> values than the first, then the abbreviated form will be checked before the form actually stated. For example, 1 1 - 2 will be tested first for 1 1 - 1 2, which, if not corresponding to an actual <code><link linkend="element-div">&lt;div&gt;</link></code>, will be interpeted as 1 1 - 2 </para><para>Used by template <code><link linkend="template-prep-class-2-doc-pass-3">ŧ prep-class-2-doc-pass-3</link></code></para><para>Relies upon <code><link linkend="function-help">tan:help</link></code> <code><link linkend="function-info">tan:info</link></code> <code><link linkend="function-analyze-ref">tan:analyze-ref</link></code> <code><link linkend="function-error">tan:error</link></code> <code><link linkend="variable-help-trigger-regex">$help-trigger-regex</link></code> <code><link linkend="function-shallow-copy">tan:shallow-copy</link></code> <code><link linkend="function-pluck">tan:pluck</link></code> <code><link linkend="function-normalize-text">tan:normalize-text</link></code> .</para></section>
<section xml:id="function-counts-to-firsts"><title><code>tan:counts-to-firsts()</code></title><para><code>tan:counts-to-firsts($seq as xs:integer*) as xs:integer*</code></para><para> Input: sequence of numbers representing counts of items. </para><para>         Output: sequence of numbers representing the first position of each item within the total count.</para><para>      E.g., (4, 12, 0, 7) - &gt; (1, 5, 17, 17)</para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-counts-to-lasts"><title><code>tan:counts-to-lasts()</code></title><para><code>tan:counts-to-lasts($seq as xs:integer*) as xs:integer*</code></para><para> Input: sequence of numbers representing counts of items. </para><para>         Output: sequence of numbers representing the last position of each item within the total count.</para><para>      E.g., (4, 12, 0, 7) - &gt; (4, 16, 16, 23)</para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-cull-prepped-class-1-data"><title><code>tan:cull-prepped-class-1-data()</code></title><para><code>tan:cull-prepped-class-1-data($elements-with-atomic-src-and-ref-attributes as element()*, $src-1st-da-prepped as document-node()*, $treat-src-and-ref-as-regex as xs:boolean) as document-node()*</code></para><para> Used to create a subset of <code>$src-1st-da-prepped</code> </para><para>         Input: (1) prepped source documents. (2) one or more elements with <code><link linkend="attribute-src">@src</link></code> and <code>@ref.</code> It is assumed that both </para><para>         attributes have single, atomic values (i.e., no ranges in <code><link linkend="attribute-ref">@ref</link></code>). (3) boolean indicating whether the values</para><para>         of <code><link linkend="attribute-src">@src</link></code> and <code><link linkend="attribute-ref">@ref</link></code> should be treated as regular expressions</para><para>         Output: src-1st-da-prepped, proper subset, excluding matches</para><para>      </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="template-cull-prepped-class-1">ŧ cull-prepped-class-1</link></code> .</para></section>
<section xml:id="function-element-key"><title><code>tan:element-key()</code></title><para><code>tan:element-key($node as node()) as xs:string?</code></para><para>Used by template <code><link linkend="template-merge-nodes">Ŧ merge-nodes</link></code></para><para>Used by function <code><link linkend="function-recombine-docs">tan:recombine-docs</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-expand-src-and-div-type-ref"><title><code>tan:expand-src-and-div-type-ref()</code></title><para><code>tan:expand-src-and-div-type-ref($elements-with-src-and-div-type as element()*) as element()*</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-prep-class-2-doc-pass-1">ŧ prep-class-2-doc-pass-1</link></code> .</para></section>
<section xml:id="function-expand-tok"><title><code>tan:expand-tok()</code></title><para><code>tan:expand-tok($tok-elements as element()*, $src-1st-da-tokenized as document-node()*) as element()*</code></para><para> Input: any <code><link linkend="element-tok">&lt;tok&gt;</link></code> with atomic <code><link linkend="attribute-src">@src</link></code> and <code><link linkend="attribute-ref">@ref</link></code> values; any number of tokenized source documents </para><para> Output: one <code><link linkend="element-tok">&lt;tok&gt;</link></code> per token invoked, adding <code><link linkend="attribute-n">@n</link></code> to specify where in the <code><link linkend="element-div">&lt;div&gt;</link></code> the token is to be found; if <code><link linkend="attribute-chars">@chars</link></code> is present it is replaced with a space-delimited list of integers </para><para>Used by template <code><link linkend="template-prep-class-2-doc-pass-4">ŧ prep-class-2-doc-pass-4</link></code></para><para>Relies upon <code><link linkend="function-get-toks">tan:get-toks</link></code> <code><link linkend="template-mark-tok-chars">ŧ mark-tok-chars</link></code> .</para></section>
<section xml:id="function-get-context-prepped"><title><code>tan:get-context-prepped()</code></title><para><code>tan:get-context-prepped($class-2-self3 as document-node(), $class-2-context-self2 as document-node()*, $srcs-prepped as document-node()*, $srcs-resolved as document-node()*) as document-node()*</code></para><para> Input: a class 2 document, transformed to level <code>$self2</code> or higher; one or more contextual class 2 documents whose should reference system should be reconciled to the first document; the intervening source documents, in both prepped and resolved forms. </para><para> Output: the class 2 context documents, with values converted (where needed) to the main class 2 document </para><para> This function is used primarily in the context of a TAN-A-div file, where one finds supplementary TAN-LM and TAN-A-tok data that provide contextual information about source documents. This function will convert those satellite class 2 files to the naming conventions adopted in the original class 2 files. Because the prepped sources are oftentimes the intermediary, they are like a spoke connecting the original document (the hub) to the contextual documents (the rim). </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-prep-resolved-class-1-doc">tan:prep-resolved-class-1-doc</link></code> <code><link linkend="function-prep-class-2-doc-pass-3">tan:prep-class-2-doc-pass-3</link></code> <code><link linkend="template-prep-rim-pass-1">ŧ prep-rim-pass-1</link></code> <code><link linkend="template-prep-rim-pass-2">ŧ prep-rim-pass-2</link></code> .</para></section>
<section xml:id="function-get-picked-srcs-id-refs"><title><code>tan:get-picked-srcs-id-refs()</code></title><para><code>tan:get-picked-srcs-id-refs($srcs-picked as item()*) as xs:string*</code></para><para>Used by function <code><link linkend="function-get-src-1st-da">tan:get-src-1st-da</link></code>()</para><para>Relies upon <code><link linkend="function-sequence-expand">tan:sequence-expand</link></code> <code><link linkend="variable-src-elements">$src-elements</link></code> <code><link linkend="variable-src-ids">$src-ids</link></code> .</para></section>
<section xml:id="function-get-src-1st-da"><title><code>tan:get-src-1st-da()</code></title><para><emphasis>Option 1 (TAN-class-2-functions)</emphasis></para><para><code>tan:get-src-1st-da() as document-node()*</code></para><para> zero-parameter version of the function below </para><para>Used by function <code><link linkend="function-get-src-1st-da">tan:get-src-1st-da</link></code>() <code><link linkend="function-get-src-1st-da-resolved">tan:get-src-1st-da-resolved</link></code>()</para><para>Relies upon <code><link linkend="function-get-src-1st-da">tan:get-src-1st-da</link></code> <code><link linkend="variable-src-ids">$src-ids</link></code> .</para><para><emphasis>Option 2 (TAN-class-2-functions)</emphasis></para><para><code>tan:get-src-1st-da($srcs-picked as item()*) as document-node()*</code></para><para> This version allows one to exclude certain sources from processing </para><para>Used by function <code><link linkend="function-get-src-1st-da">tan:get-src-1st-da</link></code>() <code><link linkend="function-get-src-1st-da-resolved">tan:get-src-1st-da-resolved</link></code>()</para><para>Relies upon <code><link linkend="function-get-picked-srcs-id-refs">tan:get-picked-srcs-id-refs</link></code> <code><link linkend="function-first-loc-available">tan:first-loc-available</link></code> <code><link linkend="variable-src-elements">$src-elements</link></code> <code><link linkend="variable-empty-doc">$empty-doc</link></code> .</para></section>
<section xml:id="function-get-src-1st-da-resolved"><title><code>tan:get-src-1st-da-resolved()</code></title><para><emphasis>Option 1 (TAN-class-2-functions)</emphasis></para><para><code>tan:get-src-1st-da-resolved() </code></para><para> zero-parameter version of the next function </para><para>Used by function <code><link linkend="function-get-src-1st-da-resolved">tan:get-src-1st-da-resolved</link></code>()</para><para>Relies upon <code><link linkend="function-get-src-1st-da-resolved">tan:get-src-1st-da-resolved</link></code> <code><link linkend="function-get-src-1st-da">tan:get-src-1st-da</link></code> <code><link linkend="variable-src-ids">$src-ids</link></code> .</para><para><emphasis>Option 2 (TAN-class-2-functions)</emphasis></para><para><code>tan:get-src-1st-da-resolved($picked-class-1-docs as document-node()*, $picked-src-ids as xs:string*) </code></para><para>Used by function <code><link linkend="function-get-src-1st-da-resolved">tan:get-src-1st-da-resolved</link></code>()</para><para>Relies upon <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> .</para></section>
<section xml:id="function-get-src-1st-da-tokenized"><title><code>tan:get-src-1st-da-tokenized()</code></title><para><emphasis>Option 1 (TAN-class-2-functions)</emphasis></para><para><code>tan:get-src-1st-da-tokenized($class-2-doc-prepped-step-3 as document-node()?, $resolved-class-1-doc as document-node()*) as document-node()*</code></para><para>Used by function <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>() <code><link linkend="function-get-src-1st-da-tokenized">tan:get-src-1st-da-tokenized</link></code>()</para><para>Relies upon <code><link linkend="function-get-src-1st-da-tokenized">tan:get-src-1st-da-tokenized</link></code> .</para><para><emphasis>Option 2 (TAN-class-2-functions)</emphasis></para><para><code>tan:get-src-1st-da-tokenized($class-2-doc-prepped-step-3 as document-node()?, $resolved-class-1-doc as document-node()*, $add-n-attr as xs:boolean, $tokenize-selectively as xs:boolean) as document-node()*</code></para><para> Input: class-2 document prepped through stage 3; related source class 1 documents, resolved; boolean indicating whether <code><link linkend="attribute-n">@n</link></code> should be added to new <code><link linkend="element-tok">&lt;tok&gt;</link></code>s; boolean indicating whether the entirety of the documents should be tokenized, or only those leaf difvs that are mentioned by the class 2 document </para><para> Output: same class 1 documents tokenized, selectively or completely </para><para>Used by function <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>() <code><link linkend="function-get-src-1st-da-tokenized">tan:get-src-1st-da-tokenized</link></code>()</para><para>Relies upon <code><link linkend="template-tokenize-prepped-class-1">ŧ tokenize-prepped-class-1</link></code> .</para></section>
<section xml:id="function-get-src-1st-da-with-lms"><title><code>tan:get-src-1st-da-with-lms()</code></title><para><code>tan:get-src-1st-da-with-lms($tokenized-class-1-doc as document-node(), $prepped-tan-lm-docs as document-node()*) as document-node()</code></para><para> Input: any tokenized class 1 document; any prepped TAN-LM documents </para><para> Output: the original document, imprinted with lexico-morphological data </para><para> For now, this function assumes that every TAN-LM document pertains to the tokenized class-1 doc </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-add-lm-to-tok">ŧ add-lm-to-tok</link></code> .</para></section>
<section xml:id="function-get-toks"><title><code>tan:get-toks()</code></title><para><code>tan:get-toks($tokenized-div as element()?, $tok-elements as element()*) as element()*</code></para><para> returns the <code><link linkend="element-tok">&lt;tok&gt;</link></code>s from a given <code><link linkend="element-div">&lt;div&gt;</link></code>, including <code><link linkend="attribute-n">@n</link></code> with integer position </para><para> Input: (1) any <code><link linkend="element-div">&lt;div&gt;</link></code> with <code><link linkend="element-tok">&lt;tok&gt;</link></code> and <code>&lt;non-tok&gt;</code> children (result of <code>tan:tokenize-prepped-1st-da(</code>)) (2) any number of <code><link linkend="element-tok">&lt;tok&gt;</link></code>s that are deemed to relate to the <code><link linkend="element-div">&lt;div&gt;</link></code> chosen (i.e., <code><link linkend="attribute-src">@src</link></code> and <code><link linkend="attribute-ref">@ref</link></code> will be ignored, assumed to correspond to the input <code><link linkend="element-div">&lt;div&gt;</link></code>) </para><para> Output: the <code><link linkend="element-tok">&lt;tok&gt;</link></code> elements picked. </para><para>Used by function <code><link linkend="function-expand-tok">tan:expand-tok</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-help">tan:help</link></code> <code><link linkend="function-normalize-text">tan:normalize-text</link></code> <code><link linkend="function-matches">tan:matches</link></code> <code><link linkend="function-help-requested">tan:help-requested</link></code> <code><link linkend="function-sequence-expand">tan:sequence-expand</link></code> .</para></section>
<section xml:id="function-group-by-IRIs"><title><code>tan:group-by-IRIs()</code></title><para><emphasis>Option 1 (TAN-class-2-functions)</emphasis></para><para><code>tan:group-by-IRIs($elements-with-IRI-children as element()*) as element()*</code></para><para>Used by variable <code><link linkend="variable-features-grouped">$features-grouped</link></code></para><para>Used by function <code><link linkend="function-prep-class-2-doc-pass-2">tan:prep-class-2-doc-pass-2</link></code>() <code><link linkend="function-group-by-IRIs">tan:group-by-IRIs</link></code>()</para><para>Relies upon <code><link linkend="function-group-by-IRIs">tan:group-by-IRIs</link></code> .</para><para><emphasis>Option 2 (TAN-class-2-functions)</emphasis></para><para><code>tan:group-by-IRIs($elements-with-IRI-children as element()*, $equate-elements as element()*) as element()*</code></para><para> Input: Any elements that have children <code><link linkend="element-IRI">&lt;IRI&gt;</link></code>s; a sequence of elements that pre-determine select equations </para><para>  Output: Those same elements grouped as children of either <code><link linkend="element-equate-works">&lt;equate-works&gt;</link></code>, <code><link linkend="element-equate-div-types">&lt;equate-div-types&gt;</link></code>, or <code><link linkend="element-group">&lt;group&gt;</link></code> (depending upon name of element), based on equivalencies in IRI values. Each <code><link linkend="element-group">&lt;group&gt;</link></code> will also include an <code><link linkend="attribute-n">@n</link></code> value, acting as a kind of identifier. </para><para>  Note, IRI equivalencies are greedy and transitive. If element X has IRI A,  Y has IRIs A and B, and Z has IRI B, then elements X and Z will be equated. </para><para>Used by variable <code><link linkend="variable-features-grouped">$features-grouped</link></code></para><para>Used by function <code><link linkend="function-prep-class-2-doc-pass-2">tan:prep-class-2-doc-pass-2</link></code>() <code><link linkend="function-group-by-IRIs">tan:group-by-IRIs</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-group-by-IRIs-loop">tan:group-by-IRIs-loop</link></code> .</para></section>
<section xml:id="function-group-by-IRIs-loop"><title><code>tan:group-by-IRIs-loop()</code></title><para><code>tan:group-by-IRIs-loop($tree-of-groups-so-far as element()?, $elements-to-group as element()*) as element()*</code></para><para> Input: an element containing zero or more <code><link linkend="element-group">&lt;group&gt;</link></code> children; a sequence of elements yet to be placed in a <code><link linkend="element-group">&lt;group&gt;</link></code> </para><para>  Output: a sequence of groups (= <code><link linkend="element-equate-works">&lt;equate-works&gt;</link></code>, <code><link linkend="element-equate-div-types">&lt;equate-div-types&gt;</link></code>, or <code><link linkend="element-group">&lt;group&gt;</link></code>) lumping together elements  based on commonality of their <code><link linkend="element-IRI">&lt;IRI&gt;</link></code> values </para><para>Used by function <code><link linkend="function-group-by-IRIs">tan:group-by-IRIs</link></code>() <code><link linkend="function-group-by-IRIs-loop">tan:group-by-IRIs-loop</link></code>()</para><para>Relies upon <code><link linkend="function-group-by-IRIs-loop">tan:group-by-IRIs-loop</link></code> .</para></section>
<section xml:id="function-max-integer"><title><code>tan:max-integer()</code></title><para><code>tan:max-integer($input as xs:string) as xs:integer?</code></para><para> input: string of TAN <code><link linkend="attribute-pos">@pos</link></code> or <code><link linkend="attribute-chars">@chars</link></code> selectors </para><para>        output: largest integer, ignoring value of 'last'</para><para>        E.g., "5 - 15, last-20" -&gt; 15 </para><para>        Useful for validation routines that want merely to check if a range is out of limits</para><para>      </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-min-last"><title><code>tan:min-last()</code></title><para><code>tan:min-last($input as xs:string, $last as xs:integer) as xs:integer</code></para><para> input: <code><link linkend="attribute-pos">@pos</link></code> or <code><link linkend="attribute-chars">@chars</link></code> selectors, number defining "last" </para><para>        output: smallest reference related to "last"</para><para>        E.g., "5 - 15, last-20", 34 -&gt; 14 </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-normalize-refs"><title><code>tan:normalize-refs()</code></title><para><emphasis>Option 1 (TAN-class-2-functions)</emphasis></para><para><code>tan:normalize-refs($elements-with-attr-ref as element()*) as xs:string*</code></para><para>Used by template <code><link linkend="template-unconsolidate-anas">ŧ unconsolidate-anas</link></code></para><para>Used by function <code><link linkend="function-normalize-refs">tan:normalize-refs</link></code>()</para><para>Relies upon <code><link linkend="function-normalize-refs">tan:normalize-refs</link></code> .</para><para><emphasis>Option 2 (TAN-class-2-functions)</emphasis></para><para><code>tan:normalize-refs($elements-with-attr-ref as element()*, $ambiguous-numeral-types as element()*) as xs:string*</code></para><para> Input: elements that take <code><link linkend="attribute-ref">@ref</link></code>; a numeral types declaration (elements produced by <code>tan:analyze-attr-n-or-ref-numerals(</code>)) </para><para> Output: a sequence of punctuation- and space-normalized reference strings, converting the items that match numerals into Arabic numerals and setting the strings lowercase </para><para>Used by template <code><link linkend="template-unconsolidate-anas">ŧ unconsolidate-anas</link></code></para><para>Used by function <code><link linkend="function-normalize-refs">tan:normalize-refs</link></code>()</para><para>Relies upon <code><link linkend="function-analyze-elements-with-numeral-attributes">tan:analyze-elements-with-numeral-attributes</link></code> <code><link linkend="variable-n-type">$n-type</link></code> <code><link linkend="variable-separator-hierarchy">$separator-hierarchy</link></code> .</para></section>
<section xml:id="function-ordinal"><title><code>tan:ordinal()</code></title><para><code>tan:ordinal($in as xs:integer*) as xs:string*</code></para><para> Input: one or more numerals</para><para>        Output: one or more strings with the English form of the ordinal form of the input number</para><para>        E.g., (1, 4, 17)  -&gt;  ('first','fourth','17th'). </para><para>        </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-pick-prepped-class-1-data"><title><code>tan:pick-prepped-class-1-data()</code></title><para><code>tan:pick-prepped-class-1-data($elements-with-atomic-src-and-ref-attributes as element()*, $src-1st-da-prepped as document-node()*, $treat-src-and-ref-as-regex as xs:boolean) as document-node()*</code></para><para> Used to create a subset of <code>$src-1st-da-prepped</code> </para><para>         Input: (1) prepped source documents. (2) one or more elements with <code><link linkend="attribute-src">@src</link></code> and <code>@ref.</code> It is assumed that both </para><para>         attributes have single, atomic values (i.e., no ranges in <code><link linkend="attribute-ref">@ref</link></code>). (3) boolean indicating whether the values</para><para>         of <code><link linkend="attribute-src">@src</link></code> and <code><link linkend="attribute-ref">@ref</link></code> should be treated as regular expressions</para><para>         Output: src-1st-da-prepped, proper subset that consists exclusively of matches</para><para>      </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="template-pick-prepped-class-1">ŧ pick-prepped-class-1</link></code> .</para></section>
<section xml:id="function-prep-class-2-doc-pass-2"><title><code>tan:prep-class-2-doc-pass-2()</code></title><para><code>tan:prep-class-2-doc-pass-2($class-2-doc-prepped-pass-1 as document-node()?, $src-1st-da-resolved as document-node()*) as document-node()*</code></para><para> Input: class 2 document that has already gone through pass 1 of preparation; resolved documents </para><para> Output: the class 2 document, with expansions of <code><link linkend="element-equate-works">&lt;equate-works&gt;</link></code> and <code><link linkend="element-equate-div-types">&lt;equate-div-types&gt;</link></code> and determination of <code><link linkend="element-token-definition">&lt;token-definition&gt;</link></code>. </para><para>Used by function <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="variable-token-definitions-reserved">$token-definitions-reserved</link></code> <code><link linkend="function-group-by-IRIs">tan:group-by-IRIs</link></code> <code><link linkend="template-prep-class-2-doc-pass-2">ŧ prep-class-2-doc-pass-2</link></code> .</para></section>
<section xml:id="function-prep-class-2-doc-pass-3"><title><code>tan:prep-class-2-doc-pass-3()</code></title><para><code>tan:prep-class-2-doc-pass-3($class-2-doc-prepped-pass-2 as document-node()?, $sources-prepped-1 as document-node()*) as document-node()?</code></para><para> Input: a class-2 document, that has gone through two stages of preparation; sources that have gone through one level of preparation </para><para> Output: the class-2 document with <code><link linkend="attribute-work">@work</link></code> and <code><link linkend="attribute-ref">@ref</link></code> expanded; provide help on <code><link linkend="element-equate-works">&lt;equate-works&gt;</link></code>, <code><link linkend="element-equate-div-types">&lt;equate-div-types&gt;</link></code> (TAN-A-div) </para><para>Used by function <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>() <code><link linkend="function-get-context-prepped">tan:get-context-prepped</link></code>()</para><para>Relies upon <code><link linkend="template-prep-class-2-doc-pass-3">ŧ prep-class-2-doc-pass-3</link></code> .</para></section>
<section xml:id="function-prep-class-2-doc-pass-4"><title><code>tan:prep-class-2-doc-pass-4()</code></title><para><code>tan:prep-class-2-doc-pass-4($class-2-doc-prepped-pass-3 as document-node()?, $sources-selectively-tokenized as document-node()*) as document-node()?</code></para><para>Used by function <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>()</para><para>Relies upon <code><link linkend="template-prep-class-2-doc-pass-4">ŧ prep-class-2-doc-pass-4</link></code> .</para></section>
<section xml:id="function-prep-resolved-class-2-doc"><title><code>tan:prep-resolved-class-2-doc()</code></title><para><emphasis>Option 1 (TAN-class-2-functions)</emphasis></para><para><code>tan:prep-resolved-class-2-doc($resolved-class-2-doc as document-node()?) as document-node()*</code></para><para>Used by variable <code><link linkend="variable-self-and-sources-prepped-prelim">$self-and-sources-prepped-prelim</link></code> <code><link linkend="variable-self-and-sources-prepped">$self-and-sources-prepped</link></code> <code><link linkend="variable-self-and-sources-prepped">$self-and-sources-prepped</link></code></para><para>Used by function <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>()</para><para>Relies upon <code><link linkend="variable-doc-id">$doc-id</link></code> <code><link linkend="variable-sources-resolved">$sources-resolved</link></code> <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code> <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code> .</para><para><emphasis>Option 2 (TAN-class-2-functions)</emphasis></para><para><code>tan:prep-resolved-class-2-doc($resolved-class-2-doc as document-node()?, $resolved-class-2-sources as document-node()*) as document-node()*</code></para><para> Input: a class 2 document </para><para> Output: that same document, prepped, followed by its source documents, which have been prepped enough to justify or explain the content of the original class 2 document </para><para> Preparation of a class 2 document is complicated, requiring navigation back and forth between the class-2 document and its sources, resolving them along the way. The first document returned is always the resolved class-2 document. Any documents that follow are resolved sources. Here's the process that is followed:</para><para>      </para><para>      FOCUS           ALTERATIONS</para><para>      =======   =============================================================================================</para><para>      sources   Resolve each source document (including add <code><link linkend="attribute-src">@src</link></code> to root element)</para><para>      self      Expand <code><link linkend="attribute-src">@src</link></code> (<code><link linkend="element-equate-works">&lt;equate-works&gt;</link></code> gets special treatment), <code><link linkend="attribute-div-type-ref">@div-type-ref</link></code>; normalize <code><link linkend="attribute-ref">@ref</link></code>; add <code><link linkend="attribute-xmlid">@xml:id</link></code> to TAN-LM <code><link linkend="element-source">&lt;source&gt;</link></code>; add <code><link linkend="attribute-group">@group</link></code> to elements that take <code><link linkend="attribute-cont">@cont</link></code>; add <code><link linkend="attribute-work">@work</link></code> to continuations that should take it</para><para>      self      Expand <code><link linkend="element-token-definition">&lt;token-definition&gt;</link></code> and (TAN-A-div) <code><link linkend="element-equate-works">&lt;equate-works&gt;</link></code>, <code><link linkend="element-equate-div-types">&lt;equate-div-types&gt;</link></code></para><para>      sources   Add <code><link linkend="attribute-work">@work</link></code> to each root element (TAN-A-div), rename <code>@ns</code>, suppress select div types, replace div types with numerical equivalent. Sources' flat ref should now be commensurate with class 2 file's use of <code>@ref.</code></para><para>      self      Expand <code><link linkend="attribute-work">@work</link></code>, <code><link linkend="attribute-ref">@ref</link></code> (iterate elements over calculated values); provide help on <code><link linkend="element-equate-works">&lt;equate-works&gt;</link></code> and <code><link linkend="element-equate-div-types">&lt;equate-div-types&gt;</link></code></para><para>      sources   Tokenize and (if the self is a TAN-A-div) segment those <code><link linkend="element-div">&lt;div&gt;</link></code>s that are referred to</para><para>      self      Expand <code><link linkend="attribute-val">@val</link></code>, <code><link linkend="attribute-pos">@pos</link></code> for <code><link linkend="element-tok">&lt;tok&gt;</link></code>, look for errors in previous step</para><para>      self      Check for errors in previous steps</para><para>      </para><para>      [Further preparation is then conducted by the functions specific to the particular class 2 format]</para><para>      </para><para>Used by variable <code><link linkend="variable-self-and-sources-prepped-prelim">$self-and-sources-prepped-prelim</link></code> <code><link linkend="variable-self-and-sources-prepped">$self-and-sources-prepped</link></code> <code><link linkend="variable-self-and-sources-prepped">$self-and-sources-prepped</link></code></para><para>Used by function <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>()</para><para>Relies upon <code><link linkend="function-prep-class-2-doc-pass-2">tan:prep-class-2-doc-pass-2</link></code> <code><link linkend="function-get-src-1st-da-tokenized">tan:get-src-1st-da-tokenized</link></code> <code><link linkend="function-prep-resolved-class-1-doc">tan:prep-resolved-class-1-doc</link></code> <code><link linkend="template-class-2-errors">ŧ class-2-errors</link></code> <code><link linkend="template-prep-class-2-doc-pass-1">ŧ prep-class-2-doc-pass-1</link></code> <code><link linkend="function-prep-class-2-doc-pass-4">tan:prep-class-2-doc-pass-4</link></code> <code><link linkend="function-prep-class-2-doc-pass-3">tan:prep-class-2-doc-pass-3</link></code> .</para></section>
<section xml:id="function-product"><title><code>tan:product()</code></title><para><code>tan:product($numbers as item()*) as xs:double?</code></para><para> Input: a sequence of numbers </para><para> Output: the product of those numbers </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-product-loop">tan:product-loop</link></code> .</para></section>
<section xml:id="function-product-loop"><title><code>tan:product-loop()</code></title><para><code>tan:product-loop($product-so-far as xs:double?, $numbers-to-multiply as item()*) as xs:double?</code></para><para>Used by function <code><link linkend="function-product">tan:product</link></code>() <code><link linkend="function-product-loop">tan:product-loop</link></code>()</para><para>Relies upon <code><link linkend="function-product-loop">tan:product-loop</link></code> .</para></section>
<section xml:id="function-recombine-docs"><title><code>tan:recombine-docs()</code></title><para><code>tan:recombine-docs($docs-to-recombine as document-node()*, $ref-sort-key-docs as document-node()*) as document-node()*</code></para><para> Input: any number of documents</para><para>      Output: recombined documents</para><para>      This function is useful for cases where you have both picked and culled</para><para>      from a source, and you wish to combine the two documents into a single one</para><para>      that strips away duplicates. NB, the results may not preserve the original </para><para>      document order of an original document. It also treats non-leaf white-</para><para>      space text nodes as dispensible.</para><para>      </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-element-key">tan:element-key</link></code> <code><link linkend="template-merge-nodes">Ŧ merge-nodes</link></code> .</para></section>
<section xml:id="function-shallow-equal"><title><code>tan:shallow-equal()</code></title><para><code>tan:shallow-equal($element-1 as element()?, $element-2 as element()?) as xs:boolean</code></para><para> Input: any two elements. Output: true if shallowly equal.</para><para>         Two elements are shallowly equal if (1) they both have the same name; (2) the name of every </para><para>         attribute in one is the name of an attribute in the other; and (3) for every pair of attributes,</para><para>         every space-separated value in one is found in the other. Any descendants are ignored.</para><para>         Example: </para><para>         Input:</para><para>            &lt;div class="gum mug droop"&gt;Testing&lt;/div&gt;</para><para>            &lt;div class="droop mug gum droop"&gt;Different text&lt;/div&gt;</para><para>         Output: true</para><para>      </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-strip-duplicate-nodes"><title><code>tan:strip-duplicate-nodes()</code></title><para><code>tan:strip-duplicate-nodes($nodes-to-check as node()*, $checked-nodes as node()*) as node()*</code></para><para>Used by template <code><link linkend="template-merge-nodes">Ŧ merge-nodes</link></code></para><para>Used by function <code><link linkend="function-strip-duplicate-nodes">tan:strip-duplicate-nodes</link></code>()</para><para>Relies upon <code><link linkend="function-strip-duplicate-nodes">tan:strip-duplicate-nodes</link></code> .</para></section>
<section xml:id="function-tokenize-div"><title><code>tan:tokenize-div()</code></title><para><code>tan:tokenize-div($divs as element()*, $token-definitions as element()) as element()*</code></para><para> Input: any <code><link linkend="element-div">&lt;div&gt;</link></code>s, a <code><link linkend="element-token-definition">&lt;token-definition&gt;</link></code> </para><para> Output: the <code>&lt;divs&gt;</code>s in tokenized form </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-tokenize-prepped-class-1">ŧ tokenize-prepped-class-1</link></code> .</para></section>
<section xml:id="function-unconsolidate-tan-lm"><title><code>tan:unconsolidate-tan-lm()</code></title><para><code>tan:unconsolidate-tan-lm($tan-lm-docs as document-node()*, $srcs-tokenized as document-node()*) as document-node()*</code></para><para> Reformats TAN-LM files, such that each <code><link linkend="element-ana">&lt;ana&gt;</link></code> has one and only</para><para>      one <code><link linkend="element-tok">&lt;tok&gt;</link></code> + <code><link linkend="element-l">&lt;l&gt;</link></code> + <code><link linkend="element-m">&lt;m&gt;</link></code> combination </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-unconsolidate-anas">ŧ unconsolidate-anas</link></code> .</para></section>
</section>
<section><title>templates</title><section xml:id="template-merge-nodes"><title><code>Ŧ merge-nodes</code></title><para>Used by template <code><link linkend="template-merge-nodes">Ŧ merge-nodes</link></code></para><para>Used by function <code><link linkend="function-recombine-docs">tan:recombine-docs</link></code>()</para><para>Relies upon <code><link linkend="function-strip-duplicate-nodes">tan:strip-duplicate-nodes</link></code> <code><link linkend="function-element-key">tan:element-key</link></code> <code><link linkend="template-merge-nodes">Ŧ merge-nodes</link></code> .</para></section>
</section>
</section>
<section><title>TAN-A-div global variables, keys, and functions summarized</title><section><title>variables</title><section xml:id="variable-self-and-sources-prepped-prelim"><title><code>$self-and-sources-prepped-prelim</code></title><para>Definition: <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link>(<link linkend="variable-self-core-errors-marked">$self-core-errors-marked</link>)</code></para><para>Used by variable <code><link linkend="variable-self-and-sources-prepped">$self-and-sources-prepped</link></code></para><para>Used by function <code><link linkend="function-prep-resolved-tan-a-div-doc">tan:prep-resolved-tan-a-div-doc</link></code>()</para><para>Relies upon <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code> <code><link linkend="variable-self-core-errors-marked">$self-core-errors-marked</link></code> .</para></section>
</section>
<section><title>functions</title><section xml:id="function-get-src-1st-da-segmented"><title><code>tan:get-src-1st-da-segmented()</code></title><para><code>tan:get-src-1st-da-segmented($self-expanded-3 as document-node()?, $src-1st-da-tokenized as document-node()*) as document-node()*</code></para><para> Input: Any sources for a TAN-A-div, preliminarily prepped (via class 2 operation) </para><para> Output: the same sources, selectively segmented </para><para> Segmentation here means inserting into only those leaf <code><link linkend="element-div">&lt;div&gt;</link></code>s that have been split a new &lt;div type="#seg" ref="[ANCESTRAL <code>@REF</code> + ' #' + SEGMENT NUMBER]"&gt; </para><para>Used by function <code><link linkend="function-prep-resolved-tan-a-div-doc">tan:prep-resolved-tan-a-div-doc</link></code>()</para><para>Relies upon <code><link linkend="template-segment-tokd-prepped-class-1">ŧ segment-tokd-prepped-class-1</link></code> .</para></section>
<section xml:id="function-get-src-1st-da-statted"><title><code>tan:get-src-1st-da-statted()</code></title><para><code>tan:get-src-1st-da-statted($src-1st-da-tokenized as document-node()*) as document-node()*</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-count-tokenized-class-1">ŧ count-tokenized-class-1</link></code> .</para></section>
<section xml:id="function-merge-tan-a-div-prepped"><title><code>tan:merge-tan-a-div-prepped()</code></title><para><emphasis>Option 1 (TAN-A-div-functions)</emphasis></para><para><code>tan:merge-tan-a-div-prepped($tan-a-div-prepped as document-node()?, $tan-a-div-sources-prepped as document-node()*, $prioritize-source-order-over-conciseness as xs:boolean?) as document-node()*</code></para><para> shortened version of the fuller function, below </para><para>Used by function <code><link linkend="function-merge-tan-a-div-prepped">tan:merge-tan-a-div-prepped</link></code>()</para><para>Relies upon <code><link linkend="function-merge-tan-a-div-prepped">tan:merge-tan-a-div-prepped</link></code> .</para><para><emphasis>Option 2 (TAN-A-div-functions)</emphasis></para><para><code>tan:merge-tan-a-div-prepped($tan-a-div-prepped as document-node()?, $tan-a-div-sources-prepped as document-node()*, $prioritize-source-order-over-conciseness as xs:boolean?, $work-filter as xs:string?) as document-node()*</code></para><para> Input: TAN-A-div prepped; its sources, prepped; a boolean indicating whether source order should be prioritized; an optional filter to pick only certain works </para><para> Output: the TAN-A-div file, with the following changes: (a) one <code><link linkend="element-work">&lt;work&gt;</link></code> per work chosen is placed after <code><link linkend="element-body">&lt;body&gt;</link></code>; (b) each <code><link linkend="element-work">&lt;work&gt;</link></code> contains a merger of the <code><link linkend="element-div">&lt;div&gt;</link></code>s of all sources that contain that work; (c) <code><link linkend="attribute-ref">@ref</link></code> in <code><link linkend="element-div">&lt;div&gt;</link></code>s in unanchored realignments are moved to <code>@pre-realign-ref</code> and <code><link linkend="attribute-ref">@ref</link></code> takes the <code><link linkend="attribute-id">@id</link></code> value of the realignment; (d) <code><link linkend="attribute-ref">@ref</link></code> in <code><link linkend="element-div">&lt;div&gt;</link></code>s in anchored realignments are moved to <code>@pre-realign-ref</code> and <code><link linkend="attribute-ref">@ref</link></code> takes the <code><link linkend="attribute-ref">@ref</link></code> of the anchor </para><para> See <code><link linkend="function-merge-source-loop">tan:merge-source-loop</link></code>() for more documentation </para><para>Used by function <code><link linkend="function-merge-tan-a-div-prepped">tan:merge-tan-a-div-prepped</link></code>()</para><para>Relies upon <code><link linkend="function-prep-tan-a-div-sources-for-merge">tan:prep-tan-a-div-sources-for-merge</link></code> <code><link linkend="function-merge-source-loop">tan:merge-source-loop</link></code> <code><link linkend="function-copy-of-except">tan:copy-of-except</link></code> <code><link linkend="template-tan-a-div-merge-pass1">ŧ tan-a-div-merge-pass1</link></code> .</para></section>
<section xml:id="function-prep-resolved-tan-a-div-doc"><title><code>tan:prep-resolved-tan-a-div-doc()</code></title><para><code>tan:prep-resolved-tan-a-div-doc($self-and-sources-prepped-class-2 as document-node()*) as document-node()*</code></para><para> Input: a TAN-A-div document and its sources, as prepared by <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>() </para><para> Output: the same documents, prepared with TAN-A-div specific considerations </para><para/><para>      FOCUS           ALTERATIONS</para><para>      =======   =============================================================================================</para><para>      sources   Segment sources</para><para>      self      Expand <code><link linkend="element-div-ref">&lt;div-ref&gt;</link></code> and <code><link linkend="element-anchor-div-ref">&lt;anchor-div-ref&gt;</link></code> on <code><link linkend="attribute-seg">@seg</link></code>, making in <code><link linkend="element-realign">&lt;realign&gt;</link></code> a deep copy of the <code><link linkend="element-div">&lt;div&gt;</link></code>s and <code>&lt;seg&gt;</code>s referred to</para><para>      self      Distribute <code><link linkend="element-align">&lt;align&gt;</link></code> and <code><link linkend="element-realign">&lt;realign&gt;</link></code>; signal errors of realignment</para><para>      self      Mark errors</para><para>      </para><para> Note, because this function is designed to expedite validation, it does not realign the sources, which must be done through <code><link linkend="function-merge-tan-a-div-prepped">tan:merge-tan-a-div-prepped</link></code>() </para><para>Used by variable <code><link linkend="variable-self-and-sources-prepped">$self-and-sources-prepped</link></code></para><para>Relies upon <code><link linkend="variable-self-and-sources-prepped-prelim">$self-and-sources-prepped-prelim</link></code> <code><link linkend="function-prep-TAN-claims">tan:prep-TAN-claims</link></code> <code><link linkend="template-TAN-A-div-errors">ŧ TAN-A-div-errors</link></code> <code><link linkend="template-prep-tan-a-div-pass-b">ŧ prep-tan-a-div-pass-b</link></code> <code><link linkend="template-prep-tan-a-div-pass-a">ŧ prep-tan-a-div-pass-a</link></code> <code><link linkend="function-get-src-1st-da-segmented">tan:get-src-1st-da-segmented</link></code> .</para></section>
<section xml:id="function-prep-tan-a-div-sources-for-merge"><title><code>tan:prep-tan-a-div-sources-for-merge()</code></title><para><code>tan:prep-tan-a-div-sources-for-merge($tan-a-div-prepped as document-node()?, $src-1st-da-prepped-or-segmented as document-node()*) as document-node()*</code></para><para> Input: A TAN-A-div file that has reached at least level four of preparation (<code><link linkend="element-realign">&lt;realign&gt;</link></code> has <code><link linkend="attribute-id">@id</link></code>); the sources of that TAN-A-div file, prepared </para><para> Output: The sources, realigned. </para><para> The function traverses each source, div by div via a template. If in a given source (<code>$this-src</code>) in a given div (<code>$this-div</code>) the ref (<code>$this-ref</code>) is found in the TAN-A-div's <code><link linkend="element-realign">&lt;realign&gt;</link></code> (in realign/div-ref/div/<code><link linkend="attribute-ref">@ref</link></code>), then if the realignment is anchored then the anchor's <code><link linkend="attribute-ref">@ref</link></code> is adopted. In an unanchored realignment, the id of the <code><link linkend="element-realign">&lt;realign&gt;</link></code>, e.g., #realign1-1, is adopted. Whether a simple or complex realignment, <code>@pre-realign-ref</code> is added with the old <code><link linkend="attribute-ref">@ref</link></code>, and <code><link linkend="attribute-src">@src</link></code> is added (to anticipate merges between sources). Whether simple or complex, a realigned <code><link linkend="element-div">&lt;div&gt;</link></code> passes on its new <code><link linkend="attribute-ref">@ref</link></code> value to its children, whose <code><link linkend="attribute-ref">@ref</link></code> values are revised accordingly. </para><para>Used by function <code><link linkend="function-merge-tan-a-div-prepped">tan:merge-tan-a-div-prepped</link></code>()</para><para>Relies upon <code><link linkend="template-prepare-class-1-doc-for-merge">ŧ prepare-class-1-doc-for-merge</link></code> .</para></section>
<section xml:id="function-prep-verbosely"><title><code>tan:prep-verbosely()</code></title><para><code>tan:prep-verbosely($TAN-A-div-prepped as document-node()?, $TAN-A-div-sources-prepped as document-node()*) as document-node()*</code></para><para> Input: a TAN-A-div file prepped and its sources, also prepped </para><para>   Output: the same files, with information marked of relevance to the validation process. </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-get-src-skeleton">tan:get-src-skeleton</link></code> <code><link linkend="template-prep-verbosely">ŧ prep-verbosely</link></code> .</para></section>
<section xml:id="function-process-splits"><title><code>tan:process-splits()</code></title><para><code>tan:process-splits($elements-to-process) as element()*</code></para><para> Input: any document fragment with &lt;split/&gt; inserted in leaf elements representing where there should be a deep, top-level split </para><para> Output: A sequence of <code>&lt;fragment&gt;</code>s (the number of &lt;split/&gt;s plus one containing a deep copy of the fragment chosen </para><para>Used by function <code><link linkend="function-remodel-div-ref">tan:remodel-div-ref</link></code>() <code><link linkend="function-process-splits">tan:process-splits</link></code>()</para><para>Relies upon <code><link linkend="function-process-splits">tan:process-splits</link></code> <code><link linkend="template-process-splits">ŧ process-splits</link></code> .</para></section>
<section xml:id="function-remodel-div-ref"><title><code>tan:remodel-div-ref()</code></title><para><code>tan:remodel-div-ref($div-ref-to-remodel as element(tan:div-ref)?, $model-div-ref as element()?, $allocate-deeply as xs:boolean?) as element()?</code></para><para> Input: (1) a <code><link linkend="element-div-ref">&lt;div-ref&gt;</link></code> containing one or more <code><link linkend="element-div">&lt;div&gt;</link></code>s of unknown complexity, to be fused into (2) another <code><link linkend="element-div-ref">&lt;div-ref&gt;</link></code> or <code><link linkend="element-anchor-div-ref">&lt;anchor-div-ref&gt;</link></code> containing a <code><link linkend="element-div">&lt;div&gt;</link></code>structure to be treated as a structural model of the first; a boolean indicating whether allocation should be shallow (top-level <code><link linkend="element-div">&lt;div&gt;</link></code> only) or deep </para><para> Output: the deep or shallow element structure of (2), but with the text of each leaf div being replaced by the proportionally appropriate leaf divs (fragmentary or whole) of (1); in that structure, all copies of (2)'s attributes are retained, except for <code><link linkend="attribute-src">@src</link></code>, which is replaced by the value of <code><link linkend="attribute-src">@src</link></code> in (1) </para><para> This function is written for proportional realignments </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-analyze-string-length">tan:analyze-string-length</link></code> <code><link linkend="function-process-splits">tan:process-splits</link></code> <code><link linkend="variable-tokenization-nonspace">$tokenization-nonspace</link></code> <code><link linkend="template-infuse-tokenized-div">ŧ infuse-tokenized-div</link></code> <code><link linkend="template-mark-splits-in-fragment">ŧ mark-splits-in-fragment</link></code> <code><link linkend="template-tokenize-prepped-class-1">ŧ tokenize-prepped-class-1</link></code> .</para></section>
</section>
</section>
<section><title>TAN-A-tok global variables, keys, and functions summarized</title><section><title>functions</title><section xml:id="function-analyze-tok-chars"><title><code>tan:analyze-tok-chars()</code></title><para><code>tan:analyze-tok-chars($src-tok-element as element()?, $self-expanded-4-tok-element as element()?) as element()?</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-char-setup">ŧ char-setup</link></code> .</para></section>
<section xml:id="function-get-src-1st-da-analysis-stamped"><title><code>tan:get-src-1st-da-analysis-stamped()</code></title><para><code>tan:get-src-1st-da-analysis-stamped($self-expanded-4 as document-node()?, $tokenized-and-charred-class-1-doc as document-node()*) as document-node()*</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-analysis-stamp">ŧ analysis-stamp</link></code> .</para></section>
<section xml:id="function-get-src-1st-da-chars-picked"><title><code>tan:get-src-1st-da-chars-picked()</code></title><para><code>tan:get-src-1st-da-chars-picked($self-expanded-4 as document-node()?, $tokenized-class-1-doc as document-node()*) as document-node()*</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-char-setup">ŧ char-setup</link></code> .</para></section>
</section>
</section>
<section><title>TAN-LM global variables, keys, and functions summarized</title><section><title>variables</title><section xml:id="variable-features-grouped"><title><code>$features-grouped</code></title><para>Definition: <code><link linkend="function-group-by-IRIs">tan:group-by-IRIs</link>(<link linkend="variable-features-prepped">$features-prepped</link>)</code></para><para>No variables, keys, functions, or named templates depend upon this xsl:variable.</para><para>Relies upon <code><link linkend="function-group-by-IRIs">tan:group-by-IRIs</link></code> <code><link linkend="variable-features-prepped">$features-prepped</link></code> .</para></section>
<section xml:id="variable-features-prepped"><title><code>$features-prepped</code></title><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>Used by variable <code><link linkend="variable-features-grouped">$features-grouped</link></code></para><para>Relies upon <code><link linkend="variable-morphologies-prepped">$morphologies-prepped</link></code> .</para></section>
<section xml:id="variable-l-grouping-key-key"><title><code>$l-grouping-key-key</code></title><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>Used by function <code><link linkend="function-ana-grouping-key">tan:ana-grouping-key</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-m-grouping-key-key"><title><code>$m-grouping-key-key</code></title><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>Used by function <code><link linkend="function-ana-grouping-key">tan:ana-grouping-key</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-morphologies-prepped"><title><code>$morphologies-prepped</code></title><para>Definition: <code><link linkend="function-prep-TAN-mor">tan:prep-TAN-mor</link>(<link linkend="function-resolve-doc">tan:resolve-doc</link>(<link linkend="function-get-1st-doc">tan:get-1st-doc</link>(<link linkend="variable-head">$head</link>/tan:declarations/tan:morphology), false(), 'morphology', <link linkend="variable-head">$head</link>/tan:declarations/tan:morphology/<link linkend="attribute-xmlid">@xml:id</link>, (), ()))</code></para><para>Used by variable <code><link linkend="variable-features-prepped">$features-prepped</link></code></para><para>Used by template <code><link linkend="template-prep-tan-lm">ŧ prep-tan-lm</link></code> <code><link linkend="template-convert-code-to-features">ŧ convert-code-to-features</link></code></para><para>Used by function <code><link linkend="function-expand-m">tan:expand-m</link></code>()</para><para>Relies upon <code><link linkend="function-prep-TAN-mor">tan:prep-TAN-mor</link></code> <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code> <code><link linkend="variable-head">$head</link></code> .</para></section>
<section xml:id="variable-sep-1"><title><code>$sep-1</code></title><para>Definition: <code>'%'</code></para><para>Used by function <code><link linkend="function-rebuild-ana-fragment">tan:rebuild-ana-fragment</link></code>() <code><link linkend="function-ana-grouping-key">tan:ana-grouping-key</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-sep-2"><title><code>$sep-2</code></title><para>Definition: <code>'#'</code></para><para>Used by function <code><link linkend="function-rebuild-ana-fragment">tan:rebuild-ana-fragment</link></code>() <code><link linkend="function-ana-grouping-key">tan:ana-grouping-key</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-tok-grouping-key-key"><title><code>$tok-grouping-key-key</code></title><para>This variable has a complex definition. See
                                                stylesheet for definiton.</para><para>Used by function <code><link linkend="function-ana-grouping-key">tan:ana-grouping-key</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-add-tok-val"><title><code>tan:add-tok-val()</code></title><para><code>tan:add-tok-val($tan-lm-resolved as document-node()*, $src-tokenized as document-node()*) as document-node()*</code></para><para> take a fully expanded TAN-LM file (<code>$self4</code>) and to each <code><link linkend="element-tok">&lt;tok&gt;</link></code> add the value of </para><para>        the token chosen, as <code><link linkend="attribute-val">@val</link></code>, and replacing any pre-existing <code><link linkend="attribute-val">@val</link></code> with <code>@val-orig</code> </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-add-tok-val">ŧ add-tok-val</link></code> .</para></section>
<section xml:id="function-all-morph-codes"><title><code>tan:all-morph-codes()</code></title><para><code>tan:all-morph-codes($morph as item()*, $codes as xs:string*) as xs:string*</code></para><para> Change any sequence of morphological codes into a sequence of synonymous morphological codes</para><para>            Input: <code>node(</code>) picking a TAN-R-mor file, a sequence of strings, each item being the value of</para><para>            tan:option/<code><link linkend="attribute-code">@code</link></code> or tan:feature/<code><link linkend="attribute-xmlid">@xml:id</link></code></para><para>         Output: sequence of strings returning all equivalent lowercased values of each tan:option/<code><link linkend="attribute-code">@code</link></code> or tan:feature/<code><link linkend="attribute-xmlid">@xml:id</link></code> </para><para>         E.g., ('NN','comma','.') - &gt; ('nn','comma',',','.','period')</para><para>      </para><para>Used by function <code><link linkend="function-feature-test-check">tan:feature-test-check</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-ana-grouping-key"><title><code>tan:ana-grouping-key()</code></title><para><code>tan:ana-grouping-key($tok-lm-l-or-m-element as element()*) as xs:string*</code></para><para> Input: zero or more <code><link linkend="element-tok">&lt;tok&gt;</link></code>, <code><link linkend="element-lm">&lt;lm&gt;</link></code>, <code><link linkend="element-l">&lt;l&gt;</link></code>, or <code><link linkend="element-m">&lt;m&gt;</link></code>s</para><para>        Output: an equal number of strings that concatenate the properties of that element</para><para>        Especially made to be used in the <code>@group-by</code> value of &lt;xsl:for-each-group /&gt; statements.</para><para>        See also <code><link linkend="function-rebuild-ana-fragment">tan:rebuild-ana-fragment</link></code>(), which can reconstruct the <code><link linkend="element-ana">&lt;ana&gt;</link></code> fragment.</para><para>        </para><para>Used by function <code><link linkend="function-ana-grouping-key">tan:ana-grouping-key</link></code>()</para><para>Relies upon <code><link linkend="variable-sep-1">$sep-1</link></code> <code><link linkend="variable-sep-2">$sep-2</link></code> <code><link linkend="variable-tok-grouping-key-key">$tok-grouping-key-key</link></code> <code><link linkend="function-ana-grouping-key">tan:ana-grouping-key</link></code> <code><link linkend="variable-l-grouping-key-key">$l-grouping-key-key</link></code> <code><link linkend="variable-m-grouping-key-key">$m-grouping-key-key</link></code> .</para></section>
<section xml:id="function-convert-code-to-features"><title><code>tan:convert-code-to-features()</code></title><para><code>tan:convert-code-to-features($tan-lm-resolved as document-node()*) as document-node()*</code></para><para> adds to every <code><link linkend="element-m">&lt;m&gt;</link></code> a &lt;feature <code><link linkend="attribute-xmlid">@xml:id</link></code>&gt; for every part of the code </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-convert-code-to-features">ŧ convert-code-to-features</link></code> .</para></section>
<section xml:id="function-expand-m"><title><code>tan:expand-m()</code></title><para><code>tan:expand-m($m as element()*, $add-counts as xs:boolean) as element()*</code></para><para> Expands an <code><link linkend="element-m">&lt;m&gt;</link></code>. </para><para>        Input: (1) one or more <code><link linkend="element-m">&lt;m&gt;</link></code>s, (2) true/false indicating whether features should be counted </para><para>        Output: that <code><link linkend="element-m">&lt;m&gt;</link></code>, and for every code, the corresponding <code><link linkend="element-feature">&lt;feature&gt;</link></code> is inserted </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="variable-morphologies-prepped">$morphologies-prepped</link></code> .</para></section>
<section xml:id="function-expand-per-lm"><title><code>tan:expand-per-lm()</code></title><para><code>tan:expand-per-lm($tan-lm-resolved as document-node()*) as document-node()*</code></para><para> Takes a TAN-LM and consolidates it, creating one <code><link linkend="element-ana">&lt;ana&gt;</link></code> per individual <code><link linkend="element-l">&lt;l&gt;</link></code> + <code><link linkend="element-m">&lt;m&gt;</link></code> pair,</para><para>        then putting in it any <code><link linkend="element-tok">&lt;tok&gt;</link></code> that shares that data </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="template-expand-lm">ŧ expand-lm</link></code> .</para></section>
<section xml:id="function-feature-test-check"><title><code>tan:feature-test-check()</code></title><para><code>tan:feature-test-check($code as xs:string, $feature-expr as xs:string, $morph as item()*) as xs:boolean</code></para><para>  Checks to see if a logical expression of morphological codes (+ synonyms) is found in a given value of <code><link linkend="element-m">&lt;m&gt;</link></code></para><para>            Input: two strings, the first a morphological code to be checked to see if it matches the second, a logical</para><para>            expression of features; a third parameter, a <code>node(</code>), defines the morphology rule to be used (to reconcile</para><para>            synonyms in codes)</para><para>            Output: <code>true(</code>) if a match is found, <code>false(</code>) otherwise</para><para>            E.g., 'nn 1 m', '(NN | m), 2' - &gt; <code>false(</code>)</para><para>            E.g., 'nn 1 m', '(NN | m), 1' - &gt; <code>true(</code>)</para><para>      </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-escape">tan:escape</link></code> <code><link linkend="function-all-morph-codes">tan:all-morph-codes</link></code> .</para></section>
<section xml:id="function-get-lm-ids"><title><code>tan:get-lm-ids()</code></title><para><code>tan:get-lm-ids($ana-elements as element()+) as xs:string*</code></para><para> Input: any number of <code><link linkend="element-ana">&lt;ana&gt;</link></code></para><para>            Output: one string per combination of <code><link linkend="element-l">&lt;l&gt;</link></code> + <code><link linkend="element-m">&lt;m&gt;</link></code>, calculated by joining (1) the <code><link linkend="element-l">&lt;l&gt;</link></code> value,</para><para>            (2)the <code><link linkend="element-m">&lt;m&gt;</link></code> code, and (3) attribute values of <code><link linkend="element-lm">&lt;lm&gt;</link></code>, <code><link linkend="element-l">&lt;l&gt;</link></code>, and <code><link linkend="element-m">&lt;m&gt;</link></code></para><para>        </para><para>Used by template <code><link linkend="template-expand-lm">ŧ expand-lm</link></code></para><para>Relies upon <code><link linkend="variable-empty-doc">$empty-doc</link></code> .</para></section>
<section xml:id="function-get-matching-lm-combos"><title><code>tan:get-matching-lm-combos()</code></title><para><code>tan:get-matching-lm-combos($l-element as element(), $m-element as element()) as element()*</code></para><para> Input: one <code><link linkend="element-l">&lt;l&gt;</link></code> and one <code><link linkend="element-m">&lt;m&gt;</link></code></para><para>            Output: all matching combinations. If an <code><link linkend="element-lm">&lt;lm&gt;</link></code> has only one <code><link linkend="element-l">&lt;l&gt;</link></code> and <code><link linkend="element-m">&lt;m&gt;</link></code> (and both match)</para><para>            then the entire <code><link linkend="element-lm">&lt;lm&gt;</link></code> is picked. If there's only one <code><link linkend="element-l">&lt;l&gt;</link></code> and many <code><link linkend="element-m">&lt;m&gt;</link></code>s then only the <code><link linkend="element-m">&lt;m&gt;</link></code> is picked;</para><para>            and vice versa. If there are many <code><link linkend="element-m">&lt;m&gt;</link></code>s and <code><link linkend="element-l">&lt;l&gt;</link></code>s then nothing is picked, since any alterations</para><para>            to any <code><link linkend="element-l">&lt;l&gt;</link></code> or <code><link linkend="element-m">&lt;m&gt;</link></code> in that case would affect other <code><link linkend="element-l">&lt;l&gt;</link></code> + <code><link linkend="element-m">&lt;m&gt;</link></code> combos that have not been picked.</para><para>            This function is useful for global deletions of a particular lexeme + </para><para>            morphological code pair.</para><para>        </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-get-matching-ls-or-ms"><title><code>tan:get-matching-ls-or-ms()</code></title><para><code>tan:get-matching-ls-or-ms($l-or-m-element as element()) as element()*</code></para><para> Input: one <code><link linkend="element-l">&lt;l&gt;</link></code> or one <code><link linkend="element-m">&lt;m&gt;</link></code></para><para>            Output: all matching combinations. If an <code><link linkend="element-lm">&lt;lm&gt;</link></code> has only one <code><link linkend="element-l">&lt;l&gt;</link></code>/<code><link linkend="element-m">&lt;m&gt;</link></code></para><para>            then the entire <code><link linkend="element-lm">&lt;lm&gt;</link></code> is picked. Otherwise, it picks only the <code><link linkend="element-l">&lt;l&gt;</link></code>/<code><link linkend="element-m">&lt;m&gt;</link></code></para><para>            that matches.</para><para>            This function is useful for global deletions of a particular lexeme or </para><para>            morphological code</para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-obeyed-by-m"><title><code>tan:obeyed-by-m()</code></title><para><code>tan:obeyed-by-m($assert-or-report-prepped as element(), $m-element-prepped as element()?) as xs:boolean?</code></para><para> Input: any TAN-LM <code><link linkend="element-m">&lt;m&gt;</link></code> that has been prepped (i.e., has <code>@orig-code</code> and has children <code>&lt;f&gt;</code>);</para><para>         any TAN-mor <code><link linkend="element-report">&lt;report&gt;</link></code> or <code><link linkend="element-assert">&lt;assert&gt;</link></code> </para><para>      Output: a boolean value indicating whether all the conditions made by the assert (or report) are true (false).</para><para>      Function assumes that all features have been space-normalized and rendered lowercase.</para><para>      This function is used primarily to pick out <code><link linkend="element-assert">&lt;assert&gt;</link></code>s and <code><link linkend="element-report">&lt;report&gt;</link></code>s that an <code><link linkend="element-m">&lt;m&gt;</link></code> violates </para><para>Used by template <code><link linkend="template-prep-tan-lm">ŧ prep-tan-lm</link></code></para><para>Relies upon <code><link linkend="function-feature-test-to-groups">tan:feature-test-to-groups</link></code> <code><link linkend="function-matches">tan:matches</link></code> .</para></section>
<section xml:id="function-prep-TAN-LM-doc-prepped"><title><code>tan:prep-TAN-LM-doc-prepped()</code></title><para><code>tan:prep-TAN-LM-doc-prepped($self-and-sources-class-2-prepped as document-node()*) as document-node()*</code></para><para>Used by variable <code><link linkend="variable-self-and-sources-prepped">$self-and-sources-prepped</link></code></para><para>Relies upon <code><link linkend="template-prep-tan-lm">ŧ prep-tan-lm</link></code> .</para></section>
<section xml:id="function-rebuild-ana-fragment"><title><code>tan:rebuild-ana-fragment()</code></title><para><code>tan:rebuild-ana-fragment($tok-l-or-m-grouping-key as xs:string*) as element()*</code></para><para> Takes any set of strings that are the result of tan:[tok/l/m]-<code>grouping-key(</code>)</para><para>            and for each one returns a rebuilt fragment of the original <code><link linkend="element-ana">&lt;ana&gt;</link></code> upon which </para><para>            it is based. Useful for reconstructing fragments of documents after &lt;xsl:for-each-group/&gt;</para><para>            operations.</para><para>        </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="variable-sep-2">$sep-2</link></code> <code><link linkend="variable-sep-1">$sep-1</link></code> .</para></section>
</section>
</section>
<section><title>TAN-class-2-errors global variables, keys, and functions summarized</title><section><title>functions</title><section xml:id="function-group-tok-elements"><title><code>tan:group-tok-elements()</code></title><para><code>tan:group-tok-elements($prepped-tok-elements as element()*) as element()</code></para><para>Used by template <code><link linkend="template-TAN-A-div-errors">ŧ TAN-A-div-errors</link></code> <code><link linkend="template-class-2-errors">ŧ class-2-errors</link></code></para><para>Relies upon <code><link linkend="function-sequence-expand">tan:sequence-expand</link></code> .</para></section>
</section>
</section>
<section><title>TAN-class-1-and-2 global variables, keys, and functions summarized</title><section><title>variables</title><section xml:id="variable-char-reg-exp"><title><code>$char-reg-exp</code></title><para>Definition: <code>'\P{M}\p{M}*'</code></para><para>Used by function <code><link linkend="function-chop-string">tan:chop-string</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-soft-hyphen"><title><code>$soft-hyphen</code></title><para>Definition: <code>'­'</code></para><para>Used by variable <code><link linkend="variable-special-end-div-chars">$special-end-div-chars</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-special-end-div-chars"><title><code>$special-end-div-chars</code></title><para>Definition: <code>(<link linkend="variable-zwj">$zwj</link>, <link linkend="variable-soft-hyphen">$soft-hyphen</link>)</code></para><para>Used by variable <code><link linkend="variable-special-end-div-chars-regex">$special-end-div-chars-regex</link></code></para><para>Used by function <code><link linkend="function-normalize-div-text">tan:normalize-div-text</link></code>()</para><para>Relies upon <code><link linkend="variable-zwj">$zwj</link></code> <code><link linkend="variable-soft-hyphen">$soft-hyphen</link></code> .</para></section>
<section xml:id="variable-special-end-div-chars-regex"><title><code>$special-end-div-chars-regex</code></title><para>Definition: <code>concat('[', string-join(<link linkend="variable-special-end-div-chars">$special-end-div-chars</link>, ''), ']$')</code></para><para>Used by function <code><link linkend="function-normalize-div-text">tan:normalize-div-text</link></code>()</para><para>Relies upon <code><link linkend="variable-special-end-div-chars">$special-end-div-chars</link></code> .</para></section>
<section xml:id="variable-tokenization-nonspace"><title><code>$tokenization-nonspace</code></title><para>Definition: <code><link linkend="variable-token-definitions-reserved">$token-definitions-reserved</link>[following-sibling::tan:name = 'nonspace']</code></para><para>Used by function <code><link linkend="function-remodel-div-ref">tan:remodel-div-ref</link></code>()</para><para>Relies upon <code><link linkend="variable-token-definitions-reserved">$token-definitions-reserved</link></code> .</para></section>
<section xml:id="variable-zwj"><title><code>$zwj</code></title><para>Definition: <code>'‍'</code></para><para>Used by variable <code><link linkend="variable-special-end-div-chars">$special-end-div-chars</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
</section>
<section><title>functions</title><section xml:id="function-analyze-stats"><title><code>tan:analyze-stats()</code></title><para><code>tan:analyze-stats($arg as xs:anyAtomicType*) as element()?</code></para><para> Takes a series of integers, doubles, or other numbers and returns basic statistics</para><para>      as attributes in a single element </para><para>Used by function <code><link linkend="function-merge-analyzed-stats">tan:merge-analyzed-stats</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-analyze-string-length"><title><code>tan:analyze-string-length()</code></title><para><emphasis>Option 1 (TAN-class-1-and-2-functions)</emphasis></para><para><code>tan:analyze-string-length($resolved-class-1-doc-or-fragment as item()*) as item()*</code></para><para> One-parameter function of the two-parameter version below </para><para>Used by variable <code><link linkend="variable-self-class-1-errors-marked">$self-class-1-errors-marked</link></code></para><para>Used by function <code><link linkend="function-remodel-div-ref">tan:remodel-div-ref</link></code>() <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-and-2-functions)</emphasis></para><para><code>tan:analyze-string-length($resolved-class-1-doc-or-fragment as item()*, $mark-only-leaf-divs as xs:boolean) as item()*</code></para><para> Input: any class-1 document or fragment; an indication whether string lengths should be added only to leaf divs, or to every div. </para><para> Output: the same document, with <code>@string-length</code> and <code>@string-pos</code> added to every div </para><para> Function to calculate string lengths of each leaf elements and their relative position, so that a raw text can be segmented proportionally and given the structure of a model exemplar. NB: any <code><link linkend="variable-special-end-div-chars">$special-end-div-chars</link></code> that terminate a <code><link linkend="element-div">&lt;div&gt;</link></code> not only will not be counted, but the</para><para>         assumed space that follows will also not be counted. On the other hand, the lack of a special</para><para>         character at the end means that the nominal space that follows a div will be included in both</para><para>         the length and the position. Thus input...</para><para>         &lt;div type="m" n="1"&gt;abc&amp;#xad;&lt;/div&gt;</para><para>         &lt;div type="m" n="2"&gt;def&amp;#x200d;&lt;/div&gt;</para><para>         &lt;div type="m" n="3"&gt;ghi&lt;/div&gt;</para><para>         &lt;div type="m" n="4"&gt;xyz&lt;/div&gt;</para><para>         ...presumes a raw joined text of "abcdefghi xyz ", and so becomes output:</para><para>         &lt;div type="m" n="1" string-length="3" string-pos="1"&gt;abc&amp;#xad;&lt;/div&gt;</para><para>         &lt;div type="m" n="2" string-length="3" string-pos="4"&gt;def&amp;#x200d;&lt;/div&gt;</para><para>         &lt;div type="m" n="3" string-length="4" string-pos="7"&gt;ghi&lt;/div&gt;</para><para>         &lt;div type="m" n="4" string-length="4" string-pos="11"&gt;xyz&lt;/div&gt; </para><para>Used by variable <code><link linkend="variable-self-class-1-errors-marked">$self-class-1-errors-marked</link></code></para><para>Used by function <code><link linkend="function-remodel-div-ref">tan:remodel-div-ref</link></code>() <code><link linkend="function-analyze-string-length">tan:analyze-string-length</link></code>()</para><para>Relies upon <code><link linkend="template-c1-stamp-string-length">ŧ c1-stamp-string-length</link></code> <code><link linkend="template-c1-stamp-string-pos">ŧ c1-stamp-string-pos</link></code> .</para></section>
<section xml:id="function-arabic-numerals"><title><code>tan:arabic-numerals()</code></title><para><emphasis>Option 1 (TAN-class-1-and-2-functions)</emphasis></para><para><code>tan:arabic-numerals($strings as xs:string*) as xs:string*</code></para><para> Input: any strings that might be convertible to Arabic numerals, but of unknown format or type </para><para> Output: Best-guess Arabic numeral equivalents, as strings. Roman numerals take precedence over alphabet numerals (that is, 'i' is interpreted as 1, not 9) </para><para>Used by template <code><link linkend="template-prep-class-1">ŧ prep-class-1</link></code></para><para>Relies upon <code><link linkend="function-strings-to-numeral-or-numeral-type">tan:strings-to-numeral-or-numeral-type</link></code> .</para><para><emphasis>Option 2 (TAN-class-1-and-2-functions)</emphasis></para><para><code>tan:arabic-numerals($strings as xs:string*, $treat-ambiguous-a-or-i-type-as-roman-numeral as xs:boolean?) as xs:string*</code></para><para> Input: any strings that might be convertible to Arabic numerals, plus the type they are known to conform to </para><para> Output: Best-guess Arabic numeral equivalents, as strings. </para><para>Used by template <code><link linkend="template-prep-class-1">ŧ prep-class-1</link></code></para><para>Relies upon <code><link linkend="function-strings-to-numeral-or-numeral-type">tan:strings-to-numeral-or-numeral-type</link></code> .</para></section>
<section xml:id="function-chop-string"><title><code>tan:chop-string()</code></title><para><code>tan:chop-string($input as xs:string?) as xs:string*</code></para><para> Input: any string </para><para> Output: that string chopped into a sequence of strings, following TAN rules about modifying characters </para><para>Used by template <code><link linkend="template-mark-tok-chars">ŧ mark-tok-chars</link></code> <code><link linkend="template-char-setup">ŧ char-setup</link></code></para><para>Used by function <code><link linkend="function-string-length">tan:string-length</link></code>()</para><para>Relies upon <code><link linkend="variable-char-reg-exp">$char-reg-exp</link></code> .</para></section>
<section xml:id="function-div-to-div-transfer"><title><code>tan:div-to-div-transfer()</code></title><para><code>tan:div-to-div-transfer($divs-with-content-to-be-transferred as element()*, $divs-to-be-infused-with-new-content as element()*) as element()*</code></para><para> Input: (1) any set of divs with content to be transferred into the structure of (2) another  set of divs. </para><para> Output: The div structure of (2), infused with the content of (1). The content is allocated  proportionately, with preference given to punctuation, within a certain range, and then word breaks. </para><para> This function is useful for transforming class-1 documents from one reference system to another. It starts by getting the text content of (1), then string values for (2). </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-text-join">tan:text-join</link></code> <code><link linkend="template-c1-stamp-string-length">ŧ c1-stamp-string-length</link></code> <code><link linkend="template-c1-stamp-string-pos">ŧ c1-stamp-string-pos</link></code> <code><link linkend="template-infuse-tokenized-text">ŧ infuse-tokenized-text</link></code> <code><link linkend="template-strip-all-attributes-except">ŧ strip-all-attributes-except</link></code> .</para></section>
<section xml:id="function-flatref"><title><code>tan:flatref()</code></title><para><emphasis>Option 1 (TAN-class-1-and-2-functions)</emphasis></para><para><code>tan:flatref($node as element()?) as xs:string?</code></para><para> Simple, one-param function of the fuller one, below </para><para>Used by template <code><link linkend="template-get-mismatched-text">ŧ get-mismatched-text</link></code></para><para>Used by function <code><link linkend="function-flatref">tan:flatref</link></code>() <code><link linkend="function-get-ref-seq">tan:get-ref-seq</link></code>()</para><para>Relies upon <code><link linkend="function-flatref">tan:flatref</link></code> .</para><para><emphasis>Option 2 (TAN-class-1-and-2-functions)</emphasis></para><para><code>tan:flatref($node as element()?, $div-types-to-suppress as xs:string*, $div-ns-to-rename as element()*) as xs:string?</code></para><para> Input: div node in a <code>TAN-T(</code>EI) document; truth value whether references that fit a number pattern should be converted to integers </para><para> Output: string value concatenating the reference values from the topmost div ancestor to the node. </para><para> This function assumes that <code><link linkend="attribute-n">@n</link></code> has already been normalized per <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>(), which converts <code>@ns</code> to Arabic numerals wherever possible </para><para>Used by template <code><link linkend="template-get-mismatched-text">ŧ get-mismatched-text</link></code></para><para>Used by function <code><link linkend="function-flatref">tan:flatref</link></code>() <code><link linkend="function-get-ref-seq">tan:get-ref-seq</link></code>()</para><para>Relies upon <code><link linkend="variable-separator-hierarchy">$separator-hierarchy</link></code> .</para></section>
<section xml:id="function-get-n-types"><title><code>tan:get-n-types()</code></title><para><code>tan:get-n-types($src-1st-da-resolved as document-node()*) as element()*</code></para><para> Input: any class 1 TAN documents </para><para> Calculates types of <code><link linkend="attribute-n">@n</link></code> values per div type per source and div type </para><para> October 2016: this function used to be used for validation, but a better routine is preferred. The function is left here, however, in case it proves useful in other contexts. </para><para>Used by template <code><link linkend="template-prep-class-2-doc-pass-2">ŧ prep-class-2-doc-pass-2</link></code></para><para>Relies upon <code><link linkend="function-number-type">tan:number-type</link></code> <code><link linkend="variable-n-type">$n-type</link></code> .</para></section>
<section xml:id="function-get-src-skeleton"><title><code>tan:get-src-skeleton()</code></title><para><code>tan:get-src-skeleton($src-1st-da-prepped as document-node()*) as document-node()?</code></para><para> one-parameter form of the master version below; it results in a merger of sources, but without text and empty leaf divs </para><para>Used by function <code><link linkend="function-prep-verbosely">tan:prep-verbosely</link></code>()</para><para>Relies upon <code><link linkend="function-merge-sources">tan:merge-sources</link></code> .</para></section>
<section xml:id="function-median"><title><code>tan:median()</code></title><para><code>tan:median($numbers as xs:double*) as xs:double?</code></para><para> Input: any sequence of numbers </para><para> Output: the median value </para><para> It is assumed that the input has already been sorted by <code>tan:numbers-sorted(</code>) vel sim </para><para>Used by function <code><link linkend="function-outliers">tan:outliers</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-merge-analyzed-stats"><title><code>tan:merge-analyzed-stats()</code></title><para><code>tan:merge-analyzed-stats($analyzed-stats as element()*, $add-stats as xs:boolean?) as element()</code></para><para> Takes a group of elements that follow the pattern that results from tan:analyze-stats and synthesizes them into a single element. If <code>$add-stats</code> is true, then they are added; if false, the sum of the 2nd - last elements is subtracted from the first; if neither true nor false, nothing happens. Will work on elements of any name, so long as they have tan:d children, with the data points to be merged. </para><para>Used by function <code><link linkend="function-merge-sources">tan:merge-sources</link></code>() <code><link linkend="function-synthesize-merged-group">tan:synthesize-merged-group</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-analyze-stats">tan:analyze-stats</link></code> .</para></section>
<section xml:id="function-merge-source-loop"><title><code>tan:merge-source-loop()</code></title><para><code>tan:merge-source-loop($not-fully-merged-source as document-node()?, $so-far-merged-to-what-depth as xs:integer, $add-stats as xs:boolean?, $order-of-source-ids as xs:string*) as document-node()?</code></para><para> Input: a rough merge (the result of <code>tan:merge-source(</code>)); an initial depth (usually 1), a boolean indicating whether statistics, if present, should be added or if the sum of tail should be subtracted from the head, and a list of source ids (only if the order of sources should be respected) </para><para> Output: a single document that joins sibling <code><link linkend="element-div">&lt;div&gt;</link></code>s that share a common <code>@ref.</code> Further, if any statistics are present and <code>$add-stats</code> is true, then the matching  attributes in merged <code>&lt;d&gt;</code>s are added or checked for differences, as required. If <code>$add-stats</code> is false then the statistics are subtracted (the head of the sequence minus the sum of the tail of the sequence) </para><para> No special provision is made for the order of synthesized <code><link linkend="element-div">&lt;div&gt;</link></code>s; to control for order, the input unmerged sources in every <code><link linkend="element-div">&lt;div&gt;</link></code> should have an <code>@r</code> that specifies the relative rank (values 0 to 1) a div takes. The average of the <code>@r</code>'s will be calculated in the merged <code><link linkend="element-div">&lt;div&gt;</link></code>, so that sorting can take place. In some cases, that <code>@r-avg</code> can be misleading, since it excludes any outliers of <code>@r</code> (to avoid the undue influence of <code><link linkend="element-div">&lt;div&gt;</link></code>s inserted via realignment or of sources that have the work in only a fragmentary state), but the data needed to recalculate the proper average and re-sort the <code><link linkend="element-div">&lt;div&gt;</link></code>s should all be present. </para><para> If, in the course of preparation, all the children <code><link linkend="element-div">&lt;div&gt;</link></code>s of a <code><link linkend="element-div">&lt;div&gt;</link></code> have been eliminated, because of <code><link linkend="element-realign">&lt;realign&gt;</link></code>s in a TAN-A-div file, the result is a hollow <code><link linkend="element-div">&lt;div&gt;</link></code>, with neither <code>&lt;ver&gt;</code> nor <code><link linkend="element-div">&lt;div&gt;</link></code> children. These are retained in the loop; if they are to be omitted, it should be done by whatever process handles these results. </para><para>Used by function <code><link linkend="function-merge-tan-a-div-prepped">tan:merge-tan-a-div-prepped</link></code>() <code><link linkend="function-merge-sources">tan:merge-sources</link></code>() <code><link linkend="function-merge-source-loop">tan:merge-source-loop</link></code>()</para><para>Relies upon <code><link linkend="function-merge-source-loop">tan:merge-source-loop</link></code> <code><link linkend="template-synthesize-merged-sources">ŧ synthesize-merged-sources</link></code> .</para></section>
<section xml:id="function-merge-sources"><title><code>tan:merge-sources()</code></title><para><emphasis>Option 1 (TAN-class-1-and-2-functions)</emphasis></para><para><code>tan:merge-sources($src-1st-da-prepped as document-node()*, $keep-sources-in-order as xs:boolean?) as document-node()?</code></para><para> two-parameter form of the master function below; it results in a merger of sources, but keeping text, juxtaposed in leaf divs and differentiated with new &lt;ver src="[SOURCE NAME]"&gt; to  distinguish one version from the next </para><para>Used by template <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code></para><para>Used by function <code><link linkend="function-get-src-skeleton">tan:get-src-skeleton</link></code>() <code><link linkend="function-merge-sources">tan:merge-sources</link></code>()</para><para>Relies upon <code><link linkend="function-merge-sources">tan:merge-sources</link></code> .</para><para><emphasis>Option 2 (TAN-class-1-and-2-functions)</emphasis></para><para><code>tan:merge-sources($src-1st-da-prepped as document-node()*, $keep-text as xs:boolean, $keep-sources-in-order as xs:boolean?, $add-stats as xs:boolean?) as document-node()?</code></para><para> input: one or more prepped class 1 document (usually has <code><link linkend="attribute-ref">@ref</link></code> with flatref values); a boolean indicating whether text should be kept or dropped (skeleton);  and a boolean indicating whether the order of sources should be respected </para><para> output: a single document that merges the bodies of the input documents into a single structure based on the values of <code><link linkend="attribute-ref">@ref</link></code> </para><para> This function is useful for determining orphan, defective, and complete <code><link linkend="element-div">&lt;div&gt;</link></code>s, and in preparation of publishing TAN-A-div files. To that end, this function automatically handles <code><link linkend="element-div">&lt;div&gt;</link></code>s that have been marked for realignment. </para><para> This function assumes that the sources have at the bare minimum gone through the first level of preparation; that is, tei:TEI, tei:body, and tei:div have been converted to TAN equivalents, and the only tei elements in the body are in leaf divs. </para><para>Used by template <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code></para><para>Used by function <code><link linkend="function-get-src-skeleton">tan:get-src-skeleton</link></code>() <code><link linkend="function-merge-sources">tan:merge-sources</link></code>()</para><para>Relies upon <code><link linkend="function-merge-analyzed-stats">tan:merge-analyzed-stats</link></code> <code><link linkend="function-merge-source-loop">tan:merge-source-loop</link></code> <code><link linkend="template-prepare-class-1-doc-for-merge">ŧ prepare-class-1-doc-for-merge</link></code> .</para></section>
<section xml:id="function-no-outliers"><title><code>tan:no-outliers()</code></title><para><code>tan:no-outliers($numbers as xs:anyAtomicType*) as xs:anyAtomicType*</code></para><para> Input: any sequence of numbers </para><para> Output: the same sequence, without outliers </para><para>Used by function <code><link linkend="function-synthesize-merged-group">tan:synthesize-merged-group</link></code>()</para><para>Relies upon <code><link linkend="function-outliers">tan:outliers</link></code> .</para></section>
<section xml:id="function-normalize-div-text"><title><code>tan:normalize-div-text()</code></title><para><code>tan:normalize-div-text($div-strings as xs:string*) as xs:string*</code></para><para> Input: any sequence of strings </para><para> Output: the same sequence, normalized according to TAN rules. Each item in the sequence is space normalized and then if its end matches one of the special div-end characters, ZWJ U+200D or SOFT HYPHEN U+AD, the character is removed; otherwise a space is added at the end. Zero-length strings are skipped. </para><para> This function is designed specifically for TAN's commitment to nonmixed content. That is, every TAN element contains either elements or non-whitespace text but not both, which also means that whitespace text nodes are effectively ignored. It is assumed that every TAN element is followed by a notional whitespace. </para><para>Used by template <code><link linkend="template-compare-copies">ŧ compare-copies</link></code> <code><link linkend="template-get-mismatched-text">ŧ get-mismatched-text</link></code></para><para>Used by function <code><link linkend="function-text-join">tan:text-join</link></code>()</para><para>Relies upon <code><link linkend="variable-special-end-div-chars-regex">$special-end-div-chars-regex</link></code> .</para></section>
<section xml:id="function-number-sort"><title><code>tan:number-sort()</code></title><para><code>tan:number-sort($numbers as xs:anyAtomicType*) as xs:double*</code></para><para> Input: any sequence of items </para><para> Output: the same sequence, sorted with string numerals converted to numbers </para><para>Used by function <code><link linkend="function-outliers">tan:outliers</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-number-type"><title><code>tan:number-type()</code></title><para><code>tan:number-type($strings as xs:string*) as xs:string*</code></para><para> Version of <code><link linkend="function-strings-to-numeral-or-numeral-type">tan:strings-to-numeral-or-numeral-type</link></code>() that fetches merely the numeral type </para><para>Used by function <code><link linkend="function-get-n-types">tan:get-n-types</link></code>()</para><para>Relies upon <code><link linkend="function-strings-to-numeral-or-numeral-type">tan:strings-to-numeral-or-numeral-type</link></code> .</para></section>
<section xml:id="function-outliers"><title><code>tan:outliers()</code></title><para><code>tan:outliers($numbers as xs:anyAtomicType*) as xs:anyAtomicType*</code></para><para> Input: any sequence of numbers </para><para> Output: outliers in the sequence, </para><para>Used by function <code><link linkend="function-no-outliers">tan:no-outliers</link></code>()</para><para>Relies upon <code><link linkend="function-number-sort">tan:number-sort</link></code> <code><link linkend="function-median">tan:median</link></code> .</para></section>
<section xml:id="function-string-length"><title><code>tan:string-length()</code></title><para><code>tan:string-length($input as xs:string?) as xs:integer</code></para><para> Input: any string </para><para> Output: the number of characters in the string, as defined by TAN (i.e., modifiers are counted with the preceding base character) </para><para>Used by template <code><link linkend="template-c1-stamp-string-length">ŧ c1-stamp-string-length</link></code></para><para>Relies upon <code><link linkend="function-chop-string">tan:chop-string</link></code> .</para></section>
<section xml:id="function-strings-to-numeral-or-numeral-type"><title><code>tan:strings-to-numeral-or-numeral-type()</code></title><para><code>tan:strings-to-numeral-or-numeral-type($strings as xs:string*, $convert-to-arabic as xs:boolean, $treat-ambiguous-a-or-i-type-as-roman-numeral as xs:boolean?, $preface-ambiguous-numeral-with-negative-sign as xs:boolean) as xs:string*</code></para><para> Input: any sequence of strings that may be a numeral type, and an indication whether what should be returned is not the type but the Arabic numeral equivalent (as a string) </para><para> Output: the same number of strings, with the value of either the <code><link linkend="variable-n-type">$n-type</link></code> that is the first match or the Arabic numeral equivalent </para><para> In general, Roman numerals are checked first, strings last ('i' = 1 not 9); mixed numeral types result in hyphen-joined Arabic numerals (e.g., 1a - &gt; 1-1) </para><para>Used by function <code><link linkend="function-arabic-numerals">tan:arabic-numerals</link></code>() <code><link linkend="function-arabic-numerals">tan:arabic-numerals</link></code>() <code><link linkend="function-number-type">tan:number-type</link></code>()</para><para>Relies upon <code><link linkend="variable-n-type">$n-type</link></code> <code><link linkend="function-rom-to-int">tan:rom-to-int</link></code> <code><link linkend="variable-n-type-pattern">$n-type-pattern</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> .</para></section>
<section xml:id="function-synthesize-merged-group"><title><code>tan:synthesize-merged-group()</code></title><para><code>tan:synthesize-merged-group($current-group as element()*, $add-stats as xs:boolean?) as element()?</code></para><para> Input: a group of elements that share the same <code><link linkend="attribute-ref">@ref</link></code>; a parameter indicating whether stats, if present, should be added </para><para> Output: a single element that merges the content of the grouped element </para><para> This function is intended solely for the template synthesize-src-skeleton, to handle in identical ways content that has been chosen and ordered differently. </para><para>Used by template <code><link linkend="template-synthesize-merged-sources">ŧ synthesize-merged-sources</link></code></para><para>Relies upon <code><link linkend="function-merge-analyzed-stats">tan:merge-analyzed-stats</link></code> <code><link linkend="function-no-outliers">tan:no-outliers</link></code> .</para></section>
<section xml:id="function-text-join"><title><code>tan:text-join()</code></title><para><emphasis>Option 1 (TAN-class-1-and-2-functions)</emphasis></para><para><code>tan:text-join($items as item()*) as xs:string</code></para><para>Used by template <code><link linkend="template-c1-stamp-string-length">ŧ c1-stamp-string-length</link></code> <code><link linkend="template-tokenize-prepped-class-1">ŧ tokenize-prepped-class-1</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code></para><para>Used by function <code><link linkend="function-text-join">tan:text-join</link></code>() <code><link linkend="function-div-to-div-transfer">tan:div-to-div-transfer</link></code>() <code><link linkend="function-compare-copies">tan:compare-copies</link></code>()</para><para>Relies upon <code><link linkend="function-text-join">tan:text-join</link></code> .</para><para><emphasis>Option 2 (TAN-class-1-and-2-functions)</emphasis></para><para><code>tan:text-join($items as item()*, $prep-end as xs:boolean) as xs:string</code></para><para> Input: any number of elements, text nodes, or strings; a boolean indicating whether the end of the sequence should also be prepared </para><para> Output: a single string that joins and normalizes them according to TAN rules: if the item is (1) a <code><link linkend="element-tok">&lt;tok&gt;</link></code> or <code>&lt;non-tok&gt;</code> that has following siblings or (2) the last leaf element and <code>$prep-end</code> is false then the bare text is used; otherwise the text return follows the rules of <code><link linkend="function-normalize-div-text">tan:normalize-div-text</link></code>() </para><para> If the second parameter is true, then the end of the resultant string is checked for special div-end characters </para><para>Used by template <code><link linkend="template-c1-stamp-string-length">ŧ c1-stamp-string-length</link></code> <code><link linkend="template-tokenize-prepped-class-1">ŧ tokenize-prepped-class-1</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code></para><para>Used by function <code><link linkend="function-text-join">tan:text-join</link></code>() <code><link linkend="function-div-to-div-transfer">tan:div-to-div-transfer</link></code>() <code><link linkend="function-compare-copies">tan:compare-copies</link></code>()</para><para>Relies upon <code><link linkend="function-normalize-div-text">tan:normalize-div-text</link></code> <code><link linkend="function-normalize-text">tan:normalize-text</link></code> .</para></section>
</section>
</section>
<section><title>TAN-key global variables, keys, and functions summarized</title><section><title>variables</title><section xml:id="variable-all-body-iris"><title><code>$all-body-iris</code></title><para>Definition: <code><link linkend="variable-body">$body</link>//tan:IRI</code></para><para>Used by template <code><link linkend="template-tan-key-errors">ŧ tan-key-errors</link></code></para><para>Relies upon <code><link linkend="variable-body">$body</link></code> .</para></section>
</section>
</section>
<section><title>TAN-class-2-and-3 global variables, keys, and functions summarized</title><section><title>functions</title><section xml:id="function-data-type-check"><title><code>tan:data-type-check()</code></title><para><code>tan:data-type-check($item as item()?, $data-type as xs:string) as xs:boolean</code></para><para> Input: an item and a string corresponding to a data type </para><para> Output: a boolean indicating whether the item can be cast into that data type </para><para>Used by template <code><link linkend="template-prep-tan-claims">ŧ prep-tan-claims</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-feature-test-to-groups"><title><code>tan:feature-test-to-groups()</code></title><para><code>tan:feature-test-to-groups($attr-feature-test as xs:string?) as element()*</code></para><para> Input: any value of <code><link linkend="attribute-feature-test">@feature-test</link></code> </para><para> Output: the value converted into a series of <code><link linkend="element-group">&lt;group&gt;</link></code>ed <code><link linkend="element-item">&lt;item&gt;</link></code>s, observing the accepted syntax for this attribute </para><para> Example: "a b + c" - &gt; </para><para>               <code><link linkend="element-group">&lt;group&gt;</link></code></para><para>                  <code><link linkend="element-item">&lt;item&gt;</link></code>a&lt;/item&gt;</para><para>               &lt;/group&gt;</para><para>               <code><link linkend="element-group">&lt;group&gt;</link></code></para><para>                  <code><link linkend="element-item">&lt;item&gt;</link></code>b&lt;/item&gt;</para><para>                  <code><link linkend="element-item">&lt;item&gt;</link></code>c&lt;/item&gt;</para><para>               &lt;/group&gt;</para><para> </para><para>Used by template <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code></para><para>Used by function <code><link linkend="function-obeyed-by-m">tan:obeyed-by-m</link></code>()</para><para>Relies upon <code><link linkend="function-normalize-text">tan:normalize-text</link></code> .</para></section>
<section xml:id="function-prep-TAN-claims"><title><code>tan:prep-TAN-claims()</code></title><para><code>tan:prep-TAN-claims($TAN-docs-resolved as document-node()*) as document-node()*</code></para><para> Input: resolved TAN documents that take claims </para><para> Output: the same documents, marking <code><link linkend="element-claim">&lt;claim&gt;</link></code>s for errors </para><para>Used by variable <code><link linkend="variable-self-prepped">$self-prepped</link></code></para><para>Used by function <code><link linkend="function-prep-resolved-tan-a-div-doc">tan:prep-resolved-tan-a-div-doc</link></code>()</para><para>Relies upon <code><link linkend="template-prep-tan-claims">ŧ prep-tan-claims</link></code> .</para></section>
<section xml:id="function-prep-TAN-mor"><title><code>tan:prep-TAN-mor()</code></title><para><emphasis>Option 1 (TAN-class-2-and-3-functions)</emphasis></para><para><code>tan:prep-TAN-mor($TAN-mor-docs-resolved as document-node()*) as document-node()*</code></para><para> One-param version of the function below </para><para>Used by variable <code><link linkend="variable-morphologies-prepped">$morphologies-prepped</link></code></para><para>Used by function <code><link linkend="function-prep-TAN-mor">tan:prep-TAN-mor</link></code>()</para><para>Relies upon <code><link linkend="variable-doc-id">$doc-id</link></code> <code><link linkend="variable-inclusions-1st-da">$inclusions-1st-da</link></code> <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code> <code><link linkend="function-prep-TAN-mor">tan:prep-TAN-mor</link></code> .</para><para><emphasis>Option 2 (TAN-class-2-and-3-functions)</emphasis></para><para><code>tan:prep-TAN-mor($TAN-mor-docs-resolved as document-node()*, $TAN-mor-doc-inclusions-resolved as document-node()*) as document-node()*</code></para><para> Input: resolved TAN-mor documents </para><para> Output: the same documents, after the inclusions have been resolved </para><para>Used by variable <code><link linkend="variable-morphologies-prepped">$morphologies-prepped</link></code></para><para>Used by function <code><link linkend="function-prep-TAN-mor">tan:prep-TAN-mor</link></code>()</para><para>Relies upon <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> .</para></section>
</section>
</section>
<section><title>diff-for-xslt2 global variables, keys, and functions summarized</title><section><title>functions</title><section xml:id="function-diff"><title><code>tan:diff()</code></title><para><emphasis>Option 1 (diff-for-xslt2)</emphasis></para><para><code>tan:diff($string1 as xs:string?, $string2 as xs:string?) as element()</code></para><para> two-parameter version of the full version below. The stagger and diminishment</para><para>        factors are designed to get small as the length of the shortest string gets larger.</para><para>        </para><para>Used by function <code><link linkend="function-diff">tan:diff</link></code>()</para><para>Relies upon <code><link linkend="function-diff">tan:diff</link></code> .</para><para><emphasis>Option 2 (diff-for-xslt2)</emphasis></para><para><code>tan:diff($string1 as xs:string?, $string2 as xs:string?, $diminishment-base as xs:double, $diminishment-exp-adjustment as xs:double, $stagger-base-adjustment as xs:double, $stagger-exp-adjustment as xs:double) as element()</code></para><para> Input: any two strings.</para><para>        Output: The differences between the two strings in the form of:</para><para>            <code>&lt;diff&gt;</code></para><para>            <code>&lt;s1&gt;</code>[text unique to string 1]&lt;/s1&gt;</para><para>            <code>&lt;s2&gt;</code>[text unique to string 2]&lt;/s2&gt;</para><para>            <code>&lt;common&gt;</code>[text shared by both strings]&lt;/common&gt;</para><para>        &lt;/diff&gt;</para><para>        The algorithm is designed for XSLT 2, in which too many nested loops prove fatal, and with</para><para>        the assumption that the user could settle for a difference that finds a long common substring, </para><para>        and not perhaps the longest common substring.</para><para>        </para><para>Used by function <code><link linkend="function-diff">tan:diff</link></code>()</para><para>Relies upon <code><link linkend="function-diff-loop">tan:diff-loop</link></code> .</para></section>
<section xml:id="function-diff-core"><title><code>tan:diff-core()</code></title><para><code>tan:diff-core($long-string as xs:string?, $short-string as xs:string?, $short-string-length as xs:double, $segment-length as xs:double, $segment-position as xs:double, $diminishment-base as xs:double, $diminishment-exp-adjustment as xs:double, $stagger-base-adjustment as xs:double, $stagger-exp-adjustment as xs:double, $loop-count as xs:integer, $line-count as xs:double) as element()*</code></para><para>Used by function <code><link linkend="function-diff-loop">tan:diff-loop</link></code>() <code><link linkend="function-diff-core">tan:diff-core</link></code>()</para><para>Relies upon <code><link linkend="function-escape">tan:escape</link></code> <code><link linkend="function-diff-core">tan:diff-core</link></code> .</para></section>
<section xml:id="function-diff-core-draft"><title><code>tan:diff-core-draft()</code></title><para><code>tan:diff-core-draft($long-string as xs:string?, $short-string as xs:string?, $short-string-length as xs:double?, $length-to-try as xs:double?, $position-to-try as xs:double?, $diminishment-factor as xs:double, $stagger-factor as xs:double) as element()*</code></para><para>Used by function <code><link linkend="function-diff-core-draft">tan:diff-core-draft</link></code>()</para><para>Relies upon <code><link linkend="function-escape">tan:escape</link></code> <code><link linkend="function-diff-core-draft">tan:diff-core-draft</link></code> .</para></section>
<section xml:id="function-diff-loop"><title><code>tan:diff-loop()</code></title><para><code>tan:diff-loop($string1 as xs:string?, $string2 as xs:string?, $diminishment-base as xs:double, $diminishment-exp-adjustment as xs:double, $stagger-base-adjustment as xs:double, $stagger-exp-adjustment as xs:double, $loop-count as xs:integer) as node()*</code></para><para>Used by function <code><link linkend="function-diff">tan:diff</link></code>() <code><link linkend="function-diff-loop">tan:diff-loop</link></code>()</para><para>Relies upon <code><link linkend="function-diff-core">tan:diff-core</link></code> <code><link linkend="function-diff-loop">tan:diff-loop</link></code> <code><link linkend="template-diff-rectify">ŧ diff-rectify</link></code> .</para></section>
<section xml:id="function-group-adjacent-elements"><title><code>tan:group-adjacent-elements()</code></title><para><code>tan:group-adjacent-elements($elements as element()*) as element()*</code></para><para> Input: any sequence of elements </para><para> Output: the same elements, but adjacent elements of the same name grouped together </para><para>Used by function <code><link linkend="function-raw-diff">tan:raw-diff</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-raw-diff"><title><code>tan:raw-diff()</code></title><para><emphasis>Option 1 (diff-for-xslt2)</emphasis></para><para><code>tan:raw-diff($string-a as xs:string?, $string-b as xs:string?) as element()</code></para><para> 2-param version of fuller one below </para><para>Used by template <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code></para><para>Used by function <code><link linkend="function-raw-diff">tan:raw-diff</link></code>()</para><para>Relies upon <code><link linkend="function-raw-diff">tan:raw-diff</link></code> .</para><para><emphasis>Option 2 (diff-for-xslt2)</emphasis></para><para><code>tan:raw-diff($string-a as xs:string?, $string-b as xs:string?, $snap-to-word as xs:boolean) as element()</code></para><para> Input: any two strings; boolean indicating whether results should snap to nearest word </para><para> Output: an element with <code>&lt;a&gt;</code>, <code>&lt;b&gt;</code>, and <code>&lt;common&gt;</code> children showing where strings a and b match and depart </para><para> This function was written after tan:diff, intended to be a cruder and faster way to check two strings against each other, suitable for validation without hanging due to nested recursion objections. </para><para>Used by template <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code></para><para>Used by function <code><link linkend="function-raw-diff">tan:raw-diff</link></code>()</para><para>Relies upon <code><link linkend="function-raw-diff-loop">tan:raw-diff-loop</link></code> <code><link linkend="function-group-adjacent-elements">tan:group-adjacent-elements</link></code> <code><link linkend="template-snap-to-word-pass-1">ŧ snap-to-word-pass-1</link></code> .</para></section>
<section xml:id="function-raw-diff-loop"><title><code>tan:raw-diff-loop()</code></title><para><code>tan:raw-diff-loop($short-string as element()?, $long-string as element()?, $start-at-beginning as xs:boolean, $check-vertically-before-horizontally as xs:boolean, $loop-counter as xs:integer) </code></para><para>Used by function <code><link linkend="function-raw-diff">tan:raw-diff</link></code>() <code><link linkend="function-raw-diff-loop">tan:raw-diff-loop</link></code>()</para><para>Relies upon <code><link linkend="function-escape">tan:escape</link></code> <code><link linkend="function-raw-diff-loop">tan:raw-diff-loop</link></code> .</para></section>
</section>
</section>
<section><title>regex-ext-tan global variables, keys, and functions summarized</title><section><title>variables</title><section xml:id="variable-hex-key"><title><code>$hex-key</code></title><para>Definition: <code>             '0',             '1',             '2',             '3',             '4',             '5',             '6',             '7',             '8',             '9',             'A',             'B',             'C',             'D',             'E',             'F'</code></para><para>Used by function <code><link linkend="function-dec-to-hex">tan:dec-to-hex</link></code>() <code><link linkend="function-hex-to-dec">tan:hex-to-dec</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
</section>
<section><title>functions</title><section xml:id="function-dec-to-hex"><title><code>tan:dec-to-hex()</code></title><para><code>tan:dec-to-hex($in as xs:integer) as xs:string</code></para><para> Change any integer into a hexadecimal string</para><para>            Input: xs:integer </para><para>         Output: hexadecimal equivalent as a string </para><para>         E.g., 31 - &gt; '1F'</para><para>      </para><para>Used by function <code><link linkend="function-dec-to-hex">tan:dec-to-hex</link></code>()</para><para>Relies upon <code><link linkend="function-dec-to-hex">tan:dec-to-hex</link></code> <code><link linkend="variable-hex-key">$hex-key</link></code> .</para></section>
<section xml:id="function-expand-search"><title><code>tan:expand-search()</code></title><para><code>tan:expand-search($regex as xs:string?) as xs:string?</code></para><para> This function takes a string representation of a regular expression pattern and replaces every unescaped</para><para>      character with a character class that lists all Unicode characters that would recursively decompose to that base</para><para>      character.</para><para>      E.g., 'word' - &gt; '[wŵʷẁẃẅẇẉẘⓦｗ𝐰𝑤𝒘𝓌𝔀𝔴𝕨𝖜𝗐𝘄𝘸𝙬𝚠][oºòóôõöōŏőơǒǫǭȍȏȫȭȯȱᵒṍṏṑṓọỏốồổỗộớờởỡợₒℴⓞ㍵ｏ𝐨𝑜𝒐𝓸𝔬𝕠𝖔𝗈𝗼𝘰𝙤𝚘][rŕŗřȑȓʳᵣṙṛṝṟⓡ㎭㎮㎯ｒ𝐫𝑟𝒓𝓇𝓻𝔯𝕣𝖗𝗋𝗿𝘳𝙧𝚛][dďǆǳᵈḋḍḏḑḓⅆⅾⓓ㍲㍷㍸㍹㎗㏈ｄ𝐝𝑑𝒅𝒹𝓭𝔡𝕕𝖉𝖽𝗱𝘥𝙙𝚍]' </para><para>      This function is useful for cases where it is more efficient to change the search term rather than to transform</para><para>      the text to be searched into base characters.</para><para>      </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-get-ucd-decomp">tan:get-ucd-decomp</link></code> <code><link linkend="variable-regex-escaping-characters">$regex-escaping-characters</link></code> <code><link linkend="function-string-composite">tan:string-composite</link></code> <code><link linkend="template-add-square-brackets">ŧ add-square-brackets</link></code> .</para></section>
<section xml:id="function-get-ucd-decomp"><title><code>tan:get-ucd-decomp()</code></title><para><code>tan:get-ucd-decomp() </code></para><para>Used by function <code><link linkend="function-string-base">tan:string-base</link></code>() <code><link linkend="function-string-composite">tan:string-composite</link></code>() <code><link linkend="function-expand-search">tan:expand-search</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="function-hex-to-dec"><title><code>tan:hex-to-dec()</code></title><para><code>tan:hex-to-dec($hex as xs:string?) as item()*</code></para><para> Change any hexadecimal string into an integer</para><para>         E.g., '1F' - &gt; 31</para><para>      </para><para>Used by function <code><link linkend="function-process-regex-escape-k">tan:process-regex-escape-k</link></code>()</para><para>Relies upon <code><link linkend="variable-hex-key">$hex-key</link></code> .</para></section>
<section xml:id="function-matches"><title><code>tan:matches()</code></title><para><emphasis>Option 1 (regex-ext-tan-functions)</emphasis></para><para><code>tan:matches($input as xs:string?, $pattern as xs:string) as xs:boolean</code></para><para> two-param function of the three-param version below </para><para>Used by function <code><link linkend="function-obeyed-by-m">tan:obeyed-by-m</link></code>() <code><link linkend="function-get-toks">tan:get-toks</link></code>() <code><link linkend="function-matches">tan:matches</link></code>()</para><para>Relies upon <code><link linkend="function-matches">tan:matches</link></code> .</para><para><emphasis>Option 2 (regex-ext-tan-functions)</emphasis></para><para><code>tan:matches($input as xs:string?, $pattern as xs:string, $flags as xs:string) as xs:boolean</code></para><para> Parallel to <code>fn:matches(</code>), but converts TAN-exceptions into classes. See <code><link linkend="function-regex">tan:regex</link></code>() for details. </para><para>Used by function <code><link linkend="function-obeyed-by-m">tan:obeyed-by-m</link></code>() <code><link linkend="function-get-toks">tan:get-toks</link></code>() <code><link linkend="function-matches">tan:matches</link></code>()</para><para>Relies upon <code><link linkend="function-regex">tan:regex</link></code> .</para></section>
<section xml:id="function-process-regex-escape-k"><title><code>tan:process-regex-escape-k()</code></title><para><code>tan:process-regex-escape-k($val-inside-braces as xs:string, $unicode-db as document-node()) as xs:string?</code></para><para>Used by function <code><link linkend="function-regex">tan:regex</link></code>()</para><para>Relies upon <code><link linkend="function-hex-to-dec">tan:hex-to-dec</link></code> .</para></section>
<section xml:id="function-regex"><title><code>tan:regex()</code></title><para><code>tan:regex($regex as xs:string?) as xs:string?</code></para><para> Input: string of a regex search</para><para>        Output: the same string, with TAN-reserved escape sequences replaced by characters class sequences</para><para>        E.g., '\k{.greek.capital.perispomeni}' - - &gt; '[ἎἏἮἯἾἿὟὮὯᾎᾏᾞᾟᾮᾯ]'</para><para>        \k{.latin.cedilla} - - &gt; '[ÇçĢģĶķĻļŅņŖŗŞşŢţȨȩᷗḈḉḐḑḜḝḨḩ]'</para><para>        'angle \k{4d-4f, 51}' - - &gt; 'angle [MNOQ]'</para><para>        </para><para>        This function grabs entire classes of Unicode characters either by their codepoint or by the parts of </para><para>        their name. It performs specially upon the form \k{***VALUE***}, where ***VALUE*** is either (1) one or</para><para>        more hexadecimal numbers joined by commas and hyphens or (2) one or more words each one prepended by a</para><para>        non-word character. In the first option, there will be returned every Unicode character that has been </para><para>        picked, filling in ranges where indicated by the hyphen. In the second option, there will be returned </para><para>        every Unicode character that has all of those words in its official Unicode name, or alias.</para><para>        Other examples:</para><para>        </para><para>          Any word with an omega, even if not in any of the Greek blocks: '\k{.omega}' (useful if you</para><para>          wish to find nonstandard uses of the omega, especially in the symbol block)</para><para>          </para><para>          Any word with two successive omegas, no matter their accentuation or capitalizaton, or if they </para><para>          have an iota subscript: '\k{.greek.omega}{2}' (useful for looking up a Greek word where accentuation</para><para>          changes depending upon context or inflection)</para><para>          </para><para>          Every Greek word that attracts an accent from an enclitic: </para><para>          '[\k{.greek.oxia}\k{.greek.tonos}\k{.greek.perispomeni}]\w*[\k{.greek.tonos}\k{.greek.oxia}]'</para><para>        </para><para>Used by function <code><link linkend="function-matches">tan:matches</link></code>() <code><link linkend="function-replace">tan:replace</link></code>() <code><link linkend="function-tokenize">tan:tokenize</link></code>()</para><para>Relies upon <code><link linkend="function-process-regex-escape-k">tan:process-regex-escape-k</link></code> <code><link linkend="template-add-square-brackets">ŧ add-square-brackets</link></code> .</para></section>
<section xml:id="function-replace"><title><code>tan:replace()</code></title><para><emphasis>Option 1 (regex-ext-tan-functions)</emphasis></para><para><code>tan:replace($input as xs:string?, $pattern as xs:string, $replacement as xs:string) as xs:string</code></para><para> three-param function of the four-param version below </para><para>Used by function <code><link linkend="function-batch-replace">tan:batch-replace</link></code>() <code><link linkend="function-replace">tan:replace</link></code>()</para><para>Relies upon <code><link linkend="function-replace">tan:replace</link></code> .</para><para><emphasis>Option 2 (regex-ext-tan-functions)</emphasis></para><para><code>tan:replace($input as xs:string?, $pattern as xs:string, $replacement as xs:string, $flags as xs:string) as xs:string</code></para><para> Parallel to <code>fn:replace(</code>), but converts TAN-exceptions into classes. See <code><link linkend="function-regex">tan:regex</link></code>() for details. </para><para>Used by function <code><link linkend="function-batch-replace">tan:batch-replace</link></code>() <code><link linkend="function-replace">tan:replace</link></code>()</para><para>Relies upon <code><link linkend="function-regex">tan:regex</link></code> .</para></section>
<section xml:id="function-string-base"><title><code>tan:string-base()</code></title><para><code>tan:string-base($arg as xs:string?) as xs:string?</code></para><para> This function takes any string and replaces every character with its base Unicode character.</para><para>      E.g., ἀνθρὠπους - &gt; ανθρωπουσ</para><para>      This is useful for preparing text to be searched without respect to accents</para><para>      </para><para>No variables, keys, functions, or named templates depend upon this xsl:function.</para><para>Relies upon <code><link linkend="function-get-ucd-decomp">tan:get-ucd-decomp</link></code> .</para></section>
<section xml:id="function-string-composite"><title><code>tan:string-composite()</code></title><para><code>tan:string-composite($arg as xs:string?) as xs:string?</code></para><para> This function is the inverse of tan:string-base, in that it replaces every character with</para><para>         those Unicode characters that use it as a base. If none exist, then the character itself is </para><para>         returned.</para><para>         E.g., 'Max' - &gt; 'MᴹḾṀṂℳⅯⓂ㎆㎒㎫㎹㎿㏁Ｍ𝐌𝑀𝑴𝓜𝔐𝕄𝕸𝖬𝗠𝘔𝙈𝙼🄼🅋🅪🅫aªàáâãäåāăąǎǟǡǻȁȃȧᵃḁẚạảấầẩẫậắằẳẵặₐ℀℁ⓐ㏂ａ𝐚𝑎𝒂𝒶𝓪𝔞𝕒𝖆𝖺𝗮𝘢𝙖𝚊xˣẋẍₓⅹⅺⅻⓧｘ𝐱𝑥𝒙𝓍𝔁𝔵𝕩𝖝𝗑𝘅𝘹𝙭𝚡'</para><para>         This is useful for preparing regex character classes to broaden a search. </para><para>      </para><para>Used by function <code><link linkend="function-expand-search">tan:expand-search</link></code>()</para><para>Relies upon <code><link linkend="function-get-ucd-decomp">tan:get-ucd-decomp</link></code> .</para></section>
<section xml:id="function-tokenize"><title><code>tan:tokenize()</code></title><para><emphasis>Option 1 (regex-ext-tan-functions)</emphasis></para><para><code>tan:tokenize($input as xs:string?, $pattern as xs:string) as xs:string*</code></para><para> two-param function of the three-param version below </para><para>Used by function <code><link linkend="function-tokenize">tan:tokenize</link></code>()</para><para>Relies upon <code><link linkend="function-tokenize">tan:tokenize</link></code> .</para><para><emphasis>Option 2 (regex-ext-tan-functions)</emphasis></para><para><code>tan:tokenize($input as xs:string?, $pattern as xs:string, $flags as xs:string) as xs:string*</code></para><para> Parallel to <code>fn:tokenize(</code>), but converts TAN-exceptions into classes. See <code><link linkend="function-regex">tan:regex</link></code>() for details. </para><para>Used by function <code><link linkend="function-tokenize">tan:tokenize</link></code>()</para><para>Relies upon <code><link linkend="function-regex">tan:regex</link></code> .</para></section>
</section>
<section><title>templates</title><section xml:id="template-prep-regex-char-class"><title><code>Ŧ prep-regex-char-class</code></title><para>No variables, keys, functions, or named templates depend upon this xsl:template.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
</section>
</section>
<section><title>TAN-schema global variables, keys, and functions summarized</title><section><title>variables</title><section xml:id="variable-rng-collection"><title><code>$rng-collection</code></title><para>Definition: <code><link linkend="variable-schema-collection">$schema-collection</link>[rng:*]</code></para><para>Used by variable <code><link linkend="variable-rng-collection-without-TEI">$rng-collection-without-TEI</link></code> <code><link linkend="variable-TAN-elements-that-take-the-attribute-which">$TAN-elements-that-take-the-attribute-which</link></code></para><para>Used by function <code><link linkend="function-get-parent-elements">tan:get-parent-elements</link></code>()</para><para>Relies upon <code><link linkend="variable-schema-collection">$schema-collection</link></code> .</para></section>
<section xml:id="variable-rng-collection-without-TEI"><title><code>$rng-collection-without-TEI</code></title><para>Definition: <code><link linkend="variable-rng-collection">$rng-collection</link>[not(matches(base-uri(.), 'TAN-TEI'))]</code></para><para>Used by variable <code><link linkend="variable-TAN-elements-that-take-the-attribute-which">$TAN-elements-that-take-the-attribute-which</link></code></para><para>Used by function <code><link linkend="function-get-parent-elements">tan:get-parent-elements</link></code>()</para><para>Relies upon <code><link linkend="variable-rng-collection">$rng-collection</link></code> .</para></section>
<section xml:id="variable-schema-collection"><title><code>$schema-collection</code></title><para>Definition: <code>collection('../../schemas/collection.xml')</code></para><para>Used by variable <code><link linkend="variable-rng-collection">$rng-collection</link></code></para><para>Does not rely upon global variables, keys, functions, or templates.</para></section>
<section xml:id="variable-TAN-elements-that-take-the-attribute-which"><title><code>$TAN-elements-that-take-the-attribute-which</code></title><para>Definition: <code>             <link linkend="function-get-parent-elements">tan:get-parent-elements</link>(<link linkend="variable-rng-collection-without-TEI">$rng-collection-without-TEI</link>/rng:grammar/rng:define[rng:attribute/@name = 'which'])</code></para><para>Used by template <code><link linkend="template-tan-key-errors">ŧ tan-key-errors</link></code></para><para>Relies upon <code><link linkend="function-get-parent-elements">tan:get-parent-elements</link></code> <code><link linkend="variable-rng-collection-without-TEI">$rng-collection-without-TEI</link></code> .</para></section>
</section>
<section><title>functions</title><section xml:id="function-get-parent-elements"><title><code>tan:get-parent-elements()</code></title><para><code>tan:get-parent-elements($current-elements as element()*) as element()*</code></para><para> requires as input some rng: element from <code><link linkend="variable-rng-collection">$rng-collection</link></code>, oftentimes an rng:element or rng:attribute </para><para>Used by variable <code><link linkend="variable-TAN-elements-that-take-the-attribute-which">$TAN-elements-that-take-the-attribute-which</link></code></para><para>Used by function <code><link linkend="function-get-parent-elements">tan:get-parent-elements</link></code>()</para><para>Relies upon <code><link linkend="variable-rng-collection-without-TEI">$rng-collection-without-TEI</link></code> <code><link linkend="function-get-parent-elements">tan:get-parent-elements</link></code> .</para></section>
</section>
</section>
<section><title>Mode templates</title><para>Templates based on modes are frequently found across constituent
                           files, so they are collated here separately, one entry per mode.</para><section xml:id="template-all"><title><code>ŧ #all</code></title><para>1 element: <code>TAN-core-functions.xsl </code></para><para> We ignore, but retain, tails throughout </para><para>No variables, keys, functions, or named templates depend upon this xsl:template.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-add-lm-to-tok"><title><code>ŧ add-lm-to-tok</code></title><para>2 elements: <code>TAN-class-2-functions.xsl </code></para><para>Used by template <code><link linkend="template-add-lm-to-tok">ŧ add-lm-to-tok</link></code></para><para>Used by function <code><link linkend="function-get-src-1st-da-with-lms">tan:get-src-1st-da-with-lms</link></code>()</para><para>Relies upon <code><link linkend="template-add-lm-to-tok">ŧ add-lm-to-tok</link></code> .</para></section><section xml:id="template-add-square-brackets"><title><code>ŧ add-square-brackets</code></title><para>2 elements: <code>regex-ext-tan-functions.xsl </code></para><para>Used by function <code><link linkend="function-expand-search">tan:expand-search</link></code>() <code><link linkend="function-regex">tan:regex</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-add-tok-val"><title><code>ŧ add-tok-val</code></title><para>2 elements: <code>TAN-LM-functions.xsl </code></para><para>Used by function <code><link linkend="function-add-tok-val">tan:add-tok-val</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-analysis-stamp"><title><code>ŧ analysis-stamp</code></title><para>4 elements: <code>TAN-A-tok-functions.xsl </code><code>TAN-class-2-functions.xsl </code></para><para>Used by template <code><link linkend="template-analysis-stamp">ŧ analysis-stamp</link></code> <code><link linkend="template-analysis-stamp">ŧ analysis-stamp</link></code></para><para>Used by function <code><link linkend="function-get-src-1st-da-analysis-stamped">tan:get-src-1st-da-analysis-stamped</link></code>()</para><para>Relies upon <code><link linkend="template-analysis-stamp">ŧ analysis-stamp</link></code> .</para></section><section xml:id="template-analyze-ref"><title><code>ŧ analyze-ref</code></title><para>2 elements: <code>TAN-class-2-functions.xsl </code></para><para>Used by function <code><link linkend="function-analyze-ref">tan:analyze-ref</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-arabic-numerals"><title><code>ŧ arabic-numerals</code></title><para>5 elements: <code>TAN-class-1-and-2-functions.xsl </code><code>TAN-class-2-functions.xsl </code><code>TAN-core-functions.xsl </code></para><para> The companion <code>&lt;xsl:template&gt;</code> to this, treating *[<code><link linkend="attribute-ref">@ref</link></code>], is in TAN-class-2-functions </para><para>&lt;xsl:param name="treat-ambiguous-a-or-i-type-as-roman-numeral" as="xs:boolean?" tunnel="yes"/&gt;</para><para>&lt;xsl:param name="warn-on-ambiguous-numerals" as="xs:boolean?" tunnel="yes"/&gt;</para><para> For the companion template, treating *[<code><link linkend="attribute-n">@n</link></code>], see TAN-class-1-and-2-functions </para><para>Used by template <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code> <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code></para><para>Used by function <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>()</para><para>Relies upon <code><link linkend="variable-n-type">$n-type</link></code> <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code> <code><link linkend="function-normalize-text">tan:normalize-text</link></code> <code><link linkend="variable-separator-hierarchy">$separator-hierarchy</link></code> <code><link linkend="function-analyze-elements-with-numeral-attributes">tan:analyze-elements-with-numeral-attributes</link></code> <code><link linkend="function-error">tan:error</link></code> .</para></section><section xml:id="template-c1-add-ref"><title><code>ŧ c1-add-ref</code></title><para>1 element: <code>TAN-class-1-functions.xsl </code></para><para>Used by template <code><link linkend="template-mark-splits">ŧ mark-splits</link></code></para><para>Used by function <code><link linkend="function-compare-copies">tan:compare-copies</link></code>() <code><link linkend="function-mark-splits">tan:mark-splits</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-c1-stamp-string-length"><title><code>ŧ c1-stamp-string-length</code></title><para>3 elements: <code>TAN-class-1-and-2-functions.xsl </code></para><para>Used by template <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code></para><para>Used by function <code><link linkend="function-remodel-div-ref">tan:remodel-div-ref</link></code>() <code><link linkend="function-div-to-div-transfer">tan:div-to-div-transfer</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-c1-stamp-string-pos"><title><code>ŧ c1-stamp-string-pos</code></title><para>1 element: <code>TAN-class-1-and-2-functions.xsl </code></para><para>Used by template <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code></para><para>Used by function <code><link linkend="function-div-to-div-transfer">tan:div-to-div-transfer</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-char-setup"><title><code>ŧ char-setup</code></title><para>3 elements: <code>TAN-class-2-functions.xsl </code></para><para>Used by template <code><link linkend="template-char-setup">ŧ char-setup</link></code></para><para>Used by function <code><link linkend="function-get-src-1st-da-chars-picked">tan:get-src-1st-da-chars-picked</link></code>() <code><link linkend="function-analyze-tok-chars">tan:analyze-tok-chars</link></code>()</para><para>Relies upon <code><link linkend="function-chop-string">tan:chop-string</link></code> <code><link linkend="template-char-setup">ŧ char-setup</link></code> .</para></section><section xml:id="template-class-1-copy-errors"><title><code>ŧ class-1-copy-errors</code></title><para>3 elements: <code>TAN-class-1-errors.xsl </code><code>TAN-core-errors.xsl </code></para><para>Used by variable <code><link linkend="variable-self-class-1-errors-marked">$self-class-1-errors-marked</link></code></para><para>Used by template <code><link linkend="template-class-1-copy-errors">ŧ class-1-copy-errors</link></code></para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="template-class-1-copy-errors">ŧ class-1-copy-errors</link></code> .</para></section><section xml:id="template-class-1-errors"><title><code>ŧ class-1-errors</code></title><para>5 elements: <code>TAN-class-1-errors.xsl </code><code>TAN-core-errors.xsl </code></para><para>Used by variable <code><link linkend="variable-self-class-1-errors-marked">$self-class-1-errors-marked</link></code></para><para>Used by template <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code></para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="variable-see-alsos-resolved">$see-alsos-resolved</link></code> <code><link linkend="template-c1-stamp-string-pos">ŧ c1-stamp-string-pos</link></code> <code><link linkend="template-c1-stamp-string-length">ŧ c1-stamp-string-length</link></code> <code><link linkend="variable-self-leaf-div-flatref-duplicates">$self-leaf-div-flatref-duplicates</link></code> <code><link linkend="function-normalize-text">tan:normalize-text</link></code> <code><link linkend="function-has-relationship">tan:has-relationship</link></code> <code><link linkend="variable-self-prepped">$self-prepped</link></code> <code><link linkend="function-merge-sources">tan:merge-sources</link></code> <code><link linkend="function-raw-diff">tan:raw-diff</link></code> <code><link linkend="function-text-join">tan:text-join</link></code> <code><link linkend="function-prep-resolved-class-1-doc">tan:prep-resolved-class-1-doc</link></code> <code><link linkend="function-get-1st-doc">tan:get-1st-doc</link></code> <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> .</para></section><section xml:id="template-class-2-errors"><title><code>ŧ class-2-errors</code></title><para>3 elements: <code>TAN-class-2-errors.xsl </code></para><para>Used by template <code><link linkend="template-class-2-errors">ŧ class-2-errors</link></code> <code><link linkend="template-class-2-errors">ŧ class-2-errors</link></code> <code><link linkend="template-class-2-errors">ŧ class-2-errors</link></code></para><para>Used by function <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>()</para><para>Relies upon <code><link linkend="function-group-tok-elements">tan:group-tok-elements</link></code> <code><link linkend="function-error">tan:error</link></code> <code><link linkend="template-class-2-errors">ŧ class-2-errors</link></code> .</para></section><section xml:id="template-compare-copies"><title><code>ŧ compare-copies</code></title><para>2 elements: <code>TAN-class-1-functions.xsl </code></para><para>Used by template <code><link linkend="template-mark-splits">ŧ mark-splits</link></code></para><para>Used by function <code><link linkend="function-compare-copies">tan:compare-copies</link></code>() <code><link linkend="function-mark-splits">tan:mark-splits</link></code>()</para><para>Relies upon <code><link linkend="function-escape">tan:escape</link></code> <code><link linkend="function-normalize-div-text">tan:normalize-div-text</link></code> .</para></section><section xml:id="template-convert-code-to-features"><title><code>ŧ convert-code-to-features</code></title><para>2 elements: <code>TAN-LM-functions.xsl </code></para><para>Used by function <code><link linkend="function-expand-per-lm">tan:expand-per-lm</link></code>() <code><link linkend="function-convert-code-to-features">tan:convert-code-to-features</link></code>()</para><para>Relies upon <code><link linkend="variable-morphologies-prepped">$morphologies-prepped</link></code> .</para></section><section xml:id="template-copy-of-except"><title><code>ŧ copy-of-except</code></title><para>2 elements: <code>TAN-core-functions.xsl </code></para><para>Used by template <code><link linkend="template-strip-all-attributes-except">ŧ strip-all-attributes-except</link></code> <code><link linkend="template-strip-specific-attributes">ŧ strip-specific-attributes</link></code> <code><link linkend="template-strip-text">ŧ strip-text</link></code></para><para>Used by function <code><link linkend="function-div-to-div-transfer">tan:div-to-div-transfer</link></code>() <code><link linkend="function-copy-of-except">tan:copy-of-except</link></code>() <code><link linkend="function-stamp-id">tan:stamp-id</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-core-attribute-errors"><title><code>ŧ core-attribute-errors</code></title><para>3 elements: <code>TAN-core-errors.xsl </code></para><para>Used by variable <code><link linkend="variable-self-class-1-errors-marked">$self-class-1-errors-marked</link></code> <code><link linkend="variable-self-core-errors-marked">$self-core-errors-marked</link></code></para><para>Used by template <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-attribute-errors">ŧ core-attribute-errors</link></code> <code><link linkend="template-referenced-doc-errors">ŧ referenced-doc-errors</link></code></para><para>Relies upon <code><link linkend="variable-duplicate-ids">$duplicate-ids</link></code> <code><link linkend="template-core-attribute-errors">ŧ core-attribute-errors</link></code> <code><link linkend="function-dateTime-to-decimal">tan:dateTime-to-decimal</link></code> <code><link linkend="function-error">tan:error</link></code> <code><link linkend="variable-doc-uri">$doc-uri</link></code> <code><link linkend="function-uri-relative-to">tan:uri-relative-to</link></code> <code><link linkend="variable-now">$now</link></code> <code><link linkend="variable-all-ids">$all-ids</link></code> <code><link linkend="function-fix">tan:fix</link></code> <code><link linkend="function-help">tan:help</link></code> <code><link linkend="variable-head">$head</link></code> <code><link linkend="function-normalize-text">tan:normalize-text</link></code> <code><link linkend="variable-id-idrefs">$id-idrefs</link></code> <code><link linkend="function-help-requested">tan:help-requested</link></code> .</para></section><section xml:id="template-core-errors"><title><code>ŧ core-errors</code></title><para>11 elements: <code>TAN-core-errors.xsl </code></para><para>Used by variable <code><link linkend="variable-self-class-1-errors-marked">$self-class-1-errors-marked</link></code> <code><link linkend="variable-self-core-errors-marked">$self-core-errors-marked</link></code></para><para>Used by template <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-class-1-copy-errors">ŧ class-1-copy-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-referenced-doc-errors">ŧ referenced-doc-errors</link></code></para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="variable-sources-resolved">$sources-resolved</link></code> <code><link linkend="variable-root">$root</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="variable-duplicate-iris">$duplicate-iris</link></code> <code><link linkend="function-must-refer-to-external-tan-file">tan:must-refer-to-external-tan-file</link></code> <code><link linkend="variable-doc-namespace">$doc-namespace</link></code> <code><link linkend="variable-primary-agent">$primary-agent</link></code> <code><link linkend="function-idrefs">tan:idrefs</link></code> <code><link linkend="function-info">tan:info</link></code> <code><link linkend="variable-doc-id">$doc-id</link></code> <code><link linkend="variable-head">$head</link></code> <code><link linkend="function-normalize-text">tan:normalize-text</link></code> <code><link linkend="variable-keys-1st-da">$keys-1st-da</link></code> <code><link linkend="function-dateTime-to-decimal">tan:dateTime-to-decimal</link></code> <code><link linkend="function-get-doc-hist">tan:get-doc-hist</link></code> <code><link linkend="function-has-relationship">tan:has-relationship</link></code> <code><link linkend="variable-empty-doc">$empty-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> <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code> <code><link linkend="variable-see-alsos-resolved">$see-alsos-resolved</link></code> <code><link linkend="variable-regex-characters-not-permitted">$regex-characters-not-permitted</link></code> <code><link linkend="variable-keys-resolved">$keys-resolved</link></code> <code><link linkend="variable-inclusions-resolved">$inclusions-resolved</link></code> <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code> <code><link linkend="variable-doc-uri">$doc-uri</link></code> .</para></section><section xml:id="template-count-tokenized-class-1"><title><code>ŧ count-tokenized-class-1</code></title><para>2 elements: <code>TAN-A-div-functions.xsl </code></para><para>Used by template <code><link linkend="template-count-tokenized-class-1">ŧ count-tokenized-class-1</link></code> <code><link linkend="template-count-tokenized-class-1">ŧ count-tokenized-class-1</link></code></para><para>Used by function <code><link linkend="function-get-src-1st-da-statted">tan:get-src-1st-da-statted</link></code>()</para><para>Relies upon <code><link linkend="template-count-tokenized-class-1">ŧ count-tokenized-class-1</link></code> .</para></section><section xml:id="template-count-tokens"><title><code>ŧ count-tokens</code></title><para>3 elements: <code>TAN-core-functions.xsl </code></para><para>Used by function <code><link linkend="function-tokenize-leaf-div">tan:tokenize-leaf-div</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-cull-prepped-class-1"><title><code>ŧ cull-prepped-class-1</code></title><para>1 element: <code>TAN-class-2-functions.xsl </code></para><para>Used by function <code><link linkend="function-cull-prepped-class-1-data">tan:cull-prepped-class-1-data</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-diff-rectify"><title><code>ŧ diff-rectify</code></title><para>3 elements: <code>diff-for-xslt2.xsl </code></para><para>Used by template <code><link linkend="template-diff-rectify">ŧ diff-rectify</link></code></para><para>Used by function <code><link linkend="function-diff-loop">tan:diff-loop</link></code>()</para><para>Relies upon <code><link linkend="template-diff-rectify">ŧ diff-rectify</link></code> .</para></section><section xml:id="template-drop-tokenization"><title><code>ŧ drop-tokenization</code></title><para>3 elements: <code>TAN-A-div-functions.xsl </code></para><para>Used by function <code><link linkend="function-merge-tan-a-div-prepped">tan:merge-tan-a-div-prepped</link></code>() <code><link linkend="function-remodel-div-ref">tan:remodel-div-ref</link></code>() <code><link linkend="function-process-splits">tan:process-splits</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-expand-lm"><title><code>ŧ expand-lm</code></title><para>2 elements: <code>TAN-LM-functions.xsl </code></para><para>Used by function <code><link linkend="function-expand-per-lm">tan:expand-per-lm</link></code>() <code><link linkend="function-convert-code-to-features">tan:convert-code-to-features</link></code>()</para><para>Relies upon <code><link linkend="function-get-lm-ids">tan:get-lm-ids</link></code> .</para></section><section xml:id="template-first-stamp"><title><code>ŧ first-stamp</code></title><para>2 elements: <code>TAN-core-functions.xsl </code></para><para> The first-stamp mode ensures that when a document is handed over to a variable,</para><para>      the original document URI is not lost. It also provides (1) the breadcrumbing service, so that</para><para>      errors occurring downstream, in an inclusion or TAN-key file can be diagnosed, and (2) the option</para><para>      for <code><link linkend="attribute-src">@src</link></code> to be imprinted on the root element, so that a class 1 TAN file can be tethered to a </para><para>      class 2 file that uses it as a source.</para><para>Used by function <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>()</para><para>Relies upon <code><link linkend="function-base-uri">tan:base-uri</link></code> .</para></section><section xml:id="template-fragment-to-text"><title><code>ŧ fragment-to-text</code></title><para>3 elements: <code>TAN-core-errors.xsl </code></para><para>Used by function <code><link linkend="function-fragment-to-text">tan:fragment-to-text</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-get-div-hierarchy-fragment"><title><code>ŧ get-div-hierarchy-fragment</code></title><para>4 elements: <code>TAN-class-2-functions.xsl </code></para><para>Used by template <code><link linkend="template-insert-seg-into-leaf-divs-in-hierarchy-fragment">ŧ insert-seg-into-leaf-divs-in-hierarchy-fragment</link></code> <code><link linkend="template-prep-class-2-doc-pass-2">ŧ prep-class-2-doc-pass-2</link></code> <code><link linkend="template-get-div-hierarchy-fragment">ŧ get-div-hierarchy-fragment</link></code></para><para>Used by function <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>() <code><link linkend="function-expand-src-and-div-type-ref">tan:expand-src-and-div-type-ref</link></code>() <code><link linkend="function-prep-class-2-doc-pass-2">tan:prep-class-2-doc-pass-2</link></code>() <code><link linkend="function-prep-class-2-doc-pass-3">tan:prep-class-2-doc-pass-3</link></code>() <code><link linkend="function-prep-class-2-doc-pass-4">tan:prep-class-2-doc-pass-4</link></code>()</para><para>Relies upon <code><link linkend="template-get-div-hierarchy-fragment">ŧ get-div-hierarchy-fragment</link></code> .</para></section><section xml:id="template-get-mismatched-text"><title><code>ŧ get-mismatched-text</code></title><para>2 elements: <code>TAN-class-1-functions.xsl </code></para><para>Used by template <code><link linkend="template-mark-splits">ŧ mark-splits</link></code></para><para>Used by function <code><link linkend="function-compare-copies">tan:compare-copies</link></code>() <code><link linkend="function-mark-splits">tan:mark-splits</link></code>()</para><para>Relies upon <code><link linkend="function-normalize-div-text">tan:normalize-div-text</link></code> <code><link linkend="function-flatref">tan:flatref</link></code> .</para></section><section xml:id="template-include"><title><code>ŧ include</code></title><para>1 element: <code>TAN-core-functions.xsl </code></para><para>Used by variable <code><link linkend="variable-self-prepped">$self-prepped</link></code> <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code> <code><link linkend="variable-keys-prepped">$keys-prepped</link></code></para><para>Used by template <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code> <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code></para><para>Used by function <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>() <code><link linkend="function-glossary">tan:glossary</link></code>() <code><link linkend="function-strip-duplicates">tan:strip-duplicates</link></code>() <code><link linkend="function-resolve-keyword">tan:resolve-keyword</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-infuse-tokenized-div"><title><code>ŧ infuse-tokenized-div</code></title><para>2 elements: <code>TAN-class-1-and-2-functions.xsl </code></para><para>Used by template <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code></para><para>Used by function <code><link linkend="function-remodel-div-ref">tan:remodel-div-ref</link></code>() <code><link linkend="function-div-to-div-transfer">tan:div-to-div-transfer</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-infuse-tokenized-text"><title><code>ŧ infuse-tokenized-text</code></title><para>2 elements: <code>TAN-class-1-and-2-functions.xsl </code></para><para>Used by template <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code></para><para>Used by function <code><link linkend="function-remodel-div-ref">tan:remodel-div-ref</link></code>() <code><link linkend="function-div-to-div-transfer">tan:div-to-div-transfer</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-insert-seg-into-leaf-divs-in-hierarchy-fragment"><title><code>ŧ insert-seg-into-leaf-divs-in-hierarchy-fragment</code></title><para>4 elements: <code>TAN-A-div-functions.xsl </code><code>TAN-class-2-functions.xsl </code></para><para>Used by template <code><link linkend="template-insert-seg-into-leaf-divs-in-hierarchy-fragment">ŧ insert-seg-into-leaf-divs-in-hierarchy-fragment</link></code></para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-sequence-expand">tan:sequence-expand</link></code> <code><link linkend="template-insert-seg-into-leaf-divs-in-hierarchy-fragment">ŧ insert-seg-into-leaf-divs-in-hierarchy-fragment</link></code> .</para></section><section xml:id="template-mark-splits"><title><code>ŧ mark-splits</code></title><para>2 elements: <code>TAN-class-1-functions.xsl </code></para><para>Used by template <code><link linkend="template-mark-splits">ŧ mark-splits</link></code></para><para>Used by function <code><link linkend="function-compare-copies">tan:compare-copies</link></code>() <code><link linkend="function-mark-splits">tan:mark-splits</link></code>()</para><para>Relies upon <code><link linkend="template-mark-splits">ŧ mark-splits</link></code> .</para></section><section xml:id="template-mark-splits-in-fragment"><title><code>ŧ mark-splits-in-fragment</code></title><para>3 elements: <code>TAN-A-div-functions.xsl </code></para><para>Used by function <code><link linkend="function-merge-tan-a-div-prepped">tan:merge-tan-a-div-prepped</link></code>() <code><link linkend="function-remodel-div-ref">tan:remodel-div-ref</link></code>() <code><link linkend="function-process-splits">tan:process-splits</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-mark-tok-chars"><title><code>ŧ mark-tok-chars</code></title><para>2 elements: <code>TAN-class-2-functions.xsl </code></para><para>Used by function <code><link linkend="function-expand-tok">tan:expand-tok</link></code>()</para><para>Relies upon <code><link linkend="function-chop-string">tan:chop-string</link></code> <code><link linkend="function-sequence-expand">tan:sequence-expand</link></code> <code><link linkend="function-sequence-error">tan:sequence-error</link></code> .</para></section><section xml:id="template-normalize-space"><title><code>ŧ normalize-space</code></title><para>2 elements: <code>TAN-class-1-functions.xsl </code></para><para>Used by function <code><link linkend="function-normalize-doc-space">tan:normalize-doc-space</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-pick-prepped-class-1"><title><code>ŧ pick-prepped-class-1</code></title><para>1 element: <code>TAN-class-2-functions.xsl </code></para><para>Used by function <code><link linkend="function-pick-prepped-class-1-data">tan:pick-prepped-class-1-data</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><para>3 elements: <code>TAN-core-functions.xsl </code></para><para>Used by function <code><link linkend="function-pluck">tan:pluck</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-prep-class-1"><title><code>ŧ prep-class-1</code></title><para>8 elements: <code>TAN-class-1-and-2-functions.xsl </code></para><para> Homogenize tei:TEI to tan:TAN-T </para><para> Makes sure the tei:body rises rootward one level, as is customary in TAN and HTML </para><para>Used by function <code><link linkend="function-prep-resolved-class-1-doc">tan:prep-resolved-class-1-doc</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-arabic-numerals">tan:arabic-numerals</link></code> <code><link linkend="function-help">tan:help</link></code> <code><link linkend="function-help-requested">tan:help-requested</link></code> <code><link linkend="function-normalize-text">tan:normalize-text</link></code> .</para></section><section xml:id="template-prep-class-2-doc-pass-1"><title><code>ŧ prep-class-2-doc-pass-1</code></title><para>6 elements: <code>TAN-class-2-functions.xsl </code></para><para> This template takes an element that allows <code><link linkend="attribute-src">@src</link></code>, supplies it if it doesn't exist, then iterates that element across multiple values of <code><link linkend="attribute-src">@src</link></code>; this excludes elements that use <code><link linkend="attribute-work">@work</link></code>, i.e., <code><link linkend="element-div-ref">&lt;div-ref&gt;</link></code>, which are resolved only after works are equated and resolved </para><para>Used by template <code><link linkend="template-insert-seg-into-leaf-divs-in-hierarchy-fragment">ŧ insert-seg-into-leaf-divs-in-hierarchy-fragment</link></code> <code><link linkend="template-prep-class-2-doc-pass-2">ŧ prep-class-2-doc-pass-2</link></code> <code><link linkend="template-get-div-hierarchy-fragment">ŧ get-div-hierarchy-fragment</link></code></para><para>Used by function <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>() <code><link linkend="function-expand-src-and-div-type-ref">tan:expand-src-and-div-type-ref</link></code>() <code><link linkend="function-prep-class-2-doc-pass-2">tan:prep-class-2-doc-pass-2</link></code>() <code><link linkend="function-prep-class-2-doc-pass-3">tan:prep-class-2-doc-pass-3</link></code>() <code><link linkend="function-prep-class-2-doc-pass-4">tan:prep-class-2-doc-pass-4</link></code>()</para><para>Relies upon <code><link linkend="function-normalize-text">tan:normalize-text</link></code> <code><link linkend="function-help-requested">tan:help-requested</link></code> <code><link linkend="function-help">tan:help</link></code> .</para></section><section xml:id="template-prep-class-2-doc-pass-2"><title><code>ŧ prep-class-2-doc-pass-2</code></title><para>6 elements: <code>TAN-class-2-functions.xsl </code></para><para>&lt;xsl:param name="src-docs" as="<code>document-node(</code>)*" tunnel="yes"/&gt;</para><para>Used by template <code><link linkend="template-insert-seg-into-leaf-divs-in-hierarchy-fragment">ŧ insert-seg-into-leaf-divs-in-hierarchy-fragment</link></code> <code><link linkend="template-prep-class-2-doc-pass-2">ŧ prep-class-2-doc-pass-2</link></code> <code><link linkend="template-get-div-hierarchy-fragment">ŧ get-div-hierarchy-fragment</link></code></para><para>Used by function <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>() <code><link linkend="function-expand-src-and-div-type-ref">tan:expand-src-and-div-type-ref</link></code>() <code><link linkend="function-prep-class-2-doc-pass-2">tan:prep-class-2-doc-pass-2</link></code>() <code><link linkend="function-prep-class-2-doc-pass-3">tan:prep-class-2-doc-pass-3</link></code>() <code><link linkend="function-prep-class-2-doc-pass-4">tan:prep-class-2-doc-pass-4</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="template-prep-class-2-doc-pass-2">ŧ prep-class-2-doc-pass-2</link></code> <code><link linkend="function-get-n-types">tan:get-n-types</link></code> <code><link linkend="function-help">tan:help</link></code> <code><link linkend="function-help-requested">tan:help-requested</link></code> <code><link linkend="function-normalize-text">tan:normalize-text</link></code> .</para></section><section xml:id="template-prep-class-2-doc-pass-3"><title><code>ŧ prep-class-2-doc-pass-3</code></title><para>3 elements: <code>TAN-class-2-functions.xsl </code></para><para>Used by template <code><link linkend="template-insert-seg-into-leaf-divs-in-hierarchy-fragment">ŧ insert-seg-into-leaf-divs-in-hierarchy-fragment</link></code> <code><link linkend="template-prep-class-2-doc-pass-2">ŧ prep-class-2-doc-pass-2</link></code> <code><link linkend="template-get-div-hierarchy-fragment">ŧ get-div-hierarchy-fragment</link></code></para><para>Used by function <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>() <code><link linkend="function-expand-src-and-div-type-ref">tan:expand-src-and-div-type-ref</link></code>() <code><link linkend="function-prep-class-2-doc-pass-2">tan:prep-class-2-doc-pass-2</link></code>() <code><link linkend="function-prep-class-2-doc-pass-3">tan:prep-class-2-doc-pass-3</link></code>() <code><link linkend="function-prep-class-2-doc-pass-4">tan:prep-class-2-doc-pass-4</link></code>()</para><para>Relies upon <code><link linkend="function-normalize-text">tan:normalize-text</link></code> <code><link linkend="function-help-requested">tan:help-requested</link></code> <code><link linkend="function-convert-ref-to-div-fragment">tan:convert-ref-to-div-fragment</link></code> .</para></section><section xml:id="template-prep-class-2-doc-pass-3-old"><title><code>ŧ prep-class-2-doc-pass-3-old</code></title><para>2 elements: <code>TAN-class-2-functions.xsl </code></para><para>Used by template <code><link linkend="template-insert-seg-into-leaf-divs-in-hierarchy-fragment">ŧ insert-seg-into-leaf-divs-in-hierarchy-fragment</link></code> <code><link linkend="template-prep-class-2-doc-pass-2">ŧ prep-class-2-doc-pass-2</link></code> <code><link linkend="template-get-div-hierarchy-fragment">ŧ get-div-hierarchy-fragment</link></code></para><para>Used by function <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>() <code><link linkend="function-expand-src-and-div-type-ref">tan:expand-src-and-div-type-ref</link></code>() <code><link linkend="function-prep-class-2-doc-pass-2">tan:prep-class-2-doc-pass-2</link></code>() <code><link linkend="function-prep-class-2-doc-pass-3">tan:prep-class-2-doc-pass-3</link></code>() <code><link linkend="function-prep-class-2-doc-pass-4">tan:prep-class-2-doc-pass-4</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-prep-class-2-doc-pass-4"><title><code>ŧ prep-class-2-doc-pass-4</code></title><para>3 elements: <code>TAN-class-2-functions.xsl </code></para><para>Used by template <code><link linkend="template-insert-seg-into-leaf-divs-in-hierarchy-fragment">ŧ insert-seg-into-leaf-divs-in-hierarchy-fragment</link></code> <code><link linkend="template-prep-class-2-doc-pass-2">ŧ prep-class-2-doc-pass-2</link></code> <code><link linkend="template-get-div-hierarchy-fragment">ŧ get-div-hierarchy-fragment</link></code></para><para>Used by function <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>() <code><link linkend="function-expand-src-and-div-type-ref">tan:expand-src-and-div-type-ref</link></code>() <code><link linkend="function-prep-class-2-doc-pass-2">tan:prep-class-2-doc-pass-2</link></code>() <code><link linkend="function-prep-class-2-doc-pass-3">tan:prep-class-2-doc-pass-3</link></code>() <code><link linkend="function-prep-class-2-doc-pass-4">tan:prep-class-2-doc-pass-4</link></code>()</para><para>Relies upon <code><link linkend="function-expand-tok">tan:expand-tok</link></code> .</para></section><section xml:id="template-prep-rim-pass-1"><title><code>ŧ prep-rim-pass-1</code></title><para>3 elements: <code>TAN-class-2-functions.xsl </code></para><para>Used by function <code><link linkend="function-get-context-prepped">tan:get-context-prepped</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-prep-rim-pass-2"><title><code>ŧ prep-rim-pass-2</code></title><para>2 elements: <code>TAN-class-2-functions.xsl </code></para><para>Used by function <code><link linkend="function-get-context-prepped">tan:get-context-prepped</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-prep-srcs-verbosely"><title><code>ŧ prep-srcs-verbosely</code></title><para>1 element: <code>TAN-A-div-functions.xsl </code></para><para>Used by template <code><link linkend="template-prep-verbosely">ŧ prep-verbosely</link></code> prep-srcs-verbosely</para><para>Used by function <code><link linkend="function-prep-verbosely">tan:prep-verbosely</link></code>()</para><para>Relies upon <code><link linkend="template-prep-verbosely">ŧ prep-verbosely</link></code> .</para></section><section xml:id="template-prep-tan-a-div-pass-3-prelim"><title><code>ŧ prep-tan-a-div-pass-3-prelim</code></title><para>2 elements: <code>TAN-class-2-functions.xsl </code></para><para>Used by template <code><link linkend="template-insert-seg-into-leaf-divs-in-hierarchy-fragment">ŧ insert-seg-into-leaf-divs-in-hierarchy-fragment</link></code> <code><link linkend="template-prep-class-2-doc-pass-2">ŧ prep-class-2-doc-pass-2</link></code> <code><link linkend="template-get-div-hierarchy-fragment">ŧ get-div-hierarchy-fragment</link></code></para><para>Used by function <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>() <code><link linkend="function-expand-src-and-div-type-ref">tan:expand-src-and-div-type-ref</link></code>() <code><link linkend="function-prep-class-2-doc-pass-2">tan:prep-class-2-doc-pass-2</link></code>() <code><link linkend="function-prep-class-2-doc-pass-3">tan:prep-class-2-doc-pass-3</link></code>() <code><link linkend="function-prep-class-2-doc-pass-4">tan:prep-class-2-doc-pass-4</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-prep-tan-a-div-pass-a"><title><code>ŧ prep-tan-a-div-pass-a</code></title><para>7 elements: <code>TAN-A-div-functions.xsl </code></para><para> goal: flag errors in <code><link linkend="attribute-seg">@seg</link></code>; if it's a <code><link linkend="element-realign">&lt;realign&gt;</link></code>, make a copy of the entire <code><link linkend="element-div">&lt;div&gt;</link></code> </para><para> We make a copy of the referenced <code><link linkend="element-div">&lt;div&gt;</link></code> only if it is a <code><link linkend="element-realign">&lt;realign&gt;</link></code>, so that we can save work for a later process that adjusts the sources </para><para>Used by function <code><link linkend="function-prep-resolved-tan-a-div-doc">tan:prep-resolved-tan-a-div-doc</link></code>() <code><link linkend="function-get-src-1st-da-segmented">tan:get-src-1st-da-segmented</link></code>()</para><para>Relies upon <code><link linkend="function-help">tan:help</link></code> <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-help-requested">tan:help-requested</link></code> <code><link linkend="function-sequence-error">tan:sequence-error</link></code> <code><link linkend="function-sequence-expand">tan:sequence-expand</link></code> .</para></section><section xml:id="template-prep-tan-a-div-pass-b"><title><code>ŧ prep-tan-a-div-pass-b</code></title><para>2 elements: <code>TAN-A-div-functions.xsl </code></para><para> Goal: redistribute contents of aligns and realigns </para><para>Used by function <code><link linkend="function-prep-resolved-tan-a-div-doc">tan:prep-resolved-tan-a-div-doc</link></code>() <code><link linkend="function-get-src-1st-da-segmented">tan:get-src-1st-da-segmented</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-value-of">tan:value-of</link></code> .</para></section><section xml:id="template-prep-tan-claims"><title><code>ŧ prep-tan-claims</code></title><para>3 elements: <code>TAN-class-2-and-3-functions.xsl </code></para><para>Used by variable <code><link linkend="variable-self-prepped">$self-prepped</link></code></para><para>Used by template <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code></para><para>Used by function <code><link linkend="function-prep-TAN-claims">tan:prep-TAN-claims</link></code>() <code><link linkend="function-prep-TAN-mor">tan:prep-TAN-mor</link></code>()</para><para>Relies upon <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-data-type-check">tan:data-type-check</link></code> .</para></section><section xml:id="template-prep-tan-key"><title><code>ŧ prep-tan-key</code></title><para>2 elements: <code>TAN-core-functions.xsl </code></para><para>Used by variable <code><link linkend="variable-self-prepped">$self-prepped</link></code> <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code> <code><link linkend="variable-keys-prepped">$keys-prepped</link></code></para><para>Used by template <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code> <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code></para><para>Used by function <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>() <code><link linkend="function-glossary">tan:glossary</link></code>() <code><link linkend="function-strip-duplicates">tan:strip-duplicates</link></code>() <code><link linkend="function-resolve-keyword">tan:resolve-keyword</link></code>()</para><para>Relies upon <code><link linkend="function-normalize-text">tan:normalize-text</link></code> .</para></section><section xml:id="template-prep-tan-lm"><title><code>ŧ prep-tan-lm</code></title><para>3 elements: <code>TAN-LM-functions.xsl </code></para><para>Used by template <code><link linkend="template-prep-tan-lm">ŧ prep-tan-lm</link></code></para><para>Used by function <code><link linkend="function-prep-TAN-LM-doc-prepped">tan:prep-TAN-LM-doc-prepped</link></code>()</para><para>Relies upon <code><link linkend="variable-morphologies-prepped">$morphologies-prepped</link></code> <code><link linkend="template-prep-tan-lm">ŧ prep-tan-lm</link></code> <code><link linkend="function-normalize-text">tan:normalize-text</link></code> <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-obeyed-by-m">tan:obeyed-by-m</link></code> <code><link linkend="function-help-requested">tan:help-requested</link></code> <code><link linkend="function-escape">tan:escape</link></code> .</para></section><section xml:id="template-prep-tan-mor"><title><code>ŧ prep-tan-mor</code></title><para>4 elements: <code>TAN-class-2-and-3-functions.xsl </code></para><para>Used by variable <code><link linkend="variable-self-prepped">$self-prepped</link></code></para><para>Used by template <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code></para><para>Used by function <code><link linkend="function-prep-TAN-claims">tan:prep-TAN-claims</link></code>() <code><link linkend="function-prep-TAN-mor">tan:prep-TAN-mor</link></code>()</para><para>Relies upon <code><link linkend="function-normalize-text">tan:normalize-text</link></code> <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> <code><link linkend="variable-inclusions-resolved">$inclusions-resolved</link></code> <code><link linkend="function-error">tan:error</link></code> <code><link linkend="function-sequence-expand">tan:sequence-expand</link></code> <code><link linkend="function-feature-test-to-groups">tan:feature-test-to-groups</link></code> <code><link linkend="function-duplicate-values">tan:duplicate-values</link></code> .</para></section><section xml:id="template-prep-verbosely"><title><code>ŧ prep-verbosely</code></title><para>4 elements: <code>TAN-A-div-functions.xsl </code></para><para>Used by template <code><link linkend="template-prep-verbosely">ŧ prep-verbosely</link></code> prep-srcs-verbosely</para><para>Used by function <code><link linkend="function-prep-verbosely">tan:prep-verbosely</link></code>()</para><para>Relies upon <code><link linkend="function-info">tan:info</link></code> <code><link linkend="variable-sources-prepped">$sources-prepped</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="template-prep-verbosely">ŧ prep-verbosely</link></code> .</para></section><section xml:id="template-prepare-class-1-doc-for-merge"><title><code>ŧ prepare-class-1-doc-for-merge</code></title><para>7 elements: <code>TAN-class-1-and-2-functions.xsl </code></para><para> This template is long, because it deals with cases where individual <code><link linkend="element-div">&lt;div&gt;</link></code>s have been realigned by a TAN-A-div file. <code><link linkend="element-div">&lt;div&gt;</link></code>s that must be realigned are best done so in this method, since one cannot predict where in a hierarchy an anchor and anchoree are to be found </para><para>Used by function <code><link linkend="function-prep-tan-a-div-sources-for-merge">tan:prep-tan-a-div-sources-for-merge</link></code>() <code><link linkend="function-merge-sources">tan:merge-sources</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-prepend-id-or-idrefs"><title><code>ŧ prepend-id-or-idrefs</code></title><para>1 element: <code>TAN-core-functions.xsl </code></para><para>Used by function <code><link linkend="function-prepend-id-or-idrefs">tan:prepend-id-or-idrefs</link></code>()</para><para>Relies upon <code><link linkend="variable-id-idrefs">$id-idrefs</link></code> .</para></section><section xml:id="template-process-splits"><title><code>ŧ process-splits</code></title><para>3 elements: <code>TAN-A-div-functions.xsl </code></para><para>Used by function <code><link linkend="function-merge-tan-a-div-prepped">tan:merge-tan-a-div-prepped</link></code>() <code><link linkend="function-remodel-div-ref">tan:remodel-div-ref</link></code>() <code><link linkend="function-process-splits">tan:process-splits</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-realign-tan-a-div-sources"><title><code>ŧ realign-tan-a-div-sources</code></title><para>1 element: <code>TAN-A-div-functions.xsl </code></para><para>Used by function <code><link linkend="function-prep-resolved-tan-a-div-doc">tan:prep-resolved-tan-a-div-doc</link></code>() <code><link linkend="function-get-src-1st-da-segmented">tan:get-src-1st-da-segmented</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-referenced-doc-errors"><title><code>ŧ referenced-doc-errors</code></title><para>3 elements: <code>TAN-core-errors.xsl </code></para><para>Used by variable <code><link linkend="variable-self-class-1-errors-marked">$self-class-1-errors-marked</link></code> <code><link linkend="variable-self-core-errors-marked">$self-core-errors-marked</link></code></para><para>Used by template <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code> <code><link linkend="template-class-1-copy-errors">ŧ class-1-copy-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-core-errors">ŧ core-errors</link></code> <code><link linkend="template-referenced-doc-errors">ŧ referenced-doc-errors</link></code></para><para>Relies upon <code><link linkend="variable-errors">$errors</link></code> <code><link linkend="template-referenced-doc-errors">ŧ referenced-doc-errors</link></code> .</para></section><section xml:id="template-resolve-attr-include"><title><code>ŧ resolve-attr-include</code></title><para>2 elements: <code>TAN-core-functions.xsl </code></para><para>Used by variable <code><link linkend="variable-self-prepped">$self-prepped</link></code> <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code> <code><link linkend="variable-keys-prepped">$keys-prepped</link></code></para><para>Used by template <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code> <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code></para><para>Used by function <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>() <code><link linkend="function-glossary">tan:glossary</link></code>() <code><link linkend="function-strip-duplicates">tan:strip-duplicates</link></code>() <code><link linkend="function-resolve-keyword">tan:resolve-keyword</link></code>()</para><para>Relies upon <code><link linkend="function-normalize-text">tan:normalize-text</link></code> <code><link linkend="function-prepend-id-or-idrefs">tan:prepend-id-or-idrefs</link></code> <code><link linkend="function-error">tan:error</link></code> .</para></section><section xml:id="template-resolve-href"><title><code>ŧ resolve-href</code></title><para>2 elements: <code>TAN-core-functions.xsl </code></para><para>Used by variable <code><link linkend="variable-self-prepped">$self-prepped</link></code> <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code> <code><link linkend="variable-keys-prepped">$keys-prepped</link></code></para><para>Used by template <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code> <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code></para><para>Used by function <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>() <code><link linkend="function-glossary">tan:glossary</link></code>() <code><link linkend="function-strip-duplicates">tan:strip-duplicates</link></code>() <code><link linkend="function-resolve-keyword">tan:resolve-keyword</link></code>()</para><para>Relies upon <code><link linkend="function-base-uri">tan:base-uri</link></code> .</para></section><section xml:id="template-resolve-keyword"><title><code>ŧ resolve-keyword</code></title><para>2 elements: <code>TAN-core-functions.xsl </code></para><para>Used by variable <code><link linkend="variable-self-prepped">$self-prepped</link></code> <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code> <code><link linkend="variable-keys-prepped">$keys-prepped</link></code></para><para>Used by template <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code> <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code></para><para>Used by function <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>() <code><link linkend="function-glossary">tan:glossary</link></code>() <code><link linkend="function-strip-duplicates">tan:strip-duplicates</link></code>() <code><link linkend="function-resolve-keyword">tan:resolve-keyword</link></code>()</para><para>Relies upon <code><link linkend="function-normalize-text">tan:normalize-text</link></code> <code><link linkend="function-error">tan:error</link></code> <code><link linkend="variable-help-trigger-regex">$help-trigger-regex</link></code> <code><link linkend="function-help">tan:help</link></code> <code><link linkend="function-glossary">tan:glossary</link></code> .</para></section><section xml:id="template-segment-tokd-prepped-class-1"><title><code>ŧ segment-tokd-prepped-class-1</code></title><para>2 elements: <code>TAN-A-div-functions.xsl </code></para><para>Used by function <code><link linkend="function-prep-resolved-tan-a-div-doc">tan:prep-resolved-tan-a-div-doc</link></code>() <code><link linkend="function-get-src-1st-da-segmented">tan:get-src-1st-da-segmented</link></code>()</para><para>Relies upon <code><link linkend="function-duplicate-values">tan:duplicate-values</link></code> <code><link linkend="function-error">tan:error</link></code> .</para></section><section xml:id="template-snap-to-word-pass-1"><title><code>ŧ snap-to-word-pass-1</code></title><para>2 elements: <code>diff-for-xslt2.xsl </code></para><para>Used by function <code><link linkend="function-raw-diff">tan:raw-diff</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-split-marked-fragment"><title><code>ŧ split-marked-fragment</code></title><para>1 element: <code>TAN-A-div-functions.xsl </code></para><para>No variables, keys, functions, or named templates depend upon this xsl:template.</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-stamp-element-id"><title><code>ŧ stamp-element-id</code></title><para>2 elements: <code>TAN-core-functions.xsl </code></para><para>Used by template <code><link linkend="template-strip-all-attributes-except">ŧ strip-all-attributes-except</link></code> <code><link linkend="template-strip-specific-attributes">ŧ strip-specific-attributes</link></code> <code><link linkend="template-strip-text">ŧ strip-text</link></code></para><para>Used by function <code><link linkend="function-div-to-div-transfer">tan:div-to-div-transfer</link></code>() <code><link linkend="function-copy-of-except">tan:copy-of-except</link></code>() <code><link linkend="function-stamp-id">tan:stamp-id</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-strip-all-attributes-except"><title><code>ŧ strip-all-attributes-except</code></title><para>2 elements: <code>TAN-core-functions.xsl </code></para><para>Used by template <code><link linkend="template-strip-all-attributes-except">ŧ strip-all-attributes-except</link></code> <code><link linkend="template-strip-specific-attributes">ŧ strip-specific-attributes</link></code> <code><link linkend="template-strip-text">ŧ strip-text</link></code></para><para>Used by function <code><link linkend="function-div-to-div-transfer">tan:div-to-div-transfer</link></code>() <code><link linkend="function-copy-of-except">tan:copy-of-except</link></code>() <code><link linkend="function-stamp-id">tan:stamp-id</link></code>()</para><para>Relies upon <code><link linkend="template-strip-all-attributes-except">ŧ strip-all-attributes-except</link></code> .</para></section><section xml:id="template-strip-duplicates"><title><code>ŧ strip-duplicates</code></title><para>2 elements: <code>TAN-core-functions.xsl </code></para><para>Used by variable <code><link linkend="variable-self-prepped">$self-prepped</link></code> <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code> <code><link linkend="variable-keys-prepped">$keys-prepped</link></code></para><para>Used by template <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code> <code><link linkend="template-arabic-numerals">ŧ arabic-numerals</link></code></para><para>Used by function <code><link linkend="function-resolve-doc">tan:resolve-doc</link></code>() <code><link linkend="function-glossary">tan:glossary</link></code>() <code><link linkend="function-strip-duplicates">tan:strip-duplicates</link></code>() <code><link linkend="function-resolve-keyword">tan:resolve-keyword</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-strip-specific-attributes"><title><code>ŧ strip-specific-attributes</code></title><para>2 elements: <code>TAN-core-functions.xsl </code></para><para>Used by template <code><link linkend="template-strip-all-attributes-except">ŧ strip-all-attributes-except</link></code> <code><link linkend="template-strip-specific-attributes">ŧ strip-specific-attributes</link></code> <code><link linkend="template-strip-text">ŧ strip-text</link></code></para><para>Used by function <code><link linkend="function-div-to-div-transfer">tan:div-to-div-transfer</link></code>() <code><link linkend="function-copy-of-except">tan:copy-of-except</link></code>() <code><link linkend="function-stamp-id">tan:stamp-id</link></code>()</para><para>Relies upon <code><link linkend="template-strip-specific-attributes">ŧ strip-specific-attributes</link></code> .</para></section><section xml:id="template-strip-text"><title><code>ŧ strip-text</code></title><para>2 elements: <code>TAN-core-functions.xsl </code></para><para>Used by template <code><link linkend="template-strip-all-attributes-except">ŧ strip-all-attributes-except</link></code> <code><link linkend="template-strip-specific-attributes">ŧ strip-specific-attributes</link></code> <code><link linkend="template-strip-text">ŧ strip-text</link></code></para><para>Used by function <code><link linkend="function-div-to-div-transfer">tan:div-to-div-transfer</link></code>() <code><link linkend="function-copy-of-except">tan:copy-of-except</link></code>() <code><link linkend="function-stamp-id">tan:stamp-id</link></code>()</para><para>Relies upon <code><link linkend="template-strip-text">ŧ strip-text</link></code> .</para></section><section xml:id="template-synthesize-merged-sources"><title><code>ŧ synthesize-merged-sources</code></title><para>3 elements: <code>TAN-class-1-and-2-functions.xsl </code></para><para>Used by template <code><link linkend="template-synthesize-merged-sources">ŧ synthesize-merged-sources</link></code></para><para>Used by function <code><link linkend="function-merge-source-loop">tan:merge-source-loop</link></code>()</para><para>Relies upon <code><link linkend="function-synthesize-merged-group">tan:synthesize-merged-group</link></code> <code><link linkend="template-synthesize-merged-sources">ŧ synthesize-merged-sources</link></code> .</para></section><section xml:id="template-TAN-A-div-errors"><title><code>ŧ TAN-A-div-errors</code></title><para>4 elements: <code>TAN-A-div-errors.xsl </code></para><para>Used by template <code><link linkend="template-TAN-A-div-errors">ŧ TAN-A-div-errors</link></code></para><para>Used by function <code><link linkend="function-prep-resolved-tan-a-div-doc">tan:prep-resolved-tan-a-div-doc</link></code>()</para><para>Relies upon <code><link linkend="function-group-tok-elements">tan:group-tok-elements</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="template-TAN-A-div-errors">ŧ TAN-A-div-errors</link></code> .</para></section><section xml:id="template-tan-a-div-merge-pass1"><title><code>ŧ tan-a-div-merge-pass1</code></title><para>4 elements: <code>TAN-A-div-functions.xsl </code></para><para> We assume that the user of the resultant file wants little or no recourse to the original source files, so we add select metadata </para><para>Used by function <code><link linkend="function-merge-tan-a-div-prepped">tan:merge-tan-a-div-prepped</link></code>() <code><link linkend="function-remodel-div-ref">tan:remodel-div-ref</link></code>() <code><link linkend="function-process-splits">tan:process-splits</link></code>()</para><para>Does not rely upon global variables, keys, functions, or templates.</para></section><section xml:id="template-tan-key-errors"><title><code>ŧ tan-key-errors</code></title><para>6 elements: <code>TAN-key-functions.xsl </code></para><para>Used by variable <code><link linkend="variable-self-prepped">$self-prepped</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="function-error">tan:error</link></code> <code><link linkend="variable-all-body-iris">$all-body-iris</link></code> <code><link linkend="variable-TAN-namespace">$TAN-namespace</link></code> <code><link linkend="variable-TAN-keywords">$TAN-keywords</link></code> <code><link linkend="function-normalize-text">tan:normalize-text</link></code> .</para></section><section xml:id="template-tokenize-prepped-class-1"><title><code>ŧ tokenize-prepped-class-1</code></title><para>2 elements: <code>TAN-class-2-functions.xsl </code></para><para> tan:ver is part of the calculus, because of TAN-A-div merges, which require the introduction of <code>&lt;ver&gt;</code> at the leafmost parts of a document </para><para>Used by function <code><link linkend="function-remodel-div-ref">tan:remodel-div-ref</link></code>() <code><link linkend="function-get-src-1st-da-tokenized">tan:get-src-1st-da-tokenized</link></code>() <code><link linkend="function-tokenize-div">tan:tokenize-div</link></code>()</para><para>Relies upon <code><link linkend="function-copy-of-except">tan:copy-of-except</link></code> <code><link linkend="function-text-join">tan:text-join</link></code> <code><link linkend="function-tokenize-leaf-div">tan:tokenize-leaf-div</link></code> .</para></section><section xml:id="template-unconsolidate-anas"><title><code>ŧ unconsolidate-anas</code></title><para>3 elements: <code>TAN-class-2-functions.xsl </code></para><para>Used by template <code><link linkend="template-unconsolidate-anas">ŧ unconsolidate-anas</link></code></para><para>Used by function <code><link linkend="function-unconsolidate-tan-lm">tan:unconsolidate-tan-lm</link></code>()</para><para>Relies upon <code><link linkend="function-normalize-refs">tan:normalize-refs</link></code> <code><link linkend="function-sequence-expand">tan:sequence-expand</link></code> <code><link linkend="template-unconsolidate-anas">ŧ unconsolidate-anas</link></code> .</para></section></section><section><title>Cross-format global variables</title><para>Global variables that straddle different files in the TAN function
                           library.</para><section xml:id="variable-self-and-sources-prepped"><title><code>$self-and-sources-prepped</code></title><para>3 elements: <code>TAN-A-div-functions.xsl </code><code>TAN-A-tok-functions.xsl </code><code>TAN-LM-functions.xsl </code></para><para>Used by variable <code><link linkend="variable-self-and-sources-prepped">$self-and-sources-prepped</link></code> <code><link linkend="variable-self-prepped">$self-prepped</link></code> <code><link linkend="variable-sources-prepped">$sources-prepped</link></code></para><para>Used by function <code><link linkend="function-prep-resolved-tan-a-div-doc">tan:prep-resolved-tan-a-div-doc</link></code>()</para><para>Relies upon <code><link linkend="function-prep-resolved-tan-a-div-doc">tan:prep-resolved-tan-a-div-doc</link></code> <code><link linkend="variable-self-core-errors-marked">$self-core-errors-marked</link></code> <code><link linkend="variable-self-and-sources-prepped-prelim">$self-and-sources-prepped-prelim</link></code> <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code> <code><link linkend="function-prep-TAN-LM-doc-prepped">tan:prep-TAN-LM-doc-prepped</link></code> .</para></section><section xml:id="variable-self-prepped"><title><code>$self-prepped</code></title><para>7 elements: <code>TAN-A-div-functions.xsl </code><code>TAN-A-tok-functions.xsl </code><code>TAN-c-functions.xsl </code><code>TAN-key-functions.xsl </code><code>TAN-LM-functions.xsl </code><code>TAN-mor-functions.xsl </code><code>TAN-class-1-functions.xsl </code></para><para>Used by variable <code><link linkend="variable-self-leaf-div-flatrefs">$self-leaf-div-flatrefs</link></code> <code><link linkend="variable-self-class-1-errors-marked">$self-class-1-errors-marked</link></code></para><para>Used by template <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code></para><para>Relies upon <code><link linkend="variable-self-core-errors-marked">$self-core-errors-marked</link></code> <code><link linkend="template-prep-tan-mor">ŧ prep-tan-mor</link></code> <code><link linkend="variable-self-and-sources-prepped">$self-and-sources-prepped</link></code> <code><link linkend="template-tan-key-errors">ŧ tan-key-errors</link></code> <code><link linkend="template-prep-tan-key">ŧ prep-tan-key</link></code> <code><link linkend="function-prep-resolved-class-1-doc">tan:prep-resolved-class-1-doc</link></code> <code><link linkend="function-prep-TAN-claims">tan:prep-TAN-claims</link></code> .</para></section><section xml:id="variable-sources-prepped"><title><code>$sources-prepped</code></title><para>3 elements: <code>TAN-A-div-functions.xsl </code><code>TAN-A-tok-functions.xsl </code><code>TAN-LM-functions.xsl </code></para><para>Used by template <code><link linkend="template-prep-verbosely">ŧ prep-verbosely</link></code> <code><link linkend="template-prep-class-2-doc-pass-3">ŧ prep-class-2-doc-pass-3</link></code></para><para>Used by function <code><link linkend="function-merge-sources">tan:merge-sources</link></code>() <code><link linkend="function-prep-class-2-doc-pass-3">tan:prep-class-2-doc-pass-3</link></code>()</para><para>Relies upon <code><link linkend="variable-self-and-sources-prepped">$self-and-sources-prepped</link></code> .</para></section></section><section><title>Cross-format functions</title><para>Some functions are defined differently according to different TAN formats.</para><section xml:id="function-prep-resolved-class-1-doc"><title><code>tan:prep-resolved-class-1-doc()</code></title><para>2 elements: <code>TAN-class-1-and-2-functions.xsl </code><code>TAN-class-1-functions.xsl </code></para><para> Input: sequence of resolved class 1 TAN documents </para><para>         Output: sequence of documents with these changes:</para><para>         /*   - &gt;   add <code><link linkend="attribute-work">@work</link></code> = "[DIGIT TAKEN FROM TAN-A-div //tan:group[tan:work]/<code><link linkend="attribute-id">@id</link></code>]"</para><para>         tei:TEI - &gt; tan:TAN-T</para><para>         tei:text/tei:body   - &gt;   tan:body</para><para>         tei:div  - &gt;  tan:div</para><para>         &lt;div [copy of @*] ref="[NORMALIZED, FLAT REF WITH N SUBSTITUTIONS AND SUPPRESSIONS]"&gt;[COPY OF TEXT][SECOND COPY INSIDE TEI MARKUP, IF ANY]&lt;/div&gt;</para><para>         Text remains untokenized. Any <code><link linkend="element-div">&lt;div&gt;</link></code> with an <code><link linkend="attribute-n">@n</link></code> with a range will be replicated as it is, but will be followed by empty <code><link linkend="element-div">&lt;div&gt;</link></code>s with simple forms of <code><link linkend="attribute-n">@n</link></code> and a <code>@see</code> that points to the ref of the original  </para><para> The one-parameter version points to the master function kept in TAN-class-1-and-2-functions.xsl </para><para>Used by variable <code><link linkend="variable-self-prepped">$self-prepped</link></code></para><para>Used by template <code><link linkend="template-class-1-errors">ŧ class-1-errors</link></code></para><para>Used by function <code><link linkend="function-prep-resolved-class-1-doc">tan:prep-resolved-class-1-doc</link></code>() <code><link linkend="function-mark-splits">tan:mark-splits</link></code>() <code><link linkend="function-prep-resolved-class-2-doc">tan:prep-resolved-class-2-doc</link></code>() <code><link linkend="function-get-context-prepped">tan:get-context-prepped</link></code>()</para><para>Relies upon <code><link linkend="function-prep-resolved-class-1-doc">tan:prep-resolved-class-1-doc</link></code> <code><link linkend="template-prep-class-1">ŧ prep-class-1</link></code> .</para></section></section></chapter>