TAN-class-1 global variables, keys, and functions summarized

Definition: $token-definitions-reserved[following-sibling::tan:name = 'nonspace']

No variables, keys, functions, or named templates depend upon this xsl:variable.

Relies upon $token-definitions-reserved .

Looks for elements matching tan:div

Used by template ŧ class-2-expansion-terse

Does not rely upon global variables, keys, functions, or templates.

Option 1 (TAN-class-1-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 function tan:analyze-string-length()

Relies upon tan:analyze-string-length .

Option 2 (TAN-class-1-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 element

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&#xad;</div>

<div type="m" n="2">def&#x200d;</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&#xad;</div>

<div type="m" n="2" string-length="3" string-pos="4">def&#x200d;</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>

This function does the same thing as tan:analyze-leaf-div-string-length(), but approaches the problem in a two-template cycle, instead of a loop

Used by function tan:analyze-string-length()

Relies upon ŧ analyze-string-length-pass-1 ŧ analyze-string-length-pass-2 .

Option 1 (TAN-class-1-functions)

tan:merge-divs($expanded-class-1-fragment as item()*) as item()*

See fuller version below

Used by template ŧ reset-hierarchy

Used by function tan:merge-divs() tan:merge-divs()

Relies upon tan:merge-divs .

Option 2 (TAN-class-1-functions)

tan:merge-divs($expanded-class-1-fragment as item()*, $itemize-leaf-divs as xs:boolean) as item()*

See fuller version below

Used by template ŧ reset-hierarchy

Used by function tan:merge-divs() tan:merge-divs()

Relies upon tan:merge-divs .

Option 3 (TAN-class-1-functions)

tan:merge-divs($expanded-class-1-fragment as item()*, $itemize-leaf-divs as xs:boolean, $exclude-elements-with-duplicate-values-of-what-attribute as xs:string?, $keep-last-duplicate as xs:boolean?) as item()*

Input: expanded class 1 document fragment whose individual <div>s are assumed to be in the proper hierarchy (result of tan:normalize-text-hierarchy()); a boolean indicating whether leaf divs should be itemized; an optional string representing the name of an attribute to be checked for duplicates

Output: the fragment with the <div>s grouped according to their <ref> values

If the 2nd parameter is true, for each leaf <div> in a group there will be a separate <div type="#version">; otherwise leaf divs will be merely copied

For merging multiple files normally the value should be true; if they are misfits from a single source, false

Used by template ŧ reset-hierarchy

Used by function tan:merge-divs() tan:merge-divs()

Relies upon ŧ merge-divs .

tan:tokenize-div($divs as element()*, $token-definitions as element(tan:token-definition)) 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-div .