TAN-A-div global variables, keys, and functions summarized

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-merge tan:merge-source-loop tan:copy-of-except ŧ tan-a-div-merge-pass1 .

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-prepped

Relies upon $self-and-sources-prepped-prelim tan:get-src-1st-da-segmented tan:prep-TAN-claims ŧ prep-tan-a-div-pass-a ŧ prep-tan-a-div-pass-b ŧ TAN-A-div-errors .

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: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-length $tokenization-nonspace tan:process-splits ŧ tokenize-prepped-class-1 ŧ mark-splits-in-fragment ŧ infuse-tokenized-div .