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-include
Relies upon ŧ prepend-id-or-idrefs
.
Option 1 (TAN-core-resolve-functions)
tan:resolve-doc($TAN-documents as document-node()*) as document-node()*
one-parameter version of the fuller one, below
Used by variable $self-resolved
$inclusions-resolved
$keys-resolved
$sources-resolved
$see-alsos-resolved
$morphologies-resolved
Used by template ŧ class-1-expansion-verbose
ŧ check-referred-doc
ŧ core-expansion-terse
ŧ core-expansion-verbose
Used by function tan:expand-doc
() tan:resolve-doc
() tan:resolve-doc
()
Relies upon tan:resolve-doc
.
Option 2 (TAN-core-resolve-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:
a. Stamp each document with @base-uri
and the optional root attribute; resolve @href
, putting the original (if different) in @orig-href
b. 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
c. Resolve every element that has @include.
d. Resolve every element that has @which.
e. 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 $self-resolved
$inclusions-resolved
$keys-resolved
$sources-resolved
$see-alsos-resolved
$morphologies-resolved
Used by template ŧ class-1-expansion-verbose
ŧ check-referred-doc
ŧ core-expansion-terse
ŧ core-expansion-verbose
Used by function tan:expand-doc
() tan:resolve-doc
() tan:resolve-doc
()
Relies upon tan:strip-duplicates
ŧ resolve-keyword
tan:normalize-text
ŧ expand-tan-key-dependencies
ŧ resolve-attr-include
ŧ core-resolution-arabic-numerals
ŧ first-stamp
tan:get-1st-doc
tan:resolve-doc
tan:error
.
tan:resolve-href($items-with-href-attribute as item()*) as xs:string*
Input: any elements that have @href
Output: @href
values resolved, as strings
Used by function tan:first-loc-available
() tan:get-1st-doc
()
Relies upon ŧ resolve-href
.
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.
This function is applied during document resolution, to prune duplicate elements that might have been included
Used by function tan:resolve-doc
()
Relies upon ŧ strip-duplicates
.