TAN variables, keys, functions, and templatesThe 93 global variables, 3 keys, 161 functions, and 80 templates (Ŧ = named template; ŧ = template mode) defined in the TAN function library, are the following (ʞ = key):ŧ #all tan:aaa-to-int() ŧ add-lm-to-tokŧ add-square-bracketstan:add-tok-val() ŧ add-tok-val$all-body-iris$all-function-uses-of-error$all-functions$all-ids$all-iris$all-keywordstan:all-morph-codes() $all-schema-uses-of-error$all-schemas$alphabet-numeral-keytan:ana-grouping-key() ŧ analysis-stamptan:analyze-elements-with-numeral-attributes() tan:analyze-ref() ŧ analyze-reftan:analyze-stats() tan:analyze-string-length() tan:analyze-tok-chars() $apostan:arabic-numerals() ŧ arabic-numeralstan:base-uri() tan:batch-replace() $bodyŧ c1-add-refŧ c1-stamp-string-lengthŧ c1-stamp-string-postan:cfn() $char-reg-expŧ char-setuptan:chop-string() ŧ class-1-copy-errorsŧ class-1-errorsŧ class-2-errorstan:class-number() tan:compare-copies() ŧ compare-copies$contexts-resolvedtan:convert-code-to-features() ŧ convert-code-to-featurestan:convert-ref-to-div-fragment() tan:copy-of() tan:copy-of-except() ŧ copy-of-exceptŧ core-attribute-errorsŧ core-errorsŧ count-tokenized-class-1ŧ count-tokenstan:counts-to-firsts() tan:counts-to-lasts() ŧ cull-prepped-class-1tan:cull-prepped-class-1-data() tan:data-type-check() tan:dateTime-to-decimal() tan:dec-to-hex() tan:diff() tan:diff-core() tan:diff-core-draft() tan:diff-loop() ŧ diff-rectifytan:distinct-items() tan:div-to-div-transfer() ʞ div-via-ref') $doc-id$doc-namespace$doc-parent-directory$doc-uriŧ drop-tokenization$duplicate-ids$duplicate-iristan:duplicate-values() tan:element-key() $elements-that-must-always-refer-to-tan-files$empty-doc$erroneously-looped-doctan:error() tan:error-report() $errors$errors-not-usedtan:escape() ŧ expand-lmtan:expand-m() tan:expand-per-lm() tan:expand-search() tan:expand-src-and-div-type-ref() tan:expand-tok() tan:feature-test-check() tan:feature-test-to-groups() $features-grouped$features-preppedtan:first-loc-available() ŧ first-stamptan:fix() tan:flatref() tan:fragment-to-text() ŧ fragment-to-text$function-error-idstan:get-1st-doc() tan:get-context-prepped() ŧ get-div-hierarchy-fragmenttan:get-doc-hist() tan:get-lm-ids() tan:get-matching-lm-combos() tan:get-matching-ls-or-ms() ŧ get-mismatched-texttan:get-n-types() tan:get-parent-elements() tan:get-picked-srcs-id-refs() tan:get-ref-seq() tan:get-src-1st-da() tan:get-src-1st-da-analysis-stamped() tan:get-src-1st-da-chars-picked() tan:get-src-1st-da-resolved() tan:get-src-1st-da-segmented() tan:get-src-1st-da-statted() tan:get-src-1st-da-tokenized() tan:get-src-1st-da-with-lms() tan:get-src-skeleton() tan:get-toks() tan:get-ucd-decomp() tan:get-via-q-ref() tan:glossary() tan:grc-to-int() $greek-letter-numeral-patterntan:group-adjacent-elements() tan:group-by-IRIs() tan:group-by-IRIs-loop() tan:group-tok-elements() tan:has-relationship() $headtan:help() tan:help-or-info() tan:help-requested() $help-trigger-regex$hex-keytan:hex-to-dec() $id-idrefstan:idrefs() tan:idrefs-loop() ŧ include$inclusions-1st-da$inclusions-resolvedtan:info() ŧ infuse-tokenized-divŧ infuse-tokenized-textŧ insert-seg-into-leaf-divs-in-hierarchy-fragmenttan:interpret-n-vals() ʞ item-via-node-name') $keys-1st-da$keys-prepped$keys-resolved$l-grouping-key-key$latin-letter-numeral-patterntan:letter-to-number() $m-grouping-key-keytan:mark-splits() ŧ mark-splitsŧ mark-splits-in-fragmentŧ mark-tok-charstan:matches() tan:max-integer() tan:median() tan:merge-analyzed-stats() Ŧ merge-nodestan:merge-source-loop() tan:merge-sources() tan:merge-tan-a-div-prepped() tan:min-last() $morphologies-preppedtan:most-common-value() tan:most-recent-dateTime() tan:must-refer-to-external-tan-file() $n-type$n-type-label$n-type-patterntan:no-outliers() $nonlatin-letter-numeral-patterntan:normalize-div-text() tan:normalize-doc-space() tan:normalize-refs() ŧ normalize-spacetan:normalize-text() $nowtan:number-sort() tan:number-type() tan:obeyed-by-m() tan:ordinal() tan:outliers() ŧ pick-prepped-class-1tan:pick-prepped-class-1-data() tan:pluck() ŧ pluckŧ prep-class-1ŧ prep-class-2-doc-pass-1tan:prep-class-2-doc-pass-2() ŧ prep-class-2-doc-pass-2tan:prep-class-2-doc-pass-3() ŧ prep-class-2-doc-pass-3ŧ prep-class-2-doc-pass-3-oldtan:prep-class-2-doc-pass-4() ŧ prep-class-2-doc-pass-4ŧ prep-regex-char-classtan:prep-resolved-class-1-doc() tan:prep-resolved-class-2-doc() tan:prep-resolved-tan-a-div-doc() ŧ prep-rim-pass-1ŧ prep-rim-pass-2ŧ prep-srcs-verboselyŧ prep-tan-a-div-pass-3-prelimŧ prep-tan-a-div-pass-aŧ prep-tan-a-div-pass-btan:prep-tan-a-div-sources-for-merge() tan:prep-TAN-claims() ŧ prep-tan-claimsŧ prep-tan-keyŧ prep-tan-lmtan:prep-TAN-LM-doc-prepped() tan:prep-TAN-mor() ŧ prep-tan-mortan:prep-verbosely() ŧ prep-verboselyŧ prepare-class-1-doc-for-mergetan:prepend-id-or-idrefs() ŧ prepend-id-or-idrefs$primary-agenttan:process-regex-escape-k() tan:process-splits() ŧ process-splitstan:product() tan:product-loop() ʞ q-ref') tan:q-ref() $quottan:raw-diff() tan:raw-diff-loop() ŧ realign-tan-a-div-sourcestan:rebuild-ana-fragment() tan:recombine-docs() ŧ referenced-doc-errorstan:regex() $regex-characters-not-permitted$regex-escaping-characters$relationship-keywords-for-tan-filestan:remodel-div-ref() tan:replace() ŧ resolve-attr-includetan:resolve-doc() ŧ resolve-hreftan:resolve-keyword() ŧ resolve-keyword$rng-collection$rng-collection-without-TEItan:rom-to-int() $roman-numeral-pattern$root$schema-collection$schema-error-ids$see-alsos-1st-da$see-alsos-resolvedŧ segment-tokd-prepped-class-1$self-and-sources-prepped$self-and-sources-prepped-prelim$self-class-1-errors-marked$self-core-errors-marked$self-leaf-div-flatref-duplicates$self-leaf-div-flatrefs$self-prepped$self-resolved$sep-1$sep-2$separator-hierarchy$separator-hierarchy-minor$separator-hierarchy-minor-regex$separator-hierarchy-regextan:sequence-collapse() tan:sequence-error() tan:sequence-expand() tan:shallow-copy() tan:shallow-equal() ŧ snap-to-word-pass-1$soft-hyphen$source-ids$source-lacks-id$sources-1st-da$sources-prepped$sources-resolved$special-end-div-chars$special-end-div-chars-regexŧ split-marked-fragment$src-elements$src-idsŧ stamp-element-idtan:stamp-id() tan:string-base() tan:string-composite() tan:string-length() tan:strings-to-numeral-or-numeral-type() ŧ strip-all-attributes-excepttan:strip-duplicate-nodes() tan:strip-duplicates() ŧ strip-duplicatesŧ strip-specific-attributesŧ strip-texttan:syc-to-int() tan:synthesize-merged-group() ŧ synthesize-merged-sources$syriac-letter-numeral-pattern$tag-urn-regex-patternŧ tan-a-div-merge-pass1ŧ tan-key-errorstan:tan-type() tan:text-join() $tok-grouping-key-key$token-definitions-reserved$tokenization-nonspacetan:tokenize() tan:tokenize-div() tan:tokenize-leaf-div() ŧ tokenize-prepped-class-1ŧ TAN-A-div-errors$TAN-elements-that-take-the-attribute-which$TAN-keyword-files$TAN-keywords$TAN-namespaceŧ unconsolidate-anastan:unconsolidate-tan-lm() tan:uri-directory() tan:uri-relative-to() tan:value-of() tan:zip-uris() $zwjThe 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.TAN-core global variables, keys, and functions summarizedvariables$all-functionsDefinition: collection('../collection.xml')Used by variable $all-function-uses-of-errorDoes not rely upon global variables, keys, functions, or templates.$all-idsDefinition: ($head//@xml:id, /tei:TEI//descendant-or-self::tei:*/@xml:id)Used by variable $duplicate-idsUsed by template ŧ core-attribute-errorsRelies upon $head .$all-irisDefinition: $head//tan:IRI[not(ancestor::tan:error)]Used by variable $duplicate-irisRelies upon $head .$all-keywordsDefinition: ($keys-resolved, $TAN-keywords)No variables, keys, functions, or named templates depend upon this xsl:variable.Relies upon $keys-resolved$TAN-keywords .$all-schemasDefinition: collection('../../schemas/collection.xml')Used by variable $all-schema-uses-of-errorDoes not rely upon global variables, keys, functions, or templates.$alphabet-numeral-keyThis variable has a complex definition. See
stylesheet for definiton.Used by function tan:letter-to-number()Does not rely upon global variables, keys, functions, or templates.$aposDefinition: "'"Used by variable $all-function-uses-of-error$function-error-ids$schema-error-idsDoes not rely upon global variables, keys, functions, or templates.$bodyDefinition: $self-resolved/*/(tan:body, tei:text/tei:body)Used by variable $all-body-irisUsed by template ŧ prep-class-2-doc-pass-2Used by function tan:merge-sources() tan:prep-class-2-doc-pass-2()Relies upon $self-resolved .$contexts-resolvedDefinition: $see-alsos-resolved[*/self::tan:TAN-c]No variables, keys, functions, or named templates depend upon this xsl:variable.Relies upon $see-alsos-resolved .$doc-idDefinition: /*/@idUsed by variable $doc-namespaceUsed by template ŧ core-errorsUsed by function tan:prep-TAN-mor() tan:prep-resolved-class-2-doc() tan:resolve-doc()Does not rely upon global variables, keys, functions, or templates.$doc-namespaceDefinition: substring-before(substring-after($doc-id, 'tag:'), ':')Used by variable $primary-agentUsed by template ŧ core-errorsRelies upon $doc-id .$doc-parent-directoryDefinition: tan:uri-directory($doc-uri)No variables, keys, functions, or named templates depend upon this xsl:variable.Relies upon tan:uri-directory$doc-uri .$doc-uriDefinition: base-uri(/*)Used by variable $doc-parent-directoryUsed by template ŧ core-errorsŧ core-attribute-errorsDoes not rely upon global variables, keys, functions, or templates.$duplicate-idsDefinition: $all-ids[index-of($all-ids, .)[2]]Used by template ŧ core-attribute-errorsRelies upon $all-ids .$duplicate-irisDefinition: $all-iris[index-of($all-iris, .)[2]]Used by template ŧ core-errorsRelies upon $all-iris .$elements-that-must-always-refer-to-tan-filesDefinition: ('morphology', 'inclusion', 'key')Used by function tan:must-refer-to-external-tan-file()Does not rely upon global variables, keys, functions, or templates.$empty-docThis variable has a complex definition. See
stylesheet for definiton.Used by template ŧ core-errorsUsed by function tan:get-lm-ids() tan:get-src-1st-da()Does not rely upon global variables, keys, functions, or templates.$erroneously-looped-docThis variable has a complex definition. See
stylesheet for definiton.No variables, keys, functions, or named templates depend upon this xsl:variable.Relies upon tan:error .$greek-letter-numeral-patternDefinition: '͵?([α-θΑ-ΘϛϚ]?[ρ-ωΡ-ΩϠϡ]?[ι-πΙ-ΠϘϙϞϟ]?[α-θΑ-ΘϛϚ]|[α-θΑ-ΘϛϚ]?[ρ-ωΡ-ΩϠϡ]?[ι-πΙ-ΠϘϙϞϟ][α-θΑ-ΘϛϚ]?|[α-θΑ-ΘϛϚ]?[ρ-ωΡ-ΩϠϡ][ι-πΙ-ΠϘϙϞϟ]?[α-θΑ-ΘϛϚ]?)ʹ?'Used by variable $nonlatin-letter-numeral-patternDoes not rely upon global variables, keys, functions, or templates.$headDefinition: $self-resolved/*/tan:headUsed by variable $morphologies-prepped$source-lacks-id$src-elements$source-ids$all-ids$all-iris$primary-agent$keys-1st-da$sources-1st-da$see-alsos-1st-daUsed by template ŧ prep-class-2-doc-pass-1ŧ core-errorsŧ core-attribute-errorsUsed by function tan:raw-diff-loop()Relies upon $self-resolved .$id-idrefsDefinition: doc('TAN-idrefs.xml')Used by template ŧ prepend-id-or-idrefsŧ core-attribute-errorsDoes not rely upon global variables, keys, functions, or templates.$inclusions-1st-daDefinition: tan:get-1st-doc(/*/tan:head/tan:inclusion)Used by variable $inclusions-resolvedUsed by function tan:prep-TAN-mor()Relies upon tan:get-1st-doc .$inclusions-resolvedDefinition: tan:resolve-doc($inclusions-1st-da, false(), 'incl', /*/tan:head/tan:inclusion/@xml:id, (), ())Used by template ŧ prep-tan-morŧ core-errorsRelies upon tan:resolve-doc$inclusions-1st-da .$keys-1st-daDefinition: tan:get-1st-doc($head/tan:key)Used by variable $keys-resolvedUsed by template ŧ core-errorsUsed by function tan:glossary()Relies upon tan:get-1st-doc$head .$keys-preppedThis variable has a complex definition. See
stylesheet for definiton.No variables, keys, functions, or named templates depend upon this xsl:variable.Relies upon $keys-resolvedŧ prep-tan-key .$keys-resolvedDefinition: tan:resolve-doc($keys-1st-da)Used by variable $keys-prepped$all-keywordsUsed by template ŧ core-errorsRelies upon tan:resolve-doc$keys-1st-da .$latin-letter-numeral-patternDefinition: '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+'Used by variable $n-type-patternUsed by function tan:aaa-to-int()Does not rely upon global variables, keys, functions, or templates.$n-typeDefinition: ('i', '1', '1a', 'a', 'a1', 'α', '$', 'i-or-a')Used by template ŧ arabic-numeralsŧ arabic-numeralsŧ arabic-numeralsUsed by function tan:strings-to-numeral-or-numeral-type() tan:get-n-types() tan:normalize-refs() tan:interpret-n-vals() tan:analyze-elements-with-numeral-attributes()Does not rely upon global variables, keys, functions, or templates.$n-type-labelDefinition: ('Roman numerals', 'Arabic numerals', 'Arabic numerals + alphabet numeral', 'alphabet numeral', 'alphabet numeral + Arabic numeral', 'non-Latin-alphabet numeral', 'string', 'Roman or alphabet numeral')No variables, keys, functions, or named templates depend upon this xsl:variable.Does not rely upon global variables, keys, functions, or templates.$n-type-patternDefinition: (concat('^(', $roman-numeral-pattern, ')$'), '^(\d+)$', concat('^(\d+)(', $latin-letter-numeral-pattern, ')$'), concat('^(', $latin-letter-numeral-pattern, ')$'), concat('^(', $latin-letter-numeral-pattern, ')(\d+)$'), concat('^(', $nonlatin-letter-numeral-pattern, ')$'), '(.)')Used by function tan:strings-to-numeral-or-numeral-type() tan:interpret-n-vals() tan:analyze-elements-with-numeral-attributes()Relies upon $roman-numeral-pattern$latin-letter-numeral-pattern$nonlatin-letter-numeral-pattern .$nonlatin-letter-numeral-patternDefinition: string-join(($greek-letter-numeral-pattern, $syriac-letter-numeral-pattern), '|')Used by variable $n-type-patternRelies upon $greek-letter-numeral-pattern$syriac-letter-numeral-pattern .$nowDefinition: tan:dateTime-to-decimal(current-dateTime())Used by template ŧ core-attribute-errorsRelies upon tan:dateTime-to-decimal .$primary-agentDefinition: ($head/tan:agent[tan:IRI[matches(., concat('^tag:', $doc-namespace))]])[1]Used by template ŧ core-errorsRelies upon $head$doc-namespace .$quotDefinition: '"'Used by variable $all-function-uses-of-error$function-error-ids$schema-error-idsDoes not rely upon global variables, keys, functions, or templates.$regex-characters-not-permittedDefinition: '[ - ]'Used by template ŧ core-errorsDoes not rely upon global variables, keys, functions, or templates.$regex-escaping-charactersDefinition: '[\.\[\]\\\|\-\^\$\?\*\+\{\}\(\)]'Used by function tan:escape() tan:expand-search()Does not rely upon global variables, keys, functions, or templates.$relationship-keywords-for-tan-filesDefinition: tan:glossary('relationship', (), 'TAN files')Used by function tan:must-refer-to-external-tan-file()Relies upon tan:glossary .$roman-numeral-patternDefinition: 'm{0,4}(cm|cd|d?c{0,3})(xc|xl|l?x{0,3})(ix|iv|v?i{0,3})'Used by variable $n-type-patternUsed by function tan:rom-to-int()Does not rely upon global variables, keys, functions, or templates.$rootDefinition: /Used by template Ŧ merge-nodesŧ core-errorsDoes not rely upon global variables, keys, functions, or templates.$see-alsos-1st-daDefinition: tan:get-1st-doc($head/tan:see-also)Used by variable $see-alsos-resolvedRelies upon tan:get-1st-doc$head .$see-alsos-resolvedDefinition: tan:resolve-doc($see-alsos-1st-da)Used by variable $contexts-resolvedUsed by template ŧ class-1-errorsŧ core-errorsRelies upon tan:resolve-doc$see-alsos-1st-da .$self-core-errors-markedThis variable has a complex definition. See
stylesheet for definiton.Used by variable $self-and-sources-prepped-prelim$self-and-sources-prepped$self-prepped$self-prepped$self-and-sources-prepped$self-prepped$self-preppedRelies upon $self-resolvedŧ core-attribute-errorsŧ core-errors .$self-resolvedDefinition: tan:resolve-doc(/)Used by variable $self-core-errors-marked$head$bodyRelies upon tan:resolve-doc .$separator-hierarchyDefinition: ' 'Used by variable $separator-hierarchy-regex$separator-hierarchy-minor-regexUsed by template ŧ prep-class-1ŧ arabic-numeralsUsed by function tan:flatref() tan:normalize-refs() tan:interpret-n-vals() tan:analyze-elements-with-numeral-attributes()Does not rely upon global variables, keys, functions, or templates.$separator-hierarchy-minorDefinition: '#'Used by variable $separator-hierarchy-minor-regexUsed by function tan:interpret-n-vals() tan:analyze-elements-with-numeral-attributes()Does not rely upon global variables, keys, functions, or templates.$separator-hierarchy-minor-regexDefinition: tan:escape($separator-hierarchy-minor)No variables, keys, functions, or named templates depend upon this xsl:variable.Relies upon tan:escape$separator-hierarchy-minor .$separator-hierarchy-regexDefinition: tan:escape($separator-hierarchy)No variables, keys, functions, or named templates depend upon this xsl:variable.Relies upon tan:escape$separator-hierarchy .$source-idsDefinition: if (exists($head/tan:source/@xml:id)) then $head/tan:source/@xml:id else for $i in (1 to count($head/tan:source)) return string($i)Used by variable $sources-resolvedRelies upon $head .$sources-1st-daDefinition: tan:get-1st-doc($head/tan:source)Used by variable $sources-resolvedRelies upon tan:get-1st-doc$head .$sources-resolvedDefinition: tan:resolve-doc($sources-1st-da, false(), 'src', $source-ids, (), ())Used by template ŧ core-errorsUsed by function tan:prep-resolved-class-2-doc()Relies upon tan:resolve-doc$sources-1st-da$source-ids .$syriac-letter-numeral-patternDefinition: '[ܐܒܓܕܗܘܙܚܛ]?\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}?'Used by variable $nonlatin-letter-numeral-patternDoes not rely upon global variables, keys, functions, or templates.$tag-urn-regex-patternDefinition: '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+'No variables, keys, functions, or named templates depend upon this xsl:variable.Does not rely upon global variables, keys, functions, or templates.$TAN-keyword-filesDefinition: collection('../../TAN-key/collection.xml')Used by variable $TAN-keywordsDoes not rely upon global variables, keys, functions, or templates.$TAN-keywordsThis variable has a complex definition. See
stylesheet for definiton.Used by variable $all-keywords$token-definitions-reservedUsed by template ŧ tan-key-errorsŧ core-errorsUsed by function tan:has-relationship() tan:glossary()Relies upon $TAN-keyword-filesŧ resolve-hrefŧ prep-tan-key .$TAN-namespaceDefinition: 'tag:textalign.net,2015'Used by template ŧ tan-key-errorsDoes not rely upon global variables, keys, functions, or templates.$token-definitions-reservedDefinition: $TAN-keywords//tan:token-definitionUsed by variable $tokenization-nonspaceUsed by function tan:prep-class-2-doc-pass-2() tan:tokenize-leaf-div()Relies upon $TAN-keywords .keysʞ item-via-node-name')Looks for elements matching tan:itemUsed by template ŧ tan-key-errorsUsed by function tan:glossary()Does not rely upon global variables, keys, functions, or templates.ʞ q-ref')Looks for elements matching *Used by function tan:get-via-q-ref()Relies upon tan:q-ref .functionstan:aaa-to-int()tan:aaa-to-int($arg as xs:string*) as xs:integer* Input: any alphabet numerals Output:the integer equivalent Sequence goes a, b, c, ... z, aa, bb, ..., aaa, bbb, .... E.g., 'ccc' - > 55 Used by function tan:strings-to-numeral-or-numeral-type() tan:interpret-n-vals() tan:analyze-elements-with-numeral-attributes()Relies upon $latin-letter-numeral-pattern .tan:analyze-elements-with-numeral-attributes()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()* Input: any sequence of elements that contain (either in themselves or their descendants) @n, @old, or @ref; 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) Output: zero or more <ns>s (one per group, and with @type-i, @type-a, and type-i-or-a if only ambiguous types are intended), each with one or more <n>s (one per atomic value in @n or @ref of the group picked), each with one or more <val type="[i, 1, 1a, a, a1, or $, depending on the type]">[VALUE]</val>, where VALUE is what the item is when converted. If the item is @ref then any non-word strings that are used to separate refs or @n values (hyphen, comma, etc.) are retained in <sep>s. This function is used to help other functions determine whether there is an error, or how ambiguous numerals should be interpreted Used by template ŧ arabic-numeralsŧ arabic-numeralsŧ arabic-numeralsUsed by function tan:normalize-refs() tan:resolve-doc()Relies upon tan:aaa-to-int$n-typetan:normalize-text$n-type-patterntan:rom-to-int$separator-hierarchy-minor$help-trigger-regex .tan:base-uri()tan:base-uri($any-node as node()?) as xs:anyURI? Input: any node Output: the base uri of the node's document NB, this function differs from fn:base-uri in that it first looks for a @base-uri 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 @base-uri.Used by template ŧ first-stampŧ resolve-hrefUsed by function tan:cfn() tan:first-loc-available()Does not rely upon global variables, keys, functions, or templates.tan:batch-replace()tan:batch-replace($string as xs:string?, $replace-elements as element()*) as xs:string? Input: a string, a sequence of <[ANY NAME] pattern="" replacement="" [flags=""]> Output: the string, after those replaces are processed in order Used by function tan:batch-replace()Relies upon tan:replacetan:batch-replace .tan:cfn()tan:cfn($item as item()*) as xs:string* Input: any items Output: the Current File Name, without extension, of the host document node of each item No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon tan:base-uri .tan:class-number()tan:class-number($nodes as node()*) as xs:integer* Input: any nodes of a TAN document 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 Used by template ŧ core-errorsUsed by function tan:must-refer-to-external-tan-file() tan:get-1st-doc()Relies upon tan:tan-type .tan:copy-of()tan:copy-of($doc-fragment as item()*, $exclude-elements-beyond-what-depth as xs:integer?) as item()* Input: any document fragment, and an optional integer specifying the depth of copy requested Output: a copy of the fragment to the depth specified This function depends upon the full version of tan:copy-of-except(); it is particularly useful for diagnostics, e.g., retrieving a long document's root element and its children, without descendants No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon tan:copy-of-except .tan:copy-of-except()Option 1 (TAN-core-functions)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()* short version of the full function, below Used by template ŧ tokenize-prepped-class-1Used by function tan:merge-tan-a-div-prepped() tan:copy-of() tan:copy-of-except()Relies upon tan:copy-of-except .Option 2 (TAN-core-functions)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()* 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 Output: the same fragment, filtered This function was written primarily to service the merge of TAN-A-div sources, where realigned divs could be extracted from their source documents Used by template ŧ tokenize-prepped-class-1Used by function tan:merge-tan-a-div-prepped() tan:copy-of() tan:copy-of-except()Relies upon ŧ copy-of-except .tan:dateTime-to-decimal()tan:dateTime-to-decimal($time-or-dateTime as item()*) as xs:decimal* Input: any xs:date or xs:dateTime 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. Example: (2015-05-10) - > 0.2015051 If input is not castable as a date or dateTime, 0 is returned Used by variable $nowUsed by template ŧ core-errorsŧ core-attribute-errorsUsed by function tan:most-recent-dateTime() tan:get-doc-hist()Does not rely upon global variables, keys, functions, or templates.tan:distinct-items()tan:distinct-items($items as item()*) as item()* Input: any sequence of items Output: Those items that are not deeply equal to any other item in the sequence No variables, keys, functions, or named templates depend upon this xsl:function.Does not rely upon global variables, keys, functions, or templates.tan:duplicate-values()tan:duplicate-values($sequence as item()*) as item()* Input: any sequence of items Output: those items that appear in the sequence more than once This function parallels the standard fn:distinct-values() Used by variable $self-leaf-div-flatref-duplicatesUsed by template ŧ prep-verboselyŧ segment-tokd-prepped-class-1ŧ prep-tan-morŧ TAN-A-div-errorsUsed by function tan:mark-splits()Does not rely upon global variables, keys, functions, or templates.tan:escape()tan:escape($strings as xs:string*) as xs:string* Input: any sequence of strings Output: each string prepared for regular expression searches, i.e., with reserved characters escaped out. Used by variable $separator-hierarchy-regex$separator-hierarchy-minor-regex$help-trigger-regexUsed by template ŧ prep-tan-lmŧ compare-copiesUsed by function tan:feature-test-check() tan:raw-diff-loop() tan:diff-core() tan:diff-core-draft()Relies upon $regex-escaping-characters .tan:first-loc-available()tan:first-loc-available($elements-that-are-locations-or-parents-of-locations as element()*) as xs:string* Input: An element that contains one or more tan:location elements Output: the value of the first tan:location/@href to point to a document available, resolved If no location is available nothing is returned. Used by function tan:get-src-1st-da() tan:get-1st-doc()Relies upon tan:base-uri .tan:get-1st-doc()tan:get-1st-doc($TAN-elements as element()*) as document-node()* Input: any TAN elements naming files (e.g., <source>, <see-also>, <inclusion>, <key>; an indication whether some basic errors should be checked if the retrieved file is a TAN document Output: the first document available for each element, plus/or any relevant error messages. Used by variable $morphologies-prepped$inclusions-1st-da$keys-1st-da$sources-1st-da$see-alsos-1st-daUsed by template ŧ class-1-errorsŧ core-errorsUsed by function tan:prep-TAN-mor() tan:prep-resolved-class-2-doc() tan:resolve-doc()Relies upon tan:errortan:class-numbertan:tan-typetan:first-loc-available .tan:get-doc-hist()tan:get-doc-hist($TAN-doc as document-node()*) as element()* Input: any TAN document Output: a sequence of elements with @when, @ed-when, and @when-accessed, sorted from most recent to least; each element includes @when-sort, a decimal that represents the value of the most recent time-date stamp in that element Used by template ŧ core-errorsRelies upon tan:dateTime-to-decimal .tan:get-via-q-ref()tan:get-via-q-ref($q-ref as xs:string*, $q-reffed-document as document-node()*) as node()* Input: any number of qrefs, any number of q-reffed documents Output: the elements corresponding to the q-refs This function is used by the core validation routine, especially to associate errors in included elements with the primary including element No variables, keys, functions, or named templates depend upon this xsl:function.Does not rely upon global variables, keys, functions, or templates.tan:glossary()Option 1 (TAN-core-functions)tan:glossary($element-that-takes-attribute-which as item()) as element()* one-parameter version of the master one, below Used by variable $relationship-keywords-for-tan-filesUsed by template ŧ resolve-keywordUsed by function tan:has-relationship() tan:glossary()Relies upon tan:glossary$keys-1st-da .Option 2 (TAN-core-functions)tan:glossary($element-that-takes-attribute-which as item(), $extra-TAN-key-docs as document-node()*, $group-name-filter as xs:string?) as element()* Input: any element that has @which (or a string value of the name of an element that takes @which); any TAN-key documents other than the standard TAN ones; and an optional name that restricts the search to a particular group Output: the tan:items that are valid keywords for the element in question, filtered by matches on @which, if present in the first parameter Used by variable $relationship-keywords-for-tan-filesUsed by template ŧ resolve-keywordUsed by function tan:has-relationship() tan:glossary()Relies upon $TAN-keywordsŧ prep-tan-key .tan:grc-to-int()tan:grc-to-int($greek-numerals as xs:string*) as xs:integer* Input: Greek letters that represent numerals Output: the numerical value of the letters NB, this does not take into account the use of letters representing numbers 1000 and greater No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon tan:letter-to-number .tan:has-relationship()tan:has-relationship($see-also-element as element(), $keyword as xs:string*, $extra-keys as document-node()*) as xs:boolean Input: a <see-also> 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. Output: boolean value specifying whether the <see-also> has a <relationship> that has the keyword defined This function will first check to see if IRIs in a <relationship> match, and if no IRIs are found then the check is performed on @which (against a <name> in the key definition). Used by template ŧ class-1-errorsŧ core-errorsRelies upon $TAN-keywordstan:glossarytan:normalize-text .tan:interpret-n-vals()tan:interpret-n-vals($ns as xs:string*) as element()* Input: any strings representing values of @n Output: one element per @n, with at least one <val @type="[n-type]"> 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 No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon $n-type-patterntan:letter-to-number$n-type$separator-hierarchy-minortan:aaa-to-inttan:rom-to-int .tan:letter-to-number()tan:letter-to-number($numerical-letters as xs:anyAtomicType*) as xs:integer* Input: any sequence of strings that represent alphabetic numerals Output: those numerals NB, currently works only for Greek and Syriac; anything else produces null results Used by function tan:strings-to-numeral-or-numeral-type() tan:interpret-n-vals() tan:grc-to-int() tan:syc-to-int()Relies upon $alphabet-numeral-key .tan:most-common-value()tan:most-common-value($sequence as item()*) as item()? Input: any sequence of items Output: the one item that appears most frequently If two or more items appear equally frequently, only the first is returned No variables, keys, functions, or named templates depend upon this xsl:function.Does not rely upon global variables, keys, functions, or templates.tan:most-recent-dateTime()tan:most-recent-dateTime($dateTimes as item()*) as item()? Input: a series of ISO-compliant date or dateTimes Output: the most recent one No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon tan:dateTime-to-decimal .tan:must-refer-to-external-tan-file()tan:must-refer-to-external-tan-file($node as node()) as xs:boolean Input: node in a TAN document. Output: boolean value indicating whether the node or its parent must name or refer to a TAN file. Used by template ŧ core-errorsRelies upon tan:class-number$elements-that-must-always-refer-to-tan-files$relationship-keywords-for-tan-files .tan:normalize-text()Option 1 (TAN-core-functions)tan:normalize-text($text as xs:string*) as xs:string* one-parameter version of full function below Used by template ŧ tan-key-errorsŧ prep-tan-lmŧ arabic-numeralsŧ prep-class-1ŧ prep-class-1ŧ prep-tan-morŧ prep-tan-morŧ prep-tan-morŧ prep-class-2-doc-pass-1ŧ prep-class-2-doc-pass-1ŧ arabic-numeralsŧ prep-class-2-doc-pass-2ŧ prep-class-2-doc-pass-3ŧ prep-tan-keyŧ resolve-attr-includeŧ resolve-keywordŧ class-1-errorsŧ core-errorsŧ core-attribute-errorsUsed by function tan:text-join() tan:feature-test-to-groups() tan:convert-ref-to-div-fragment() tan:get-toks() tan:sequence-expand() tan:normalize-text() tan:resolve-doc() tan:has-relationship() tan:analyze-elements-with-numeral-attributes() tan:idrefs() tan:idrefs-loop()Relies upon tan:normalize-text .Option 2 (TAN-core-functions)tan:normalize-text($text as xs:string*, $render-common as xs:boolean) as xs:string* Input: any sequence of strings; a boolean indicating whether the results should be normalized further to a common form Output: that sequence, with each item's space normalized, and removal of any help requested A common form is one where the string is converted to lower-case, and hyphens are replaced by spaces Used by template ŧ tan-key-errorsŧ prep-tan-lmŧ arabic-numeralsŧ prep-class-1ŧ prep-class-1ŧ prep-tan-morŧ prep-tan-morŧ prep-tan-morŧ prep-class-2-doc-pass-1ŧ prep-class-2-doc-pass-1ŧ arabic-numeralsŧ prep-class-2-doc-pass-2ŧ prep-class-2-doc-pass-3ŧ prep-tan-keyŧ resolve-attr-includeŧ resolve-keywordŧ class-1-errorsŧ core-errorsŧ core-attribute-errorsUsed by function tan:text-join() tan:feature-test-to-groups() tan:convert-ref-to-div-fragment() tan:get-toks() tan:sequence-expand() tan:normalize-text() tan:resolve-doc() tan:has-relationship() tan:analyze-elements-with-numeral-attributes() tan:idrefs() tan:idrefs-loop()Relies upon $help-trigger-regex .tan:pluck()tan:pluck($fragment as item()*, $pluck-beyond-level as xs:integer, $keep-short-branch-leaves as xs:boolean) as item()* 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 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 This function was written primarily to serve tan:convert-ref-to-div-fragment(), to get a slice of divs that correspond to a range, without the ancestry of those divs Used by function tan:convert-ref-to-div-fragment()Relies upon ŧ pluck .tan:prepend-id-or-idrefs()tan:prepend-id-or-idrefs($elements-with-id-or-id-refs as element(), $string-to-prepend as xs:string?) as element()* Input: any elements with @xml:id or an attribute that points to an element with an @xml:id value; some string that should be prepended to every value of every attribute found Output: the same elements, but with each value prepended with the string and a double hyphen This function is critical for disambiguating during the inclusion process. Used by template ŧ resolve-attr-includeRelies upon ŧ prepend-id-or-idrefs .tan:q-ref()tan:q-ref($elements as element()*) as xs:string* Input: any elements Output: the q-ref of each element 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. This function is useful when trying to correlate an unbreadmarked file (an original TAN file) against its breadcrumbed counterpart (e.g., $self-resolved), to check for errors. If any changes in element names, e.g., TEI - > TAN-T, are made during the standard preparation process, those changes are made here as well. Used by key ʞ q-ref')Does not rely upon global variables, keys, functions, or templates.tan:resolve-doc()Option 1 (TAN-core-functions)tan:resolve-doc($TAN-documents as document-node()*) as document-node()* one-parameter version of the fuller one, below Used by variable $morphologies-prepped$self-resolved$inclusions-resolved$keys-resolved$sources-resolved$see-alsos-resolvedUsed by template ŧ class-1-errorsŧ core-errorsUsed by function tan:prep-TAN-mor() tan:prep-resolved-class-2-doc() tan:get-src-1st-da-resolved() tan:resolve-doc() tan:resolve-doc()Relies upon tan:resolve-doc .Option 2 (TAN-core-functions)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()* 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. Output: those same documents, resolved, along the following steps: 1. Stamp each document with @base-uri and the optional root attribute; resolve @href, putting the original (if different) in @orig-href 2. Normalize @ref and @n, converting them whenever possible to Arabic numerals, and keeping the old versions as @orig-ref and @orig-n; if @n is a range or series, it will be expanded 3. Resolve every element that has @include. 4. Resolve every element that has @which. 5. If anything happened at #3, remove any duplicate elements. 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 @include and @which) 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. Used by variable $morphologies-prepped$self-resolved$inclusions-resolved$keys-resolved$sources-resolved$see-alsos-resolvedUsed by template ŧ class-1-errorsŧ core-errorsUsed by function tan:prep-TAN-mor() tan:prep-resolved-class-2-doc() tan:get-src-1st-da-resolved() tan:resolve-doc() tan:resolve-doc()Relies upon tan:resolve-docŧ resolve-keywordtan:normalize-textŧ resolve-attr-includeŧ arabic-numeralsŧ first-stamptan:strip-duplicatestan:get-1st-doctan:analyze-elements-with-numeral-attributestan:error .tan:resolve-keyword()tan:resolve-keyword($items as item()*, $extra-keys as document-node()*) as item()* Input: any items; any extra keys Output: the same items, but with elements with @which expanded into their full form, using the predefined TAN vocabulary and the extra keys supplied No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon ŧ resolve-keyword .tan:rom-to-int()tan:rom-to-int($arg as xs:string*) as xs:integer* Input: any roman numeral less than 5000 Output: the numeral converted to an integer Used by function tan:strings-to-numeral-or-numeral-type() tan:interpret-n-vals() tan:analyze-elements-with-numeral-attributes()Relies upon $roman-numeral-pattern .tan:sequence-collapse()tan:sequence-collapse($integers as xs:integer*) as xs:string? Input: a sequence of integers Output: a string that puts them in a TAN-like compact string No variables, keys, functions, or named templates depend upon this xsl:function.Does not rely upon global variables, keys, functions, or templates.tan:sequence-error()Option 1 (TAN-core-functions)tan:sequence-error($results-of-sequence-expand as xs:integer*) as element()*Used by template ŧ prep-tan-a-div-pass-aŧ mark-tok-charsUsed by function tan:sequence-error()Relies upon tan:sequence-error .Option 2 (TAN-core-functions)tan:sequence-error($results-of-sequence-expand as xs:integer*, $message as xs:string?) as element()* Input: any results of the function tan:sequence-expand() Output: error nodes, if any Used by template ŧ prep-tan-a-div-pass-aŧ mark-tok-charsUsed by function tan:sequence-error()Relies upon tan:error .tan:sequence-expand()tan:sequence-expand($selector as xs:string?, $max as xs:integer?) as xs:integer* Input: a string representing a TAN selector (used by @pos, @char, @seg), and an integer defining the value of 'last' Output: a sequence of numbers representing the positions selected, unsorted, and retaining duplicate values. Example: ("2 - 4, last-5 - last, 36", 50) -> (2, 3, 4, 45, 46, 47, 48, 49, 50, 36) Errors will be flagged as follows: 0 = value that falls below 1 -1 = value that surpasses the value of $max -2 = ranges that call for negative steps, e.g., '4 - 2' Used by template ŧ prep-tan-a-div-pass-aŧ insert-seg-into-leaf-divs-in-hierarchy-fragmentŧ prep-tan-morŧ mark-tok-charsŧ unconsolidate-anasUsed by function tan:get-picked-srcs-id-refs() tan:get-toks() tan:group-tok-elements()Relies upon tan:normalize-text .tan:shallow-copy()Option 1 (TAN-core-functions)tan:shallow-copy($elements as element()*) as element()* one-parameter version of the fuller one, below Used by function tan:convert-ref-to-div-fragment() tan:shallow-copy()Relies upon tan:shallow-copy .Option 2 (TAN-core-functions)tan:shallow-copy($elements as element()*, $keep-attributes as xs:boolean) as element()* Input: any document fragment; boolean indicating whether attributes should be kept Output: a shallow copy of the fragment, perhaps with attributes Used by function tan:convert-ref-to-div-fragment() tan:shallow-copy()Does not rely upon global variables, keys, functions, or templates.tan:stamp-id()Option 1 (TAN-core-functions)tan:stamp-id($nodes as item()*, $names-of-elements-to-imprint-with-gloss-id as xs:string*) as item()* 2-parameter form of the fuller version, below Used by function tan:stamp-id()Relies upon tan:stamp-id .Option 2 (TAN-core-functions)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()* Input: any element or document fragment, one or more strings of the names of elements that should be imprinted with @id Output: the same, with any elements whose names match the input with @id added, consisting of the name of the element appended with the number of its position relative to all preceding elements of the same name. Used by function tan:stamp-id()Relies upon ŧ stamp-element-id .tan:strip-duplicates()tan:strip-duplicates($tan-docs as document-node()*, $element-names-to-check as xs:string*) as document-node()* Input: any documents, sequence of strings of element names Output: the same documents after removing duplicate elements whose names match the second parameter. Used by function tan:resolve-doc()Relies upon ŧ strip-duplicates .tan:syc-to-int()tan:syc-to-int($syriac-numerals as xs:string*) as xs:integer* Input: Syriac letters that represent numerals Output: the numerical value of the letters NB, this does not take into account the use of letters representing numbers 1000 and greater No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon tan:letter-to-number .tan:tan-type()tan:tan-type($nodes as node()*) as xs:string* Input: any nodes Output: the names of the root elements; if not present, a zero-length string is returned Used by function tan:class-number() tan:get-1st-doc()Does not rely upon global variables, keys, functions, or templates.tan:tokenize-leaf-div()tan:tokenize-leaf-div($text as xs:string?, $token-definition as element(tan:token-definition)?, $count-toks as xs:boolean?) as element()? Input: single string and a <token-definition>. Output: <result> with matches and non matches enclosed by <tok> and <non-tok>, respectively Used by template ŧ tokenize-prepped-class-1Relies upon $token-definitions-reservedŧ count-tokens .tan:uri-directory()tan:uri-directory($uris as xs:string*) as xs:string* Input: any URIs, as strings Output: the file path NB, this function does not assume any URIs have been resolved Used by variable $doc-parent-directoryDoes not rely upon global variables, keys, functions, or templates.tan:uri-relative-to()tan:uri-relative-to($uri-to-revise as xs:string?, $uri-to-revise-against as xs:string?) as xs:string? Input: two strings representing URIs Output: the first string resolved relative to the second string Used by template ŧ core-attribute-errorsDoes not rely upon global variables, keys, functions, or templates.tan:value-of()tan:value-of($items as item()*) as xs:string? Input: any sequence of items Output: the value of each item Puts <xsl:value-of/> into a concise function Used by template ŧ prep-tan-a-div-pass-bDoes not rely upon global variables, keys, functions, or templates.tan:zip-uris()tan:zip-uris($uris as xs:string*) as xs:anyURI* Input: any string representing a uri Output: the same string with 'zip:' prepended if it represents a uri to a file in an archive (docx, jar, zip, etc.) No variables, keys, functions, or named templates depend upon this xsl:function.Does not rely upon global variables, keys, functions, or templates.TAN-core-errors global variables, keys, and functions summarizedvariables$all-function-uses-of-errorDefinition: $all-functions//*[matches(@select, concat('tan:error\([', $quot, $apos, ']'))]Used by variable $function-error-idsRelies upon $all-functions$quot$apos .$all-schema-uses-of-errorDefinition: $all-schemas/sch:*//*[some $i in @* satisfies matches($i, 'tan:error\(')]Used by variable $schema-error-idsRelies upon $all-schemas .$errorsDefinition: doc('TAN-errors.xml')Used by variable $errors-not-usedUsed by template ŧ referenced-doc-errorsUsed by function tan:error()Does not rely upon global variables, keys, functions, or templates.$errors-not-usedDefinition: $errors//tan:error[not(@xml:id = ($function-error-ids, $schema-error-ids))]No variables, keys, functions, or named templates depend upon this xsl:variable.Relies upon $errors$function-error-ids$schema-error-ids .$function-error-idsDefinition: for $i in $all-function-uses-of-error/@select return replace($i, concat('.*tan:error\([', $apos, $quot, '](\w+).+'), '$1')Used by variable $errors-not-usedRelies upon $all-function-uses-of-error$apos$quot .$help-trigger-regexDefinition: tan:escape($help-trigger)Used by template ŧ resolve-keywordUsed by function tan:convert-ref-to-div-fragment() tan:normalize-text() tan:analyze-elements-with-numeral-attributes() tan:help-requested()Relies upon tan:escape .$schema-error-idsDefinition: for $i in $all-schema-uses-of-error/(@select, @value)[matches(., 'tan:error\(')] return replace($i, concat('.*tan:error\([', $apos, $quot, '](\w+).+'), '$1')Used by variable $errors-not-usedRelies upon $all-schema-uses-of-error$apos$quot .functionstan:error()Option 1 (TAN-core-errors)tan:error($idref as xs:string) as element()? one-parameter function of the master version, below Used by variable $erroneously-looped-docUsed by template ŧ prep-tan-a-div-pass-aŧ prep-tan-a-div-pass-bŧ insert-seg-into-leaf-divs-in-hierarchy-fragmentŧ insert-seg-into-leaf-divs-in-hierarchy-fragmentŧ prep-verboselyŧ segment-tokd-prepped-class-1ŧ tan-key-errorsŧ tan-key-errorsŧ tan-key-errorsŧ tan-key-errorsŧ prep-tan-lmŧ prep-tan-lmŧ arabic-numeralsŧ prep-class-1ŧ prep-class-1ŧ prep-class-1ŧ prep-tan-claimsŧ prep-tan-claimsŧ prep-tan-morŧ prep-tan-morŧ prep-class-2-doc-pass-2ŧ prep-class-2-doc-pass-2ŧ resolve-attr-includeŧ resolve-keywordŧ TAN-A-div-errorsŧ TAN-A-div-errorsŧ class-1-errorsŧ class-1-errorsŧ class-1-errorsŧ class-1-copy-errorsŧ class-2-errorsŧ class-2-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-attribute-errorsUsed by function tan:merge-analyzed-stats() tan:prep-class-2-doc-pass-2() tan:group-by-IRIs() tan:pick-prepped-class-1-data() tan:cull-prepped-class-1-data() tan:convert-ref-to-div-fragment() tan:get-toks() tan:get-context-prepped() tan:sequence-error() tan:get-1st-doc() tan:resolve-doc() tan:error() tan:error() tan:error-report() tan:idrefs-loop()Relies upon tan:error .Option 2 (TAN-core-errors)tan:error($idref as xs:string, $diagnostic-message as item()*) as element()? two-parameter function of the master version, below Used by variable $erroneously-looped-docUsed by template ŧ prep-tan-a-div-pass-aŧ prep-tan-a-div-pass-bŧ insert-seg-into-leaf-divs-in-hierarchy-fragmentŧ insert-seg-into-leaf-divs-in-hierarchy-fragmentŧ prep-verboselyŧ segment-tokd-prepped-class-1ŧ tan-key-errorsŧ tan-key-errorsŧ tan-key-errorsŧ tan-key-errorsŧ prep-tan-lmŧ prep-tan-lmŧ arabic-numeralsŧ prep-class-1ŧ prep-class-1ŧ prep-class-1ŧ prep-tan-claimsŧ prep-tan-claimsŧ prep-tan-morŧ prep-tan-morŧ prep-class-2-doc-pass-2ŧ prep-class-2-doc-pass-2ŧ resolve-attr-includeŧ resolve-keywordŧ TAN-A-div-errorsŧ TAN-A-div-errorsŧ class-1-errorsŧ class-1-errorsŧ class-1-errorsŧ class-1-copy-errorsŧ class-2-errorsŧ class-2-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-attribute-errorsUsed by function tan:merge-analyzed-stats() tan:prep-class-2-doc-pass-2() tan:group-by-IRIs() tan:pick-prepped-class-1-data() tan:cull-prepped-class-1-data() tan:convert-ref-to-div-fragment() tan:get-toks() tan:get-context-prepped() tan:sequence-error() tan:get-1st-doc() tan:resolve-doc() tan:error() tan:error() tan:error-report() tan:idrefs-loop()Relies upon tan:error .Option 3 (TAN-core-errors)tan:error($idref as xs:string, $diagnostic-message as item()*, $fix as item()*, $fix-type as xs:string?) as element()? Input: idref of an error, and optional diagnostic messages Output: the appropriate <error> with each diagnostic inserted as a child <message>Used by variable $erroneously-looped-docUsed by template ŧ prep-tan-a-div-pass-aŧ prep-tan-a-div-pass-bŧ insert-seg-into-leaf-divs-in-hierarchy-fragmentŧ insert-seg-into-leaf-divs-in-hierarchy-fragmentŧ prep-verboselyŧ segment-tokd-prepped-class-1ŧ tan-key-errorsŧ tan-key-errorsŧ tan-key-errorsŧ tan-key-errorsŧ prep-tan-lmŧ prep-tan-lmŧ arabic-numeralsŧ prep-class-1ŧ prep-class-1ŧ prep-class-1ŧ prep-tan-claimsŧ prep-tan-claimsŧ prep-tan-morŧ prep-tan-morŧ prep-class-2-doc-pass-2ŧ prep-class-2-doc-pass-2ŧ resolve-attr-includeŧ resolve-keywordŧ TAN-A-div-errorsŧ TAN-A-div-errorsŧ class-1-errorsŧ class-1-errorsŧ class-1-errorsŧ class-1-copy-errorsŧ class-2-errorsŧ class-2-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-attribute-errorsUsed by function tan:merge-analyzed-stats() tan:prep-class-2-doc-pass-2() tan:group-by-IRIs() tan:pick-prepped-class-1-data() tan:cull-prepped-class-1-data() tan:convert-ref-to-div-fragment() tan:get-toks() tan:get-context-prepped() tan:sequence-error() tan:get-1st-doc() tan:resolve-doc() tan:error() tan:error() tan:error-report() tan:idrefs-loop()Relies upon $errorstan:fix .tan:error-report()tan:error-report($error as item()*) as xs:string* Input: strings corresponding to an error id or tan:error elements Output: a sequence of strings constituting a report to the user No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon tan:error .tan:fix()tan:fix($fix as item()*, $fix-type as xs:string?) as element()? Input: any items; a string representing a fix type Ouput: a tan:fix element with @type This function is used to populate a file with material to be used by Schematron Quick Fixes Used by template ŧ core-attribute-errorsUsed by function tan:error() tan:help-or-info()Does not rely upon global variables, keys, functions, or templates.tan:fragment-to-text()tan:fragment-to-text($fragment as item()*) as xs:string? Input: any document fragment Output: a string representation of the fragment This function is used to represent XML fragments in a plain text message, used particularly in validation reports No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon ŧ fragment-to-text .tan:help()tan:help($diagnostic-message as item()*, $fix as item()*, $fix-type as xs:string?) as element()Used by template ŧ prep-tan-a-div-pass-aŧ prep-tan-a-div-pass-aŧ prep-class-1ŧ prep-class-2-doc-pass-1ŧ prep-class-2-doc-pass-2ŧ resolve-keywordŧ core-attribute-errorsUsed by function tan:convert-ref-to-div-fragment() tan:get-toks()Relies upon tan:help-or-info .tan:help-or-info()tan:help-or-info($diagnostic-message as item()*, $fix as item()*, $fix-type as xs:string?, $is-info as xs:boolean) as element() 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) Output: an element with the appropriate help or info message Used by function tan:help() tan:info()Relies upon tan:fix .tan:help-requested()tan:help-requested($node as node()?) as xs:booleanUsed by template ŧ prep-tan-a-div-pass-aŧ prep-tan-a-div-pass-aŧ prep-tan-lmŧ prep-class-1ŧ prep-class-2-doc-pass-1ŧ prep-class-2-doc-pass-2ŧ prep-class-2-doc-pass-3ŧ core-attribute-errorsUsed by function tan:get-toks()Relies upon $help-trigger-regex .tan:idrefs()tan:idrefs($idrefs as xs:string?, $nodes as node()*) as node()* Input: a string; documents or document fragments Output: the elements that have an @xml:id value that matches the string, after it has been normalized and resolved for proxies Used by template ŧ core-errorsRelies upon tan:normalize-texttan:idrefs-loop .tan:idrefs-loop()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()* Loop function for tan:idrefs Used by function tan:idrefs() tan:idrefs-loop()Relies upon tan:errortan:normalize-texttan:idrefs-loop .tan:info()tan:info($diagnostic-message as item()*, $fix as item()*, $fix-type as xs:string?) as element()Used by template ŧ prep-verboselyŧ core-errorsUsed by function tan:convert-ref-to-div-fragment()Relies upon tan:help-or-info .TAN-class-1 global variables, keys, and functions summarizedvariables$self-class-1-errors-markedThis variable has a complex definition. See
stylesheet for definiton.No variables, keys, functions, or named templates depend upon this xsl:variable.Relies upon $self-preppedtan:analyze-string-lengthŧ class-1-errorsŧ class-1-copy-errors .$self-leaf-div-flatref-duplicatesDefinition: tan:duplicate-values($self-leaf-div-flatrefs)Used by template ŧ class-1-errorsRelies upon tan:duplicate-values$self-leaf-div-flatrefs .$self-leaf-div-flatrefsDefinition: $self-prepped/tan:TAN-T/tan:body//tan:div[not(tan:div)]/@refUsed by variable $self-leaf-div-flatref-duplicatesRelies upon $self-prepped .functionstan:compare-copies()tan:compare-copies($document as document-node(), $copy as document-node()) as document-node() Input: two class-1 documents, one treated as a master and the other as a copy Output: addition of @copy-loc 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 @copy-text and @ref, with the faulty div's ref, is returned. This function is useful for diagnosing and fixing discrepancies between copies, especially those that have a different segmentation / div structure. No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon tan:text-joinŧ compare-copiesŧ get-mismatched-text .tan:get-ref-seq()tan:get-ref-seq($resolved-class-1-doc as document-node()) as xs:string* Input: any resolved class 1 document Output: a sequence of flatrefs for the document No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon tan:flatref .tan:mark-splits()tan:mark-splits($c1-doc-prepped as document-node()) as document-node() Input: any prepped class 1 doc Output: the same document, but with @pos added to <div>s that are split.No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon tan:prep-resolved-class-1-doctan:duplicate-valuesŧ mark-splits .tan:normalize-doc-space()tan:normalize-doc-space($doc as document-node()+) as document-node()+ Input: any document Output: that same document, but with each text() space-normalized No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon ŧ normalize-space .TAN-class-2 global variables, keys, and functions summarizedvariables$source-lacks-idDefinition: if ($head/tan:source/@xml:id) then false() else true()No variables, keys, functions, or named templates depend upon this xsl:variable.Relies upon $head .$src-elementsDefinition: $head/tan:sourceUsed by variable $src-idsUsed by function tan:get-src-1st-da() tan:get-picked-srcs-id-refs()Relies upon $head .$src-idsDefinition: if ($src-elements/@xml:id) then $src-elements/@xml:id else '1'Used by function tan:get-src-1st-da() tan:get-picked-srcs-id-refs() tan:get-src-1st-da-resolved()Relies upon $src-elements .keysʞ div-via-ref')Looks for elements matching tan:divUsed by function tan:convert-ref-to-div-fragment()Does not rely upon global variables, keys, functions, or templates.functionstan:analyze-ref()tan:analyze-ref($ref as xs:string) as element() Input: any @ref's value Output: series of <ref>s, punctuated by <comma> or <dash>; each <ref> holds the likely best value; if that differs from the original, @orig holds the original value of the ref Used by function tan:convert-ref-to-div-fragment()Relies upon ŧ analyze-ref .tan:convert-ref-to-div-fragment()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()* Input: source document, at least prepped; an element with an unresolved @ref; indication whether the text should be retrieved or not Output: a fragment from the source document with the hierarchies of only those divs that correspond to the range specified by @ref It is assumed that the second parameter refers to the first; that is, the source document really is the one that the element with @ref is trying to cite. It is also assumed that in any range where the second element has fewer @n 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 <div>, will be interpeted as 1 1 - 2 Used by template ŧ prep-class-2-doc-pass-3Relies upon tan:helptan:infotan:analyze-reftan:error$help-trigger-regextan:shallow-copytan:plucktan:normalize-text .tan:counts-to-firsts()tan:counts-to-firsts($seq as xs:integer*) as xs:integer* Input: sequence of numbers representing counts of items. Output: sequence of numbers representing the first position of each item within the total count. E.g., (4, 12, 0, 7) - > (1, 5, 17, 17)No variables, keys, functions, or named templates depend upon this xsl:function.Does not rely upon global variables, keys, functions, or templates.tan:counts-to-lasts()tan:counts-to-lasts($seq as xs:integer*) as xs:integer* Input: sequence of numbers representing counts of items. Output: sequence of numbers representing the last position of each item within the total count. E.g., (4, 12, 0, 7) - > (4, 16, 16, 23)No variables, keys, functions, or named templates depend upon this xsl:function.Does not rely upon global variables, keys, functions, or templates.tan:cull-prepped-class-1-data()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()* Used to create a subset of $src-1st-da-prepped Input: (1) prepped source documents. (2) one or more elements with @src and @ref. It is assumed that both attributes have single, atomic values (i.e., no ranges in @ref). (3) boolean indicating whether the values of @src and @ref should be treated as regular expressions Output: src-1st-da-prepped, proper subset, excluding matchesNo variables, keys, functions, or named templates depend upon this xsl:function.Relies upon tan:errorŧ cull-prepped-class-1 .tan:element-key()tan:element-key($node as node()) as xs:string?Used by template Ŧ merge-nodesUsed by function tan:recombine-docs()Does not rely upon global variables, keys, functions, or templates.tan:expand-src-and-div-type-ref()tan:expand-src-and-div-type-ref($elements-with-src-and-div-type as element()*) as element()*No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon ŧ prep-class-2-doc-pass-1 .tan:expand-tok()tan:expand-tok($tok-elements as element()*, $src-1st-da-tokenized as document-node()*) as element()* Input: any <tok> with atomic @src and @ref values; any number of tokenized source documents Output: one <tok> per token invoked, adding @n to specify where in the <div> the token is to be found; if @chars is present it is replaced with a space-delimited list of integers Used by template ŧ prep-class-2-doc-pass-4Relies upon tan:get-toksŧ mark-tok-chars .tan:get-context-prepped()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()* Input: a class 2 document, transformed to level $self2 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. Output: the class 2 context documents, with values converted (where needed) to the main class 2 document 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). No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon tan:errortan:prep-resolved-class-1-doctan:prep-class-2-doc-pass-3ŧ prep-rim-pass-1ŧ prep-rim-pass-2 .tan:get-picked-srcs-id-refs()tan:get-picked-srcs-id-refs($srcs-picked as item()*) as xs:string*Used by function tan:get-src-1st-da()Relies upon tan:sequence-expand$src-elements$src-ids .tan:get-src-1st-da()Option 1 (TAN-class-2-functions)tan:get-src-1st-da() as document-node()* zero-parameter version of the function below Used by function tan:get-src-1st-da() tan:get-src-1st-da-resolved()Relies upon tan:get-src-1st-da$src-ids .Option 2 (TAN-class-2-functions)tan:get-src-1st-da($srcs-picked as item()*) as document-node()* This version allows one to exclude certain sources from processing Used by function tan:get-src-1st-da() tan:get-src-1st-da-resolved()Relies upon tan:get-picked-srcs-id-refstan:first-loc-available$src-elements$empty-doc .tan:get-src-1st-da-resolved()Option 1 (TAN-class-2-functions)tan:get-src-1st-da-resolved() zero-parameter version of the next function Used by function tan:get-src-1st-da-resolved()Relies upon tan:get-src-1st-da-resolvedtan:get-src-1st-da$src-ids .Option 2 (TAN-class-2-functions)tan:get-src-1st-da-resolved($picked-class-1-docs as document-node()*, $picked-src-ids as xs:string*) Used by function tan:get-src-1st-da-resolved()Relies upon tan:resolve-doc .tan:get-src-1st-da-tokenized()Option 1 (TAN-class-2-functions)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()*Used by function tan:prep-resolved-class-2-doc() tan:get-src-1st-da-tokenized()Relies upon tan:get-src-1st-da-tokenized .Option 2 (TAN-class-2-functions)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()* Input: class-2 document prepped through stage 3; related source class 1 documents, resolved; boolean indicating whether @n should be added to new <tok>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 Output: same class 1 documents tokenized, selectively or completely Used by function tan:prep-resolved-class-2-doc() tan:get-src-1st-da-tokenized()Relies upon ŧ tokenize-prepped-class-1 .tan:get-src-1st-da-with-lms()tan:get-src-1st-da-with-lms($tokenized-class-1-doc as document-node(), $prepped-tan-lm-docs as document-node()*) as document-node() Input: any tokenized class 1 document; any prepped TAN-LM documents Output: the original document, imprinted with lexico-morphological data For now, this function assumes that every TAN-LM document pertains to the tokenized class-1 doc No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon ŧ add-lm-to-tok .tan:get-toks()tan:get-toks($tokenized-div as element()?, $tok-elements as element()*) as element()* returns the <tok>s from a given <div>, including @n with integer position Input: (1) any <div> with <tok> and <non-tok> children (result of tan:tokenize-prepped-1st-da()) (2) any number of <tok>s that are deemed to relate to the <div> chosen (i.e., @src and @ref will be ignored, assumed to correspond to the input <div>) Output: the <tok> elements picked. Used by function tan:expand-tok()Relies upon tan:errortan:helptan:normalize-texttan:matchestan:help-requestedtan:sequence-expand .tan:group-by-IRIs()Option 1 (TAN-class-2-functions)tan:group-by-IRIs($elements-with-IRI-children as element()*) as element()*Used by variable $features-groupedUsed by function tan:prep-class-2-doc-pass-2() tan:group-by-IRIs()Relies upon tan:group-by-IRIs .Option 2 (TAN-class-2-functions)tan:group-by-IRIs($elements-with-IRI-children as element()*, $equate-elements as element()*) as element()* Input: Any elements that have children <IRI>s; a sequence of elements that pre-determine select equations Output: Those same elements grouped as children of either <equate-works>, <equate-div-types>, or <group> (depending upon name of element), based on equivalencies in IRI values. Each <group> will also include an @n value, acting as a kind of identifier. 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. Used by variable $features-groupedUsed by function tan:prep-class-2-doc-pass-2() tan:group-by-IRIs()Relies upon tan:errortan:group-by-IRIs-loop .tan:group-by-IRIs-loop()tan:group-by-IRIs-loop($tree-of-groups-so-far as element()?, $elements-to-group as element()*) as element()* Input: an element containing zero or more <group> children; a sequence of elements yet to be placed in a <group> Output: a sequence of groups (= <equate-works>, <equate-div-types>, or <group>) lumping together elements based on commonality of their <IRI> values Used by function tan:group-by-IRIs() tan:group-by-IRIs-loop()Relies upon tan:group-by-IRIs-loop .tan:max-integer()tan:max-integer($input as xs:string) as xs:integer? input: string of TAN @pos or @chars selectors output: largest integer, ignoring value of 'last' E.g., "5 - 15, last-20" -> 15 Useful for validation routines that want merely to check if a range is out of limitsNo variables, keys, functions, or named templates depend upon this xsl:function.Does not rely upon global variables, keys, functions, or templates.tan:min-last()tan:min-last($input as xs:string, $last as xs:integer) as xs:integer input: @pos or @chars selectors, number defining "last" output: smallest reference related to "last" E.g., "5 - 15, last-20", 34 -> 14 No variables, keys, functions, or named templates depend upon this xsl:function.Does not rely upon global variables, keys, functions, or templates.tan:normalize-refs()Option 1 (TAN-class-2-functions)tan:normalize-refs($elements-with-attr-ref as element()*) as xs:string*Used by template ŧ unconsolidate-anasUsed by function tan:normalize-refs()Relies upon tan:normalize-refs .Option 2 (TAN-class-2-functions)tan:normalize-refs($elements-with-attr-ref as element()*, $ambiguous-numeral-types as element()*) as xs:string* Input: elements that take @ref; a numeral types declaration (elements produced by tan:analyze-attr-n-or-ref-numerals()) Output: a sequence of punctuation- and space-normalized reference strings, converting the items that match numerals into Arabic numerals and setting the strings lowercase Used by template ŧ unconsolidate-anasUsed by function tan:normalize-refs()Relies upon tan:analyze-elements-with-numeral-attributes$n-type$separator-hierarchy .tan:ordinal()tan:ordinal($in as xs:integer*) as xs:string* Input: one or more numerals Output: one or more strings with the English form of the ordinal form of the input number E.g., (1, 4, 17) -> ('first','fourth','17th'). No variables, keys, functions, or named templates depend upon this xsl:function.Does not rely upon global variables, keys, functions, or templates.tan:pick-prepped-class-1-data()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()* Used to create a subset of $src-1st-da-prepped Input: (1) prepped source documents. (2) one or more elements with @src and @ref. It is assumed that both attributes have single, atomic values (i.e., no ranges in @ref). (3) boolean indicating whether the values of @src and @ref should be treated as regular expressions Output: src-1st-da-prepped, proper subset that consists exclusively of matchesNo variables, keys, functions, or named templates depend upon this xsl:function.Relies upon tan:errorŧ pick-prepped-class-1 .tan:prep-class-2-doc-pass-2()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()* Input: class 2 document that has already gone through pass 1 of preparation; resolved documents Output: the class 2 document, with expansions of <equate-works> and <equate-div-types> and determination of <token-definition>. Used by function tan:prep-resolved-class-2-doc()Relies upon tan:error$token-definitions-reservedtan:group-by-IRIsŧ prep-class-2-doc-pass-2 .tan:prep-class-2-doc-pass-3()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()? Input: a class-2 document, that has gone through two stages of preparation; sources that have gone through one level of preparation Output: the class-2 document with @work and @ref expanded; provide help on <equate-works>, <equate-div-types> (TAN-A-div) Used by function tan:prep-resolved-class-2-doc() tan:get-context-prepped()Relies upon ŧ prep-class-2-doc-pass-3 .tan:prep-class-2-doc-pass-4()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()?Used by function tan:prep-resolved-class-2-doc()Relies upon ŧ prep-class-2-doc-pass-4 .tan:prep-resolved-class-2-doc()Option 1 (TAN-class-2-functions)tan:prep-resolved-class-2-doc($resolved-class-2-doc as document-node()?) as document-node()*Used by variable $self-and-sources-prepped-prelim$self-and-sources-prepped$self-and-sources-preppedUsed by function tan:prep-resolved-class-2-doc()Relies upon $doc-id$sources-resolvedtan:resolve-doctan:get-1st-doctan:prep-resolved-class-2-doc .Option 2 (TAN-class-2-functions)tan:prep-resolved-class-2-doc($resolved-class-2-doc as document-node()?, $resolved-class-2-sources as document-node()*) as document-node()* Input: a class 2 document 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 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: FOCUS ALTERATIONS ======= ============================================================================================= sources Resolve each source document (including add @src to root element) self Expand @src (<equate-works> gets special treatment), @div-type-ref; normalize @ref; add @xml:id to TAN-LM <source>; add @group to elements that take @cont; add @work to continuations that should take it self Expand <token-definition> and (TAN-A-div) <equate-works>, <equate-div-types> sources Add @work to each root element (TAN-A-div), rename @ns, suppress select div types, replace div types with numerical equivalent. Sources' flat ref should now be commensurate with class 2 file's use of @ref. self Expand @work, @ref (iterate elements over calculated values); provide help on <equate-works> and <equate-div-types> sources Tokenize and (if the self is a TAN-A-div) segment those <div>s that are referred to self Expand @val, @pos for <tok>, look for errors in previous step self Check for errors in previous steps [Further preparation is then conducted by the functions specific to the particular class 2 format]Used by variable $self-and-sources-prepped-prelim$self-and-sources-prepped$self-and-sources-preppedUsed by function tan:prep-resolved-class-2-doc()Relies upon tan:prep-class-2-doc-pass-2tan:get-src-1st-da-tokenizedtan:prep-resolved-class-1-docŧ class-2-errorsŧ prep-class-2-doc-pass-1tan:prep-class-2-doc-pass-4tan:prep-class-2-doc-pass-3 .tan:product()tan:product($numbers as item()*) as xs:double? Input: a sequence of numbers Output: the product of those numbers No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon tan:product-loop .tan:product-loop()tan:product-loop($product-so-far as xs:double?, $numbers-to-multiply as item()*) as xs:double?Used by function tan:product() tan:product-loop()Relies upon tan:product-loop .tan:recombine-docs()tan:recombine-docs($docs-to-recombine as document-node()*, $ref-sort-key-docs as document-node()*) as document-node()* Input: any number of documents Output: recombined documents This function is useful for cases where you have both picked and culled from a source, and you wish to combine the two documents into a single one that strips away duplicates. NB, the results may not preserve the original document order of an original document. It also treats non-leaf white- space text nodes as dispensible.No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon tan:element-keyŦ merge-nodes .tan:shallow-equal()tan:shallow-equal($element-1 as element()?, $element-2 as element()?) as xs:boolean Input: any two elements. Output: true if shallowly equal. Two elements are shallowly equal if (1) they both have the same name; (2) the name of every attribute in one is the name of an attribute in the other; and (3) for every pair of attributes, every space-separated value in one is found in the other. Any descendants are ignored. Example: Input: <div class="gum mug droop">Testing</div> <div class="droop mug gum droop">Different text</div> Output: trueNo variables, keys, functions, or named templates depend upon this xsl:function.Does not rely upon global variables, keys, functions, or templates.tan:strip-duplicate-nodes()tan:strip-duplicate-nodes($nodes-to-check as node()*, $checked-nodes as node()*) as node()*Used by template Ŧ merge-nodesUsed by function tan:strip-duplicate-nodes()Relies upon tan:strip-duplicate-nodes .tan:tokenize-div()tan:tokenize-div($divs as element()*, $token-definitions as element()) as element()* Input: any <div>s, a <token-definition> Output: the <divs>s in tokenized form No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon ŧ tokenize-prepped-class-1 .tan:unconsolidate-tan-lm()tan:unconsolidate-tan-lm($tan-lm-docs as document-node()*, $srcs-tokenized as document-node()*) as document-node()* Reformats TAN-LM files, such that each <ana> has one and only one <tok> + <l> + <m> combination No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon ŧ unconsolidate-anas .templatesŦ merge-nodesUsed by template Ŧ merge-nodesUsed by function tan:recombine-docs()Relies upon tan:strip-duplicate-nodestan:element-keyŦ merge-nodes .TAN-A-div global variables, keys, and functions summarizedvariables$self-and-sources-prepped-prelimDefinition: tan:prep-resolved-class-2-doc($self-core-errors-marked)Used by variable $self-and-sources-preppedUsed by function tan:prep-resolved-tan-a-div-doc()Relies upon tan:prep-resolved-class-2-doc$self-core-errors-marked .functionstan:get-src-1st-da-segmented()tan:get-src-1st-da-segmented($self-expanded-3 as document-node()?, $src-1st-da-tokenized as document-node()*) as document-node()* Input: Any sources for a TAN-A-div, preliminarily prepped (via class 2 operation) Output: the same sources, selectively segmented Segmentation here means inserting into only those leaf <div>s that have been split a new <div type="#seg" ref="[ANCESTRAL @REF + ' #' + SEGMENT NUMBER]"> Used by function tan:prep-resolved-tan-a-div-doc()Relies upon ŧ segment-tokd-prepped-class-1 .tan:get-src-1st-da-statted()tan:get-src-1st-da-statted($src-1st-da-tokenized as document-node()*) as document-node()*No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon ŧ count-tokenized-class-1 .tan:merge-tan-a-div-prepped()Option 1 (TAN-A-div-functions)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()* shortened version of the fuller function, below Used by function tan:merge-tan-a-div-prepped()Relies upon tan:merge-tan-a-div-prepped .Option 2 (TAN-A-div-functions)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()* 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 Output: the TAN-A-div file, with the following changes: (a) one <work> per work chosen is placed after <body>; (b) each <work> contains a merger of the <div>s of all sources that contain that work; (c) @ref in <div>s in unanchored realignments are moved to @pre-realign-ref and @ref takes the @id value of the realignment; (d) @ref in <div>s in anchored realignments are moved to @pre-realign-ref and @ref takes the @ref of the anchor See tan:merge-source-loop() for more documentation Used by function tan:merge-tan-a-div-prepped()Relies upon tan:prep-tan-a-div-sources-for-mergetan:merge-source-looptan:copy-of-exceptŧ tan-a-div-merge-pass1 .tan:prep-resolved-tan-a-div-doc()tan:prep-resolved-tan-a-div-doc($self-and-sources-prepped-class-2 as document-node()*) as document-node()* Input: a TAN-A-div document and its sources, as prepared by tan:prep-resolved-class-2-doc() Output: the same documents, prepared with TAN-A-div specific considerations FOCUS ALTERATIONS ======= ============================================================================================= sources Segment sources self Expand <div-ref> and <anchor-div-ref> on @seg, making in <realign> a deep copy of the <div>s and <seg>s referred to self Distribute <align> and <realign>; signal errors of realignment self Mark errors Note, because this function is designed to expedite validation, it does not realign the sources, which must be done through tan:merge-tan-a-div-prepped() Used by variable $self-and-sources-preppedRelies upon $self-and-sources-prepped-prelimtan:prep-TAN-claimsŧ TAN-A-div-errorsŧ prep-tan-a-div-pass-bŧ prep-tan-a-div-pass-atan:get-src-1st-da-segmented .tan:prep-tan-a-div-sources-for-merge()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()* Input: A TAN-A-div file that has reached at least level four of preparation (<realign> has @id); the sources of that TAN-A-div file, prepared Output: The sources, realigned. The function traverses each source, div by div via a template. If in a given source ($this-src) in a given div ($this-div) the ref ($this-ref) is found in the TAN-A-div's <realign> (in realign/div-ref/div/@ref), then if the realignment is anchored then the anchor's @ref is adopted. In an unanchored realignment, the id of the <realign>, e.g., #realign1-1, is adopted. Whether a simple or complex realignment, @pre-realign-ref is added with the old @ref, and @src is added (to anticipate merges between sources). Whether simple or complex, a realigned <div> passes on its new @ref value to its children, whose @ref values are revised accordingly. Used by function tan:merge-tan-a-div-prepped()Relies upon ŧ prepare-class-1-doc-for-merge .tan:prep-verbosely()tan:prep-verbosely($TAN-A-div-prepped as document-node()?, $TAN-A-div-sources-prepped as document-node()*) as document-node()* Input: a TAN-A-div file prepped and its sources, also prepped Output: the same files, with information marked of relevance to the validation process. No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon tan:get-src-skeletonŧ prep-verbosely .tan:process-splits()tan:process-splits($elements-to-process) as element()* Input: any document fragment with <split/> inserted in leaf elements representing where there should be a deep, top-level split Output: A sequence of <fragment>s (the number of <split/>s plus one containing a deep copy of the fragment chosen Used by function tan:remodel-div-ref() tan:process-splits()Relies upon tan:process-splitsŧ process-splits .tan:remodel-div-ref()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()? Input: (1) a <div-ref> containing one or more <div>s of unknown complexity, to be fused into (2) another <div-ref> or <anchor-div-ref> containing a <div>structure to be treated as a structural model of the first; a boolean indicating whether allocation should be shallow (top-level <div> only) or deep 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 @src, which is replaced by the value of @src in (1) This function is written for proportional realignments No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon tan:analyze-string-lengthtan:process-splits$tokenization-nonspaceŧ infuse-tokenized-divŧ mark-splits-in-fragmentŧ tokenize-prepped-class-1 .TAN-A-tok global variables, keys, and functions summarizedfunctionstan:analyze-tok-chars()tan:analyze-tok-chars($src-tok-element as element()?, $self-expanded-4-tok-element as element()?) as element()?No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon ŧ char-setup .tan:get-src-1st-da-analysis-stamped()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()*No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon ŧ analysis-stamp .tan:get-src-1st-da-chars-picked()tan:get-src-1st-da-chars-picked($self-expanded-4 as document-node()?, $tokenized-class-1-doc as document-node()*) as document-node()*No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon ŧ char-setup .TAN-LM global variables, keys, and functions summarizedvariables$features-groupedDefinition: tan:group-by-IRIs($features-prepped)No variables, keys, functions, or named templates depend upon this xsl:variable.Relies upon tan:group-by-IRIs$features-prepped .$features-preppedThis variable has a complex definition. See
stylesheet for definiton.Used by variable $features-groupedRelies upon $morphologies-prepped .$l-grouping-key-keyThis variable has a complex definition. See
stylesheet for definiton.Used by function tan:ana-grouping-key()Does not rely upon global variables, keys, functions, or templates.$m-grouping-key-keyThis variable has a complex definition. See
stylesheet for definiton.Used by function tan:ana-grouping-key()Does not rely upon global variables, keys, functions, or templates.$morphologies-preppedDefinition: tan:prep-TAN-mor(tan:resolve-doc(tan:get-1st-doc($head/tan:declarations/tan:morphology), false(), 'morphology', $head/tan:declarations/tan:morphology/@xml:id, (), ()))Used by variable $features-preppedUsed by template ŧ prep-tan-lmŧ convert-code-to-featuresUsed by function tan:expand-m()Relies upon tan:prep-TAN-mortan:resolve-doctan:get-1st-doc$head .$sep-1Definition: '%'Used by function tan:rebuild-ana-fragment() tan:ana-grouping-key()Does not rely upon global variables, keys, functions, or templates.$sep-2Definition: '#'Used by function tan:rebuild-ana-fragment() tan:ana-grouping-key()Does not rely upon global variables, keys, functions, or templates.$tok-grouping-key-keyThis variable has a complex definition. See
stylesheet for definiton.Used by function tan:ana-grouping-key()Does not rely upon global variables, keys, functions, or templates.functionstan:add-tok-val()tan:add-tok-val($tan-lm-resolved as document-node()*, $src-tokenized as document-node()*) as document-node()* take a fully expanded TAN-LM file ($self4) and to each <tok> add the value of the token chosen, as @val, and replacing any pre-existing @val with @val-origNo variables, keys, functions, or named templates depend upon this xsl:function.Relies upon ŧ add-tok-val .tan:all-morph-codes()tan:all-morph-codes($morph as item()*, $codes as xs:string*) as xs:string* Change any sequence of morphological codes into a sequence of synonymous morphological codes Input: node() picking a TAN-R-mor file, a sequence of strings, each item being the value of tan:option/@code or tan:feature/@xml:id Output: sequence of strings returning all equivalent lowercased values of each tan:option/@code or tan:feature/@xml:id E.g., ('NN','comma','.') - > ('nn','comma',',','.','period')Used by function tan:feature-test-check()Does not rely upon global variables, keys, functions, or templates.tan:ana-grouping-key()tan:ana-grouping-key($tok-lm-l-or-m-element as element()*) as xs:string* Input: zero or more <tok>, <lm>, <l>, or <m>s Output: an equal number of strings that concatenate the properties of that element Especially made to be used in the @group-by value of <xsl:for-each-group /> statements. See also tan:rebuild-ana-fragment(), which can reconstruct the <ana> fragment.Used by function tan:ana-grouping-key()Relies upon $sep-1$sep-2$tok-grouping-key-keytan:ana-grouping-key$l-grouping-key-key$m-grouping-key-key .tan:convert-code-to-features()tan:convert-code-to-features($tan-lm-resolved as document-node()*) as document-node()* adds to every <m> a <feature @xml:id> for every part of the code No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon ŧ convert-code-to-features .tan:expand-m()tan:expand-m($m as element()*, $add-counts as xs:boolean) as element()* Expands an <m>. Input: (1) one or more <m>s, (2) true/false indicating whether features should be counted Output: that <m>, and for every code, the corresponding <feature> is inserted No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon $morphologies-prepped .tan:expand-per-lm()tan:expand-per-lm($tan-lm-resolved as document-node()*) as document-node()* Takes a TAN-LM and consolidates it, creating one <ana> per individual <l> + <m> pair, then putting in it any <tok> that shares that data No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon ŧ expand-lm .tan:feature-test-check()tan:feature-test-check($code as xs:string, $feature-expr as xs:string, $morph as item()*) as xs:boolean Checks to see if a logical expression of morphological codes (+ synonyms) is found in a given value of <m> Input: two strings, the first a morphological code to be checked to see if it matches the second, a logical expression of features; a third parameter, a node(), defines the morphology rule to be used (to reconcile synonyms in codes) Output: true() if a match is found, false() otherwise E.g., 'nn 1 m', '(NN | m), 2' - > false() E.g., 'nn 1 m', '(NN | m), 1' - > true()No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon tan:escapetan:all-morph-codes .tan:get-lm-ids()tan:get-lm-ids($ana-elements as element()+) as xs:string* Input: any number of <ana> Output: one string per combination of <l> + <m>, calculated by joining (1) the <l> value, (2)the <m> code, and (3) attribute values of <lm>, <l>, and <m>Used by template ŧ expand-lmRelies upon $empty-doc .tan:get-matching-lm-combos()tan:get-matching-lm-combos($l-element as element(), $m-element as element()) as element()* Input: one <l> and one <m> Output: all matching combinations. If an <lm> has only one <l> and <m> (and both match) then the entire <lm> is picked. If there's only one <l> and many <m>s then only the <m> is picked; and vice versa. If there are many <m>s and <l>s then nothing is picked, since any alterations to any <l> or <m> in that case would affect other <l> + <m> combos that have not been picked. This function is useful for global deletions of a particular lexeme + morphological code pair.No variables, keys, functions, or named templates depend upon this xsl:function.Does not rely upon global variables, keys, functions, or templates.tan:get-matching-ls-or-ms()tan:get-matching-ls-or-ms($l-or-m-element as element()) as element()* Input: one <l> or one <m> Output: all matching combinations. If an <lm> has only one <l>/<m> then the entire <lm> is picked. Otherwise, it picks only the <l>/<m> that matches. This function is useful for global deletions of a particular lexeme or morphological codeNo variables, keys, functions, or named templates depend upon this xsl:function.Does not rely upon global variables, keys, functions, or templates.tan:obeyed-by-m()tan:obeyed-by-m($assert-or-report-prepped as element(), $m-element-prepped as element()?) as xs:boolean? Input: any TAN-LM <m> that has been prepped (i.e., has @orig-code and has children <f>); any TAN-mor <report> or <assert> Output: a boolean value indicating whether all the conditions made by the assert (or report) are true (false). Function assumes that all features have been space-normalized and rendered lowercase. This function is used primarily to pick out <assert>s and <report>s that an <m> violates Used by template ŧ prep-tan-lmRelies upon tan:feature-test-to-groupstan:matches .tan:prep-TAN-LM-doc-prepped()tan:prep-TAN-LM-doc-prepped($self-and-sources-class-2-prepped as document-node()*) as document-node()*Used by variable $self-and-sources-preppedRelies upon ŧ prep-tan-lm .tan:rebuild-ana-fragment()tan:rebuild-ana-fragment($tok-l-or-m-grouping-key as xs:string*) as element()* Takes any set of strings that are the result of tan:[tok/l/m]-grouping-key() and for each one returns a rebuilt fragment of the original <ana> upon which it is based. Useful for reconstructing fragments of documents after <xsl:for-each-group/> operations.No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon $sep-2$sep-1 .TAN-class-2-errors global variables, keys, and functions summarizedfunctionstan:group-tok-elements()tan:group-tok-elements($prepped-tok-elements as element()*) as element()Used by template ŧ TAN-A-div-errorsŧ class-2-errorsRelies upon tan:sequence-expand .TAN-class-1-and-2 global variables, keys, and functions summarizedvariables$char-reg-expDefinition: '\P{M}\p{M}*'Used by function tan:chop-string()Does not rely upon global variables, keys, functions, or templates.$soft-hyphenDefinition: ''Used by variable $special-end-div-charsDoes not rely upon global variables, keys, functions, or templates.$special-end-div-charsDefinition: ($zwj, $soft-hyphen)Used by variable $special-end-div-chars-regexUsed by function tan:normalize-div-text()Relies upon $zwj$soft-hyphen .$special-end-div-chars-regexDefinition: concat('[', string-join($special-end-div-chars, ''), ']$')Used by function tan:normalize-div-text()Relies upon $special-end-div-chars .$tokenization-nonspaceDefinition: $token-definitions-reserved[following-sibling::tan:name = 'nonspace']Used by function tan:remodel-div-ref()Relies upon $token-definitions-reserved .$zwjDefinition: ''Used by variable $special-end-div-charsDoes not rely upon global variables, keys, functions, or templates.functionstan:analyze-stats()tan:analyze-stats($arg as xs:anyAtomicType*) as element()? Takes a series of integers, doubles, or other numbers and returns basic statistics as attributes in a single element Used by function tan:merge-analyzed-stats()Does not rely upon global variables, keys, functions, or templates.tan:analyze-string-length()Option 1 (TAN-class-1-and-2-functions)tan:analyze-string-length($resolved-class-1-doc-or-fragment as item()*) as item()* One-parameter function of the two-parameter version below Used by variable $self-class-1-errors-markedUsed by function tan:remodel-div-ref() tan:analyze-string-length()Relies upon tan:analyze-string-length .Option 2 (TAN-class-1-and-2-functions)tan:analyze-string-length($resolved-class-1-doc-or-fragment as item()*, $mark-only-leaf-divs as xs:boolean) as item()* Input: any class-1 document or fragment; an indication whether string lengths should be added only to leaf divs, or to every div. Output: the same document, with @string-length and @string-pos added to every div 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 $special-end-div-chars that terminate a <div> not only will not be counted, but the assumed space that follows will also not be counted. On the other hand, the lack of a special character at the end means that the nominal space that follows a div will be included in both the length and the position. Thus input... <div type="m" n="1">abc­</div> <div type="m" n="2">def‍</div> <div type="m" n="3">ghi</div> <div type="m" n="4">xyz</div> ...presumes a raw joined text of "abcdefghi xyz ", and so becomes output: <div type="m" n="1" string-length="3" string-pos="1">abc­</div> <div type="m" n="2" string-length="3" string-pos="4">def‍</div> <div type="m" n="3" string-length="4" string-pos="7">ghi</div> <div type="m" n="4" string-length="4" string-pos="11">xyz</div> Used by variable $self-class-1-errors-markedUsed by function tan:remodel-div-ref() tan:analyze-string-length()Relies upon ŧ c1-stamp-string-lengthŧ c1-stamp-string-pos .tan:arabic-numerals()Option 1 (TAN-class-1-and-2-functions)tan:arabic-numerals($strings as xs:string*) as xs:string* Input: any strings that might be convertible to Arabic numerals, but of unknown format or type Output: Best-guess Arabic numeral equivalents, as strings. Roman numerals take precedence over alphabet numerals (that is, 'i' is interpreted as 1, not 9) Used by template ŧ prep-class-1Relies upon tan:strings-to-numeral-or-numeral-type .Option 2 (TAN-class-1-and-2-functions)tan:arabic-numerals($strings as xs:string*, $treat-ambiguous-a-or-i-type-as-roman-numeral as xs:boolean?) as xs:string* Input: any strings that might be convertible to Arabic numerals, plus the type they are known to conform to Output: Best-guess Arabic numeral equivalents, as strings. Used by template ŧ prep-class-1Relies upon tan:strings-to-numeral-or-numeral-type .tan:chop-string()tan:chop-string($input as xs:string?) as xs:string* Input: any string Output: that string chopped into a sequence of strings, following TAN rules about modifying characters Used by template ŧ mark-tok-charsŧ char-setupUsed by function tan:string-length()Relies upon $char-reg-exp .tan:div-to-div-transfer()tan:div-to-div-transfer($divs-with-content-to-be-transferred as element()*, $divs-to-be-infused-with-new-content as element()*) as element()* Input: (1) any set of divs with content to be transferred into the structure of (2) another set of divs. 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. 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). No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon tan:text-joinŧ c1-stamp-string-lengthŧ c1-stamp-string-posŧ infuse-tokenized-textŧ strip-all-attributes-except .tan:flatref()Option 1 (TAN-class-1-and-2-functions)tan:flatref($node as element()?) as xs:string? Simple, one-param function of the fuller one, below Used by template ŧ get-mismatched-textUsed by function tan:flatref() tan:get-ref-seq()Relies upon tan:flatref .Option 2 (TAN-class-1-and-2-functions)tan:flatref($node as element()?, $div-types-to-suppress as xs:string*, $div-ns-to-rename as element()*) as xs:string? Input: div node in a TAN-T(EI) document; truth value whether references that fit a number pattern should be converted to integers Output: string value concatenating the reference values from the topmost div ancestor to the node. This function assumes that @n has already been normalized per tan:resolve-doc(), which converts @ns to Arabic numerals wherever possible Used by template ŧ get-mismatched-textUsed by function tan:flatref() tan:get-ref-seq()Relies upon $separator-hierarchy .tan:get-n-types()tan:get-n-types($src-1st-da-resolved as document-node()*) as element()* Input: any class 1 TAN documents Calculates types of @n values per div type per source and div type 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. Used by template ŧ prep-class-2-doc-pass-2Relies upon tan:number-type$n-type .tan:get-src-skeleton()tan:get-src-skeleton($src-1st-da-prepped as document-node()*) as document-node()? one-parameter form of the master version below; it results in a merger of sources, but without text and empty leaf divs Used by function tan:prep-verbosely()Relies upon tan:merge-sources .tan:median()tan:median($numbers as xs:double*) as xs:double? Input: any sequence of numbers Output: the median value It is assumed that the input has already been sorted by tan:numbers-sorted() vel sim Used by function tan:outliers()Does not rely upon global variables, keys, functions, or templates.tan:merge-analyzed-stats()tan:merge-analyzed-stats($analyzed-stats as element()*, $add-stats as xs:boolean?) as element() Takes a group of elements that follow the pattern that results from tan:analyze-stats and synthesizes them into a single element. If $add-stats 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. Used by function tan:merge-sources() tan:synthesize-merged-group()Relies upon tan:errortan:analyze-stats .tan:merge-source-loop()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()? Input: a rough merge (the result of tan:merge-source()); 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) Output: a single document that joins sibling <div>s that share a common @ref. Further, if any statistics are present and $add-stats is true, then the matching attributes in merged <d>s are added or checked for differences, as required. If $add-stats is false then the statistics are subtracted (the head of the sequence minus the sum of the tail of the sequence) No special provision is made for the order of synthesized <div>s; to control for order, the input unmerged sources in every <div> should have an @r that specifies the relative rank (values 0 to 1) a div takes. The average of the @r's will be calculated in the merged <div>, so that sorting can take place. In some cases, that @r-avg can be misleading, since it excludes any outliers of @r (to avoid the undue influence of <div>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 <div>s should all be present. If, in the course of preparation, all the children <div>s of a <div> have been eliminated, because of <realign>s in a TAN-A-div file, the result is a hollow <div>, with neither <ver> nor <div> children. These are retained in the loop; if they are to be omitted, it should be done by whatever process handles these results. Used by function tan:merge-tan-a-div-prepped() tan:merge-sources() tan:merge-source-loop()Relies upon tan:merge-source-loopŧ synthesize-merged-sources .tan:merge-sources()Option 1 (TAN-class-1-and-2-functions)tan:merge-sources($src-1st-da-prepped as document-node()*, $keep-sources-in-order as xs:boolean?) as document-node()? 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 <ver src="[SOURCE NAME]"> to distinguish one version from the next Used by template ŧ class-1-errorsUsed by function tan:get-src-skeleton() tan:merge-sources()Relies upon tan:merge-sources .Option 2 (TAN-class-1-and-2-functions)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()? input: one or more prepped class 1 document (usually has @ref 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 output: a single document that merges the bodies of the input documents into a single structure based on the values of @ref This function is useful for determining orphan, defective, and complete <div>s, and in preparation of publishing TAN-A-div files. To that end, this function automatically handles <div>s that have been marked for realignment. 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. Used by template ŧ class-1-errorsUsed by function tan:get-src-skeleton() tan:merge-sources()Relies upon tan:merge-analyzed-statstan:merge-source-loopŧ prepare-class-1-doc-for-merge .tan:no-outliers()tan:no-outliers($numbers as xs:anyAtomicType*) as xs:anyAtomicType* Input: any sequence of numbers Output: the same sequence, without outliers Used by function tan:synthesize-merged-group()Relies upon tan:outliers .tan:normalize-div-text()tan:normalize-div-text($div-strings as xs:string*) as xs:string* Input: any sequence of strings 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. 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. Used by template ŧ compare-copiesŧ get-mismatched-textUsed by function tan:text-join()Relies upon $special-end-div-chars-regex .tan:number-sort()tan:number-sort($numbers as xs:anyAtomicType*) as xs:double* Input: any sequence of items Output: the same sequence, sorted with string numerals converted to numbers Used by function tan:outliers()Does not rely upon global variables, keys, functions, or templates.tan:number-type()tan:number-type($strings as xs:string*) as xs:string* Version of tan:strings-to-numeral-or-numeral-type() that fetches merely the numeral type Used by function tan:get-n-types()Relies upon tan:strings-to-numeral-or-numeral-type .tan:outliers()tan:outliers($numbers as xs:anyAtomicType*) as xs:anyAtomicType* Input: any sequence of numbers Output: outliers in the sequence, Used by function tan:no-outliers()Relies upon tan:number-sorttan:median .tan:string-length()tan:string-length($input as xs:string?) as xs:integer Input: any string Output: the number of characters in the string, as defined by TAN (i.e., modifiers are counted with the preceding base character) Used by template ŧ c1-stamp-string-lengthRelies upon tan:chop-string .tan:strings-to-numeral-or-numeral-type()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* 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) Output: the same number of strings, with the value of either the $n-type that is the first match or the Arabic numeral equivalent 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 - > 1-1) Used by function tan:arabic-numerals() tan:arabic-numerals() tan:number-type()Relies upon $n-typetan:rom-to-int$n-type-patterntan:aaa-to-inttan:letter-to-number .tan:synthesize-merged-group()tan:synthesize-merged-group($current-group as element()*, $add-stats as xs:boolean?) as element()? Input: a group of elements that share the same @ref; a parameter indicating whether stats, if present, should be added Output: a single element that merges the content of the grouped element This function is intended solely for the template synthesize-src-skeleton, to handle in identical ways content that has been chosen and ordered differently. Used by template ŧ synthesize-merged-sourcesRelies upon tan:merge-analyzed-statstan:no-outliers .tan:text-join()Option 1 (TAN-class-1-and-2-functions)tan:text-join($items as item()*) as xs:stringUsed by template ŧ c1-stamp-string-lengthŧ tokenize-prepped-class-1ŧ class-1-errorsUsed by function tan:text-join() tan:div-to-div-transfer() tan:compare-copies()Relies upon tan:text-join .Option 2 (TAN-class-1-and-2-functions)tan:text-join($items as item()*, $prep-end as xs:boolean) as xs:string Input: any number of elements, text nodes, or strings; a boolean indicating whether the end of the sequence should also be prepared Output: a single string that joins and normalizes them according to TAN rules: if the item is (1) a <tok> or <non-tok> that has following siblings or (2) the last leaf element and $prep-end is false then the bare text is used; otherwise the text return follows the rules of tan:normalize-div-text() If the second parameter is true, then the end of the resultant string is checked for special div-end characters Used by template ŧ c1-stamp-string-lengthŧ tokenize-prepped-class-1ŧ class-1-errorsUsed by function tan:text-join() tan:div-to-div-transfer() tan:compare-copies()Relies upon tan:normalize-div-texttan:normalize-text .TAN-key global variables, keys, and functions summarizedvariables$all-body-irisDefinition: $body//tan:IRIUsed by template ŧ tan-key-errorsRelies upon $body .TAN-class-2-and-3 global variables, keys, and functions summarizedfunctionstan:data-type-check()tan:data-type-check($item as item()?, $data-type as xs:string) as xs:boolean Input: an item and a string corresponding to a data type Output: a boolean indicating whether the item can be cast into that data type Used by template ŧ prep-tan-claimsDoes not rely upon global variables, keys, functions, or templates.tan:feature-test-to-groups()tan:feature-test-to-groups($attr-feature-test as xs:string?) as element()* Input: any value of @feature-test Output: the value converted into a series of <group>ed <item>s, observing the accepted syntax for this attribute Example: "a b + c" - > <group><item>a</item> </group><group><item>b</item><item>c</item> </group>Used by template ŧ prep-tan-morUsed by function tan:obeyed-by-m()Relies upon tan:normalize-text .tan:prep-TAN-claims()tan:prep-TAN-claims($TAN-docs-resolved as document-node()*) as document-node()* Input: resolved TAN documents that take claims Output: the same documents, marking <claim>s for errors Used by variable $self-preppedUsed by function tan:prep-resolved-tan-a-div-doc()Relies upon ŧ prep-tan-claims .tan:prep-TAN-mor()Option 1 (TAN-class-2-and-3-functions)tan:prep-TAN-mor($TAN-mor-docs-resolved as document-node()*) as document-node()* One-param version of the function below Used by variable $morphologies-preppedUsed by function tan:prep-TAN-mor()Relies upon $doc-id$inclusions-1st-datan:resolve-doctan:get-1st-doctan:prep-TAN-mor .Option 2 (TAN-class-2-and-3-functions)tan:prep-TAN-mor($TAN-mor-docs-resolved as document-node()*, $TAN-mor-doc-inclusions-resolved as document-node()*) as document-node()* Input: resolved TAN-mor documents Output: the same documents, after the inclusions have been resolved Used by variable $morphologies-preppedUsed by function tan:prep-TAN-mor()Relies upon ŧ prep-tan-mor .diff-for-xslt2 global variables, keys, and functions summarizedfunctionstan:diff()Option 1 (diff-for-xslt2)tan:diff($string1 as xs:string?, $string2 as xs:string?) as element() two-parameter version of the full version below. The stagger and diminishment factors are designed to get small as the length of the shortest string gets larger.Used by function tan:diff()Relies upon tan:diff .Option 2 (diff-for-xslt2)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() Input: any two strings. Output: The differences between the two strings in the form of:<diff><s1>[text unique to string 1]</s1><s2>[text unique to string 2]</s2><common>[text shared by both strings]</common> </diff> The algorithm is designed for XSLT 2, in which too many nested loops prove fatal, and with the assumption that the user could settle for a difference that finds a long common substring, and not perhaps the longest common substring.Used by function tan:diff()Relies upon tan:diff-loop .tan:diff-core()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()*Used by function tan:diff-loop() tan:diff-core()Relies upon tan:escapetan:diff-core .tan:diff-core-draft()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()*Used by function tan:diff-core-draft()Relies upon tan:escapetan:diff-core-draft .tan:diff-loop()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()*Used by function tan:diff() tan:diff-loop()Relies upon tan:diff-coretan:diff-loopŧ diff-rectify .tan:group-adjacent-elements()tan:group-adjacent-elements($elements as element()*) as element()* Input: any sequence of elements Output: the same elements, but adjacent elements of the same name grouped together Used by function tan:raw-diff()Does not rely upon global variables, keys, functions, or templates.tan:raw-diff()Option 1 (diff-for-xslt2)tan:raw-diff($string-a as xs:string?, $string-b as xs:string?) as element() 2-param version of fuller one below Used by template ŧ class-1-errorsUsed by function tan:raw-diff()Relies upon tan:raw-diff .Option 2 (diff-for-xslt2)tan:raw-diff($string-a as xs:string?, $string-b as xs:string?, $snap-to-word as xs:boolean) as element() Input: any two strings; boolean indicating whether results should snap to nearest word Output: an element with <a>, <b>, and <common> children showing where strings a and b match and depart 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. Used by template ŧ class-1-errorsUsed by function tan:raw-diff()Relies upon tan:raw-diff-looptan:group-adjacent-elementsŧ snap-to-word-pass-1 .tan:raw-diff-loop()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) Used by function tan:raw-diff() tan:raw-diff-loop()Relies upon tan:escapetan:raw-diff-loop .regex-ext-tan global variables, keys, and functions summarizedvariables$hex-keyDefinition: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'Used by function tan:dec-to-hex() tan:hex-to-dec()Does not rely upon global variables, keys, functions, or templates.functionstan:dec-to-hex()tan:dec-to-hex($in as xs:integer) as xs:string Change any integer into a hexadecimal string Input: xs:integer Output: hexadecimal equivalent as a string E.g., 31 - > '1F'Used by function tan:dec-to-hex()Relies upon tan:dec-to-hex$hex-key .tan:expand-search()tan:expand-search($regex as xs:string?) as xs:string? This function takes a string representation of a regular expression pattern and replaces every unescaped character with a character class that lists all Unicode characters that would recursively decompose to that base character. E.g., 'word' - > '[wŵʷẁẃẅẇẉẘⓦw𝐰𝑤𝒘𝓌𝔀𝔴𝕨𝖜𝗐𝘄𝘸𝙬𝚠][oºòóôõöōŏőơǒǫǭȍȏȫȭȯȱᵒṍṏṑṓọỏốồổỗộớờởỡợₒℴⓞ㍵o𝐨𝑜𝒐𝓸𝔬𝕠𝖔𝗈𝗼𝘰𝙤𝚘][rŕŗřȑȓʳᵣṙṛṝṟⓡ㎭㎮㎯r𝐫𝑟𝒓𝓇𝓻𝔯𝕣𝖗𝗋𝗿𝘳𝙧𝚛][dďdždzᵈḋḍḏḑḓⅆⅾⓓ㍲㍷㍸㍹㎗㏈d𝐝𝑑𝒅𝒹𝓭𝔡𝕕𝖉𝖽𝗱𝘥𝙙𝚍]' This function is useful for cases where it is more efficient to change the search term rather than to transform the text to be searched into base characters.No variables, keys, functions, or named templates depend upon this xsl:function.Relies upon tan:get-ucd-decomp$regex-escaping-characterstan:string-compositeŧ add-square-brackets .tan:get-ucd-decomp()tan:get-ucd-decomp() Used by function tan:string-base() tan:string-composite() tan:expand-search()Does not rely upon global variables, keys, functions, or templates.tan:hex-to-dec()tan:hex-to-dec($hex as xs:string?) as item()* Change any hexadecimal string into an integer E.g., '1F' - > 31Used by function tan:process-regex-escape-k()Relies upon $hex-key .tan:matches()Option 1 (regex-ext-tan-functions)tan:matches($input as xs:string?, $pattern as xs:string) as xs:boolean two-param function of the three-param version below Used by function tan:obeyed-by-m() tan:get-toks() tan:matches()Relies upon tan:matches .Option 2 (regex-ext-tan-functions)tan:matches($input as xs:string?, $pattern as xs:string, $flags as xs:string) as xs:boolean Parallel to fn:matches(), but converts TAN-exceptions into classes. See tan:regex() for details. Used by function tan:obeyed-by-m() tan:get-toks() tan:matches()Relies upon tan:regex .tan:process-regex-escape-k()tan:process-regex-escape-k($val-inside-braces as xs:string, $unicode-db as document-node()) as xs:string?Used by function tan:regex()Relies upon tan:hex-to-dec .tan:regex()tan:regex($regex as xs:string?) as xs:string? Input: string of a regex search Output: the same string, with TAN-reserved escape sequences replaced by characters class sequences E.g., '\k{.greek.capital.perispomeni}' - - > '[ἎἏἮἯἾἿὟὮὯᾎᾏᾞᾟᾮᾯ]' \k{.latin.cedilla} - - > '[ÇçĢģĶķĻļŅņŖŗŞşŢţȨȩᷗḈḉḐḑḜḝḨḩ]' 'angle \k{4d-4f, 51}' - - > 'angle [MNOQ]' This function grabs entire classes of Unicode characters either by their codepoint or by the parts of their name. It performs specially upon the form \k{***VALUE***}, where ***VALUE*** is either (1) one or more hexadecimal numbers joined by commas and hyphens or (2) one or more words each one prepended by a non-word character. In the first option, there will be returned every Unicode character that has been picked, filling in ranges where indicated by the hyphen. In the second option, there will be returned every Unicode character that has all of those words in its official Unicode name, or alias. Other examples: Any word with an omega, even if not in any of the Greek blocks: '\k{.omega}' (useful if you wish to find nonstandard uses of the omega, especially in the symbol block) Any word with two successive omegas, no matter their accentuation or capitalizaton, or if they have an iota subscript: '\k{.greek.omega}{2}' (useful for looking up a Greek word where accentuation changes depending upon context or inflection) Every Greek word that attracts an accent from an enclitic: '[\k{.greek.oxia}\k{.greek.tonos}\k{.greek.perispomeni}]\w*[\k{.greek.tonos}\k{.greek.oxia}]'Used by function tan:matches() tan:replace() tan:tokenize()Relies upon tan:process-regex-escape-kŧ add-square-brackets .tan:replace()Option 1 (regex-ext-tan-functions)tan:replace($input as xs:string?, $pattern as xs:string, $replacement as xs:string) as xs:string three-param function of the four-param version below Used by function tan:batch-replace() tan:replace()Relies upon tan:replace .Option 2 (regex-ext-tan-functions)tan:replace($input as xs:string?, $pattern as xs:string, $replacement as xs:string, $flags as xs:string) as xs:string Parallel to fn:replace(), but converts TAN-exceptions into classes. See tan:regex() for details. Used by function tan:batch-replace() tan:replace()Relies upon tan:regex .tan:string-base()tan:string-base($arg as xs:string?) as xs:string? This function takes any string and replaces every character with its base Unicode character. E.g., ἀνθρὠπους - > ανθρωπουσ This is useful for preparing text to be searched without respect to accentsNo variables, keys, functions, or named templates depend upon this xsl:function.Relies upon tan:get-ucd-decomp .tan:string-composite()tan:string-composite($arg as xs:string?) as xs:string? This function is the inverse of tan:string-base, in that it replaces every character with those Unicode characters that use it as a base. If none exist, then the character itself is returned. E.g., 'Max' - > 'MᴹḾṀṂℳⅯⓂ㎆㎒㎫㎹㎿㏁M𝐌𝑀𝑴𝓜𝔐𝕄𝕸𝖬𝗠𝘔𝙈𝙼🄼🅋🅪🅫aªàáâãäåāăąǎǟǡǻȁȃȧᵃḁẚạảấầẩẫậắằẳẵặₐ℀℁ⓐ㏂a𝐚𝑎𝒂𝒶𝓪𝔞𝕒𝖆𝖺𝗮𝘢𝙖𝚊xˣẋẍₓⅹⅺⅻⓧx𝐱𝑥𝒙𝓍𝔁𝔵𝕩𝖝𝗑𝘅𝘹𝙭𝚡' This is useful for preparing regex character classes to broaden a search. Used by function tan:expand-search()Relies upon tan:get-ucd-decomp .tan:tokenize()Option 1 (regex-ext-tan-functions)tan:tokenize($input as xs:string?, $pattern as xs:string) as xs:string* two-param function of the three-param version below Used by function tan:tokenize()Relies upon tan:tokenize .Option 2 (regex-ext-tan-functions)tan:tokenize($input as xs:string?, $pattern as xs:string, $flags as xs:string) as xs:string* Parallel to fn:tokenize(), but converts TAN-exceptions into classes. See tan:regex() for details. Used by function tan:tokenize()Relies upon tan:regex .templatesŦ prep-regex-char-classNo variables, keys, functions, or named templates depend upon this xsl:template.Does not rely upon global variables, keys, functions, or templates.TAN-schema global variables, keys, and functions summarizedvariables$rng-collectionDefinition: $schema-collection[rng:*]Used by variable $rng-collection-without-TEI$TAN-elements-that-take-the-attribute-whichUsed by function tan:get-parent-elements()Relies upon $schema-collection .$rng-collection-without-TEIDefinition: $rng-collection[not(matches(base-uri(.), 'TAN-TEI'))]Used by variable $TAN-elements-that-take-the-attribute-whichUsed by function tan:get-parent-elements()Relies upon $rng-collection .$schema-collectionDefinition: collection('../../schemas/collection.xml')Used by variable $rng-collectionDoes not rely upon global variables, keys, functions, or templates.$TAN-elements-that-take-the-attribute-whichDefinition: tan:get-parent-elements($rng-collection-without-TEI/rng:grammar/rng:define[rng:attribute/@name = 'which'])Used by template ŧ tan-key-errorsRelies upon tan:get-parent-elements$rng-collection-without-TEI .functionstan:get-parent-elements()tan:get-parent-elements($current-elements as element()*) as element()* requires as input some rng: element from $rng-collection, oftentimes an rng:element or rng:attribute Used by variable $TAN-elements-that-take-the-attribute-whichUsed by function tan:get-parent-elements()Relies upon $rng-collection-without-TEItan:get-parent-elements .Mode templatesTemplates based on modes are frequently found across constituent
files, so they are collated here separately, one entry per mode.ŧ #all1 element: TAN-core-functions.xsl We ignore, but retain, tails throughout No variables, keys, functions, or named templates depend upon this xsl:template.Does not rely upon global variables, keys, functions, or templates.ŧ add-lm-to-tok2 elements: TAN-class-2-functions.xsl Used by template ŧ add-lm-to-tokUsed by function tan:get-src-1st-da-with-lms()Relies upon ŧ add-lm-to-tok .ŧ add-square-brackets2 elements: regex-ext-tan-functions.xsl Used by function tan:expand-search() tan:regex()Does not rely upon global variables, keys, functions, or templates.ŧ add-tok-val2 elements: TAN-LM-functions.xsl Used by function tan:add-tok-val()Does not rely upon global variables, keys, functions, or templates.ŧ analysis-stamp4 elements: TAN-A-tok-functions.xsl TAN-class-2-functions.xsl Used by template ŧ analysis-stampŧ analysis-stampUsed by function tan:get-src-1st-da-analysis-stamped()Relies upon ŧ analysis-stamp .ŧ analyze-ref2 elements: TAN-class-2-functions.xsl Used by function tan:analyze-ref()Does not rely upon global variables, keys, functions, or templates.ŧ arabic-numerals5 elements: TAN-class-1-and-2-functions.xsl TAN-class-2-functions.xsl TAN-core-functions.xsl The companion <xsl:template> to this, treating *[@ref], is in TAN-class-2-functions <xsl:param name="treat-ambiguous-a-or-i-type-as-roman-numeral" as="xs:boolean?" tunnel="yes"/><xsl:param name="warn-on-ambiguous-numerals" as="xs:boolean?" tunnel="yes"/> For the companion template, treating *[@n], see TAN-class-1-and-2-functions Used by template ŧ arabic-numeralsŧ arabic-numeralsUsed by function tan:resolve-doc()Relies upon $n-typeŧ arabic-numeralstan:normalize-text$separator-hierarchytan:analyze-elements-with-numeral-attributestan:error .ŧ c1-add-ref1 element: TAN-class-1-functions.xsl Used by template ŧ mark-splitsUsed by function tan:compare-copies() tan:mark-splits()Does not rely upon global variables, keys, functions, or templates.ŧ c1-stamp-string-length3 elements: TAN-class-1-and-2-functions.xsl Used by template ŧ class-1-errorsUsed by function tan:remodel-div-ref() tan:div-to-div-transfer() tan:analyze-string-length()Relies upon tan:string-lengthtan:text-join .ŧ c1-stamp-string-pos1 element: TAN-class-1-and-2-functions.xsl Used by template ŧ class-1-errorsUsed by function tan:div-to-div-transfer() tan:analyze-string-length()Does not rely upon global variables, keys, functions, or templates.ŧ char-setup3 elements: TAN-class-2-functions.xsl Used by template ŧ char-setupUsed by function tan:get-src-1st-da-chars-picked() tan:analyze-tok-chars()Relies upon tan:chop-stringŧ char-setup .ŧ class-1-copy-errors3 elements: TAN-class-1-errors.xsl TAN-core-errors.xsl Used by variable $self-class-1-errors-markedUsed by template ŧ class-1-copy-errorsRelies upon tan:errorŧ class-1-copy-errors .ŧ class-1-errors5 elements: TAN-class-1-errors.xsl TAN-core-errors.xsl Used by variable $self-class-1-errors-markedUsed by template ŧ class-1-errorsŧ class-1-errorsŧ class-1-errorsRelies upon tan:errorŧ class-1-errors$see-alsos-resolvedŧ c1-stamp-string-posŧ c1-stamp-string-length$self-leaf-div-flatref-duplicatestan:normalize-texttan:has-relationship$self-preppedtan:merge-sourcestan:raw-difftan:text-jointan:prep-resolved-class-1-doctan:get-1st-doctan:resolve-doc .ŧ class-2-errors3 elements: TAN-class-2-errors.xsl Used by template ŧ class-2-errorsŧ class-2-errorsŧ class-2-errorsUsed by function tan:prep-resolved-class-2-doc()Relies upon tan:group-tok-elementstan:errorŧ class-2-errors .ŧ compare-copies2 elements: TAN-class-1-functions.xsl Used by template ŧ mark-splitsUsed by function tan:compare-copies() tan:mark-splits()Relies upon tan:escapetan:normalize-div-text .ŧ convert-code-to-features2 elements: TAN-LM-functions.xsl Used by function tan:expand-per-lm() tan:convert-code-to-features()Relies upon $morphologies-prepped .ŧ copy-of-except2 elements: TAN-core-functions.xsl Used by template ŧ strip-all-attributes-exceptŧ strip-specific-attributesŧ strip-textUsed by function tan:div-to-div-transfer() tan:copy-of-except() tan:stamp-id()Does not rely upon global variables, keys, functions, or templates.ŧ core-attribute-errors3 elements: TAN-core-errors.xsl Used by variable $self-class-1-errors-marked$self-core-errors-markedUsed by template ŧ class-1-errorsŧ class-1-errorsŧ class-1-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-attribute-errorsŧ referenced-doc-errorsRelies upon $duplicate-idsŧ core-attribute-errorstan:dateTime-to-decimaltan:error$doc-uritan:uri-relative-to$now$all-idstan:fixtan:help$headtan:normalize-text$id-idrefstan:help-requested .ŧ core-errors11 elements: TAN-core-errors.xsl Used by variable $self-class-1-errors-marked$self-core-errors-markedUsed by template ŧ class-1-errorsŧ class-1-errorsŧ class-1-errorsŧ class-1-copy-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ referenced-doc-errorsRelies upon tan:error$sources-resolved$rootŧ core-errors$duplicate-iristan:must-refer-to-external-tan-file$doc-namespace$primary-agenttan:idrefstan:info$doc-id$headtan:normalize-text$keys-1st-datan:dateTime-to-decimaltan:get-doc-histtan:has-relationship$empty-doctan:class-numbertan:get-1st-doctan:resolve-doc$see-alsos-resolved$regex-characters-not-permitted$keys-resolved$inclusions-resolved$TAN-keywords$doc-uri .ŧ count-tokenized-class-12 elements: TAN-A-div-functions.xsl Used by template ŧ count-tokenized-class-1ŧ count-tokenized-class-1Used by function tan:get-src-1st-da-statted()Relies upon ŧ count-tokenized-class-1 .ŧ count-tokens3 elements: TAN-core-functions.xsl Used by function tan:tokenize-leaf-div()Does not rely upon global variables, keys, functions, or templates.ŧ cull-prepped-class-11 element: TAN-class-2-functions.xsl Used by function tan:cull-prepped-class-1-data()Does not rely upon global variables, keys, functions, or templates.ŧ diff-rectify3 elements: diff-for-xslt2.xsl Used by template ŧ diff-rectifyUsed by function tan:diff-loop()Relies upon ŧ diff-rectify .ŧ drop-tokenization3 elements: TAN-A-div-functions.xsl Used by function tan:merge-tan-a-div-prepped() tan:remodel-div-ref() tan:process-splits()Does not rely upon global variables, keys, functions, or templates.ŧ expand-lm2 elements: TAN-LM-functions.xsl Used by function tan:expand-per-lm() tan:convert-code-to-features()Relies upon tan:get-lm-ids .ŧ first-stamp2 elements: TAN-core-functions.xsl The first-stamp mode ensures that when a document is handed over to a variable, the original document URI is not lost. It also provides (1) the breadcrumbing service, so that errors occurring downstream, in an inclusion or TAN-key file can be diagnosed, and (2) the option for @src to be imprinted on the root element, so that a class 1 TAN file can be tethered to a class 2 file that uses it as a source.Used by function tan:resolve-doc()Relies upon tan:base-uri .ŧ fragment-to-text3 elements: TAN-core-errors.xsl Used by function tan:fragment-to-text()Does not rely upon global variables, keys, functions, or templates.ŧ get-div-hierarchy-fragment4 elements: TAN-class-2-functions.xsl Used by template ŧ insert-seg-into-leaf-divs-in-hierarchy-fragmentŧ prep-class-2-doc-pass-2ŧ get-div-hierarchy-fragmentUsed by function tan:prep-resolved-class-2-doc() tan:expand-src-and-div-type-ref() tan:prep-class-2-doc-pass-2() tan:prep-class-2-doc-pass-3() tan:prep-class-2-doc-pass-4()Relies upon ŧ get-div-hierarchy-fragment .ŧ get-mismatched-text2 elements: TAN-class-1-functions.xsl Used by template ŧ mark-splitsUsed by function tan:compare-copies() tan:mark-splits()Relies upon tan:normalize-div-texttan:flatref .ŧ include1 element: TAN-core-functions.xsl Used by variable $self-prepped$TAN-keywords$keys-preppedUsed by template ŧ arabic-numeralsŧ arabic-numeralsUsed by function tan:resolve-doc() tan:glossary() tan:strip-duplicates() tan:resolve-keyword()Does not rely upon global variables, keys, functions, or templates.ŧ infuse-tokenized-div2 elements: TAN-class-1-and-2-functions.xsl Used by template ŧ class-1-errorsUsed by function tan:remodel-div-ref() tan:div-to-div-transfer() tan:analyze-string-length()Does not rely upon global variables, keys, functions, or templates.ŧ infuse-tokenized-text2 elements: TAN-class-1-and-2-functions.xsl Used by template ŧ class-1-errorsUsed by function tan:remodel-div-ref() tan:div-to-div-transfer() tan:analyze-string-length()Does not rely upon global variables, keys, functions, or templates.ŧ insert-seg-into-leaf-divs-in-hierarchy-fragment4 elements: TAN-A-div-functions.xsl TAN-class-2-functions.xsl Used by template ŧ insert-seg-into-leaf-divs-in-hierarchy-fragmentRelies upon tan:errortan:sequence-expandŧ insert-seg-into-leaf-divs-in-hierarchy-fragment .ŧ mark-splits2 elements: TAN-class-1-functions.xsl Used by template ŧ mark-splitsUsed by function tan:compare-copies() tan:mark-splits()Relies upon ŧ mark-splits .ŧ mark-splits-in-fragment3 elements: TAN-A-div-functions.xsl Used by function tan:merge-tan-a-div-prepped() tan:remodel-div-ref() tan:process-splits()Does not rely upon global variables, keys, functions, or templates.ŧ mark-tok-chars2 elements: TAN-class-2-functions.xsl Used by function tan:expand-tok()Relies upon tan:chop-stringtan:sequence-expandtan:sequence-error .ŧ normalize-space2 elements: TAN-class-1-functions.xsl Used by function tan:normalize-doc-space()Does not rely upon global variables, keys, functions, or templates.ŧ pick-prepped-class-11 element: TAN-class-2-functions.xsl Used by function tan:pick-prepped-class-1-data()Does not rely upon global variables, keys, functions, or templates.ŧ pluck3 elements: TAN-core-functions.xsl Used by function tan:pluck()Does not rely upon global variables, keys, functions, or templates.ŧ prep-class-18 elements: TAN-class-1-and-2-functions.xsl Homogenize tei:TEI to tan:TAN-T Makes sure the tei:body rises rootward one level, as is customary in TAN and HTML Used by function tan:prep-resolved-class-1-doc()Relies upon $separator-hierarchytan:errortan:arabic-numeralstan:helptan:help-requestedtan:normalize-text .ŧ prep-class-2-doc-pass-16 elements: TAN-class-2-functions.xsl This template takes an element that allows @src, supplies it if it doesn't exist, then iterates that element across multiple values of @src; this excludes elements that use @work, i.e., <div-ref>, which are resolved only after works are equated and resolved Used by template ŧ insert-seg-into-leaf-divs-in-hierarchy-fragmentŧ prep-class-2-doc-pass-2ŧ get-div-hierarchy-fragmentUsed by function tan:prep-resolved-class-2-doc() tan:expand-src-and-div-type-ref() tan:prep-class-2-doc-pass-2() tan:prep-class-2-doc-pass-3() tan:prep-class-2-doc-pass-4()Relies upon tan:normalize-texttan:help-requestedtan:help .ŧ prep-class-2-doc-pass-26 elements: TAN-class-2-functions.xsl <xsl:param name="src-docs" as="document-node()*" tunnel="yes"/>Used by template ŧ insert-seg-into-leaf-divs-in-hierarchy-fragmentŧ prep-class-2-doc-pass-2ŧ get-div-hierarchy-fragmentUsed by function tan:prep-resolved-class-2-doc() tan:expand-src-and-div-type-ref() tan:prep-class-2-doc-pass-2() tan:prep-class-2-doc-pass-3() tan:prep-class-2-doc-pass-4()Relies upon tan:errorŧ prep-class-2-doc-pass-2tan:get-n-typestan:helptan:help-requestedtan:normalize-text .ŧ prep-class-2-doc-pass-33 elements: TAN-class-2-functions.xsl Used by template ŧ insert-seg-into-leaf-divs-in-hierarchy-fragmentŧ prep-class-2-doc-pass-2ŧ get-div-hierarchy-fragmentUsed by function tan:prep-resolved-class-2-doc() tan:expand-src-and-div-type-ref() tan:prep-class-2-doc-pass-2() tan:prep-class-2-doc-pass-3() tan:prep-class-2-doc-pass-4()Relies upon tan:normalize-texttan:help-requestedtan:convert-ref-to-div-fragment .ŧ prep-class-2-doc-pass-3-old2 elements: TAN-class-2-functions.xsl Used by template ŧ insert-seg-into-leaf-divs-in-hierarchy-fragmentŧ prep-class-2-doc-pass-2ŧ get-div-hierarchy-fragmentUsed by function tan:prep-resolved-class-2-doc() tan:expand-src-and-div-type-ref() tan:prep-class-2-doc-pass-2() tan:prep-class-2-doc-pass-3() tan:prep-class-2-doc-pass-4()Does not rely upon global variables, keys, functions, or templates.ŧ prep-class-2-doc-pass-43 elements: TAN-class-2-functions.xsl Used by template ŧ insert-seg-into-leaf-divs-in-hierarchy-fragmentŧ prep-class-2-doc-pass-2ŧ get-div-hierarchy-fragmentUsed by function tan:prep-resolved-class-2-doc() tan:expand-src-and-div-type-ref() tan:prep-class-2-doc-pass-2() tan:prep-class-2-doc-pass-3() tan:prep-class-2-doc-pass-4()Relies upon tan:expand-tok .ŧ prep-rim-pass-13 elements: TAN-class-2-functions.xsl Used by function tan:get-context-prepped()Does not rely upon global variables, keys, functions, or templates.ŧ prep-rim-pass-22 elements: TAN-class-2-functions.xsl Used by function tan:get-context-prepped()Does not rely upon global variables, keys, functions, or templates.ŧ prep-srcs-verbosely1 element: TAN-A-div-functions.xsl Used by template ŧ prep-verbosely prep-srcs-verboselyUsed by function tan:prep-verbosely()Relies upon ŧ prep-verbosely .ŧ prep-tan-a-div-pass-3-prelim2 elements: TAN-class-2-functions.xsl Used by template ŧ insert-seg-into-leaf-divs-in-hierarchy-fragmentŧ prep-class-2-doc-pass-2ŧ get-div-hierarchy-fragmentUsed by function tan:prep-resolved-class-2-doc() tan:expand-src-and-div-type-ref() tan:prep-class-2-doc-pass-2() tan:prep-class-2-doc-pass-3() tan:prep-class-2-doc-pass-4()Does not rely upon global variables, keys, functions, or templates.ŧ prep-tan-a-div-pass-a7 elements: TAN-A-div-functions.xsl goal: flag errors in @seg; if it's a <realign>, make a copy of the entire <div> We make a copy of the referenced <div> only if it is a <realign>, so that we can save work for a later process that adjusts the sources Used by function tan:prep-resolved-tan-a-div-doc() tan:get-src-1st-da-segmented()Relies upon tan:helptan:errortan:help-requestedtan:sequence-errortan:sequence-expand .ŧ prep-tan-a-div-pass-b2 elements: TAN-A-div-functions.xsl Goal: redistribute contents of aligns and realigns Used by function tan:prep-resolved-tan-a-div-doc() tan:get-src-1st-da-segmented()Relies upon tan:errortan:value-of .ŧ prep-tan-claims3 elements: TAN-class-2-and-3-functions.xsl Used by variable $self-preppedUsed by template ŧ prep-tan-morŧ prep-tan-morŧ prep-tan-morUsed by function tan:prep-TAN-claims() tan:prep-TAN-mor()Relies upon tan:errortan:data-type-check .ŧ prep-tan-key2 elements: TAN-core-functions.xsl Used by variable $self-prepped$TAN-keywords$keys-preppedUsed by template ŧ arabic-numeralsŧ arabic-numeralsUsed by function tan:resolve-doc() tan:glossary() tan:strip-duplicates() tan:resolve-keyword()Relies upon tan:normalize-text .ŧ prep-tan-lm3 elements: TAN-LM-functions.xsl Used by template ŧ prep-tan-lmUsed by function tan:prep-TAN-LM-doc-prepped()Relies upon $morphologies-preppedŧ prep-tan-lmtan:normalize-texttan:errortan:obeyed-by-mtan:help-requestedtan:escape .ŧ prep-tan-mor4 elements: TAN-class-2-and-3-functions.xsl Used by variable $self-preppedUsed by template ŧ prep-tan-morŧ prep-tan-morŧ prep-tan-morUsed by function tan:prep-TAN-claims() tan:prep-TAN-mor()Relies upon tan:normalize-textŧ prep-tan-mor$inclusions-resolvedtan:errortan:sequence-expandtan:feature-test-to-groupstan:duplicate-values .ŧ prep-verbosely4 elements: TAN-A-div-functions.xsl Used by template ŧ prep-verbosely prep-srcs-verboselyUsed by function tan:prep-verbosely()Relies upon tan:info$sources-preppedtan:duplicate-valuestan:errorŧ prep-verbosely .ŧ prepare-class-1-doc-for-merge7 elements: TAN-class-1-and-2-functions.xsl This template is long, because it deals with cases where individual <div>s have been realigned by a TAN-A-div file. <div>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 Used by function tan:prep-tan-a-div-sources-for-merge() tan:merge-sources()Does not rely upon global variables, keys, functions, or templates.ŧ prepend-id-or-idrefs1 element: TAN-core-functions.xsl Used by function tan:prepend-id-or-idrefs()Relies upon $id-idrefs .ŧ process-splits3 elements: TAN-A-div-functions.xsl Used by function tan:merge-tan-a-div-prepped() tan:remodel-div-ref() tan:process-splits()Does not rely upon global variables, keys, functions, or templates.ŧ realign-tan-a-div-sources1 element: TAN-A-div-functions.xsl Used by function tan:prep-resolved-tan-a-div-doc() tan:get-src-1st-da-segmented()Does not rely upon global variables, keys, functions, or templates.ŧ referenced-doc-errors3 elements: TAN-core-errors.xsl Used by variable $self-class-1-errors-marked$self-core-errors-markedUsed by template ŧ class-1-errorsŧ class-1-errorsŧ class-1-errorsŧ class-1-copy-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ core-errorsŧ referenced-doc-errorsRelies upon $errorsŧ referenced-doc-errors .ŧ resolve-attr-include2 elements: TAN-core-functions.xsl Used by variable $self-prepped$TAN-keywords$keys-preppedUsed by template ŧ arabic-numeralsŧ arabic-numeralsUsed by function tan:resolve-doc() tan:glossary() tan:strip-duplicates() tan:resolve-keyword()Relies upon tan:normalize-texttan:prepend-id-or-idrefstan:error .ŧ resolve-href2 elements: TAN-core-functions.xsl Used by variable $self-prepped$TAN-keywords$keys-preppedUsed by template ŧ arabic-numeralsŧ arabic-numeralsUsed by function tan:resolve-doc() tan:glossary() tan:strip-duplicates() tan:resolve-keyword()Relies upon tan:base-uri .ŧ resolve-keyword2 elements: TAN-core-functions.xsl Used by variable $self-prepped$TAN-keywords$keys-preppedUsed by template ŧ arabic-numeralsŧ arabic-numeralsUsed by function tan:resolve-doc() tan:glossary() tan:strip-duplicates() tan:resolve-keyword()Relies upon tan:normalize-texttan:error$help-trigger-regextan:helptan:glossary .ŧ segment-tokd-prepped-class-12 elements: TAN-A-div-functions.xsl Used by function tan:prep-resolved-tan-a-div-doc() tan:get-src-1st-da-segmented()Relies upon tan:duplicate-valuestan:error .ŧ snap-to-word-pass-12 elements: diff-for-xslt2.xsl Used by function tan:raw-diff()Does not rely upon global variables, keys, functions, or templates.ŧ split-marked-fragment1 element: TAN-A-div-functions.xsl No variables, keys, functions, or named templates depend upon this xsl:template.Does not rely upon global variables, keys, functions, or templates.ŧ stamp-element-id2 elements: TAN-core-functions.xsl Used by template ŧ strip-all-attributes-exceptŧ strip-specific-attributesŧ strip-textUsed by function tan:div-to-div-transfer() tan:copy-of-except() tan:stamp-id()Does not rely upon global variables, keys, functions, or templates.ŧ strip-all-attributes-except2 elements: TAN-core-functions.xsl Used by template ŧ strip-all-attributes-exceptŧ strip-specific-attributesŧ strip-textUsed by function tan:div-to-div-transfer() tan:copy-of-except() tan:stamp-id()Relies upon ŧ strip-all-attributes-except .ŧ strip-duplicates2 elements: TAN-core-functions.xsl Used by variable $self-prepped$TAN-keywords$keys-preppedUsed by template ŧ arabic-numeralsŧ arabic-numeralsUsed by function tan:resolve-doc() tan:glossary() tan:strip-duplicates() tan:resolve-keyword()Does not rely upon global variables, keys, functions, or templates.ŧ strip-specific-attributes2 elements: TAN-core-functions.xsl Used by template ŧ strip-all-attributes-exceptŧ strip-specific-attributesŧ strip-textUsed by function tan:div-to-div-transfer() tan:copy-of-except() tan:stamp-id()Relies upon ŧ strip-specific-attributes .ŧ strip-text2 elements: TAN-core-functions.xsl Used by template ŧ strip-all-attributes-exceptŧ strip-specific-attributesŧ strip-textUsed by function tan:div-to-div-transfer() tan:copy-of-except() tan:stamp-id()Relies upon ŧ strip-text .ŧ synthesize-merged-sources3 elements: TAN-class-1-and-2-functions.xsl Used by template ŧ synthesize-merged-sourcesUsed by function tan:merge-source-loop()Relies upon tan:synthesize-merged-groupŧ synthesize-merged-sources .ŧ TAN-A-div-errors4 elements: TAN-A-div-errors.xsl Used by template ŧ TAN-A-div-errorsUsed by function tan:prep-resolved-tan-a-div-doc()Relies upon tan:group-tok-elementstan:duplicate-valuestan:errorŧ TAN-A-div-errors .ŧ tan-a-div-merge-pass14 elements: TAN-A-div-functions.xsl We assume that the user of the resultant file wants little or no recourse to the original source files, so we add select metadata Used by function tan:merge-tan-a-div-prepped() tan:remodel-div-ref() tan:process-splits()Does not rely upon global variables, keys, functions, or templates.ŧ tan-key-errors6 elements: TAN-key-functions.xsl Used by variable $self-preppedRelies upon $TAN-elements-that-take-the-attribute-whichtan:error$all-body-iris$TAN-namespace$TAN-keywordstan:normalize-text .ŧ tokenize-prepped-class-12 elements: TAN-class-2-functions.xsl tan:ver is part of the calculus, because of TAN-A-div merges, which require the introduction of <ver> at the leafmost parts of a document Used by function tan:remodel-div-ref() tan:get-src-1st-da-tokenized() tan:tokenize-div()Relies upon tan:copy-of-excepttan:text-jointan:tokenize-leaf-div .ŧ unconsolidate-anas3 elements: TAN-class-2-functions.xsl Used by template ŧ unconsolidate-anasUsed by function tan:unconsolidate-tan-lm()Relies upon tan:normalize-refstan:sequence-expandŧ unconsolidate-anas .Cross-format global variablesGlobal variables that straddle different files in the TAN function
library.$self-and-sources-prepped3 elements: TAN-A-div-functions.xsl TAN-A-tok-functions.xsl TAN-LM-functions.xsl Used by variable $self-and-sources-prepped$self-prepped$sources-preppedUsed by function tan:prep-resolved-tan-a-div-doc()Relies upon tan:prep-resolved-tan-a-div-doc$self-core-errors-marked$self-and-sources-prepped-prelimtan:prep-resolved-class-2-doctan:prep-TAN-LM-doc-prepped .$self-prepped7 elements: TAN-A-div-functions.xsl TAN-A-tok-functions.xsl TAN-c-functions.xsl TAN-key-functions.xsl TAN-LM-functions.xsl TAN-mor-functions.xsl TAN-class-1-functions.xsl Used by variable $self-leaf-div-flatrefs$self-class-1-errors-markedUsed by template ŧ class-1-errorsRelies upon $self-core-errors-markedŧ prep-tan-mor$self-and-sources-preppedŧ tan-key-errorsŧ prep-tan-keytan:prep-resolved-class-1-doctan:prep-TAN-claims .$sources-prepped3 elements: TAN-A-div-functions.xsl TAN-A-tok-functions.xsl TAN-LM-functions.xsl Used by template ŧ prep-verboselyŧ prep-class-2-doc-pass-3Used by function tan:merge-sources() tan:prep-class-2-doc-pass-3()Relies upon $self-and-sources-prepped .Cross-format functionsSome functions are defined differently according to different TAN formats.tan:prep-resolved-class-1-doc()2 elements: TAN-class-1-and-2-functions.xsl TAN-class-1-functions.xsl Input: sequence of resolved class 1 TAN documents Output: sequence of documents with these changes: /* - > add @work = "[DIGIT TAKEN FROM TAN-A-div //tan:group[tan:work]/@id]" tei:TEI - > tan:TAN-T tei:text/tei:body - > tan:body tei:div - > tan:div <div [copy of @*] ref="[NORMALIZED, FLAT REF WITH N SUBSTITUTIONS AND SUPPRESSIONS]">[COPY OF TEXT][SECOND COPY INSIDE TEI MARKUP, IF ANY]</div> Text remains untokenized. Any <div> with an @n with a range will be replicated as it is, but will be followed by empty <div>s with simple forms of @n and a @see that points to the ref of the original The one-parameter version points to the master function kept in TAN-class-1-and-2-functions.xsl Used by variable $self-preppedUsed by template ŧ class-1-errorsUsed by function tan:prep-resolved-class-1-doc() tan:mark-splits() tan:prep-resolved-class-2-doc() tan:get-context-prepped()Relies upon tan:prep-resolved-class-1-docŧ prep-class-1 .