TAN-extra-functions
Definition: tan:get-1st-doc($head/tan:annotation)
Used by variable $annotations-resolved
.
Relies upon $head
, tan:get-1st-doc()
.
TAN-extra-functions
Definition: tan:resolve-doc($annotations-1st-da, false(), tan:attr('relationship', 'annotation'))
No variables, keys, functions, or named templates depend upon this xsl:variable.
Relies upon $annotations-1st-da
, tan:attr()
, tan:resolve-doc()
.
TAN-extra-functions
This variable has a complex definition. See stylesheet for definiton.
No variables, keys, functions, or named templates depend upon this xsl:variable.
Relies upon $applications-uri-collection
.
TAN-extra-functions
Definition: uri-collection('../applications/catalog.xml?on-error=ignore')
Used by variable $applications-collection
.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
Definition: tan:cfne(/)
No variables, keys, functions, or named templates depend upon this xsl:variable.
Relies upon tan:cfne()
.
TAN-extra-functions
Definition: tan:get-doc-history($orig-self)
No variables, keys, functions, or named templates depend upon this xsl:variable.
Relies upon $orig-self
, tan:get-doc-history()
.
TAN-extra-functions
Definition: ('a', 'the')
Used by function tan:title-case()
.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
Definition: ('aboard', 'about', 'above', 'across', 'after', 'against', 'along', 'amid', 'among', 'anti', 'around', 'as', 'at', 'before', 'behind', 'below', 'beneath', 'beside', 'besides', 'between', 'beyond', 'but', 'by', 'concerning', 'considering', 'despite', 'down', 'during', 'except', 'excepting', 'excluding', 'following', 'for', 'from', 'in', 'inside', 'into', 'like', 'minus', 'near', 'of', 'off', 'on', 'onto', 'opposite', 'outside', 'over', 'past', 'per', 'plus', 'regarding', 'round', 'save', 'since', 'than', 'through', 'to', 'toward', 'towards', 'under', 'underneath', 'unlike', 'until', 'up', 'upon', 'versus', 'via', 'with', 'within', 'without')
Used by function tan:title-case()
.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
Definition: $error-tests//comment()[matches(., '\w\w\w\d\d')]
No variables, keys, functions, or named templates depend upon this xsl:variable.
Relies upon $error-tests
.
TAN-extra-functions
Definition: collection('errors/?select=error-test-*.xml')
Used by variable $error-markers
.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
Definition: collection(concat(resolve-uri('catalog.tan.xml', $doc-uri), '?on-error=warning'))
Used by variable $local-TAN-voc-collection
.
Relies upon $doc-uri
.
TAN-extra-functions
Definition: $local-TAN-collection[name(*) = 'TAN-voc']
No variables, keys, functions, or named templates depend upon this xsl:variable.
Relies upon $local-TAN-collection
.
TAN-extra-functions
Definition: tan:expand-doc($morphologies-resolved, 'terse', false())
No variables, keys, functions, or named templates depend upon this xsl:variable.
Relies upon $morphologies-resolved
, tan:expand-doc()
.
TAN-extra-functions
This variable has a complex definition. See stylesheet for definiton.
No variables, keys, functions, or named templates depend upon this xsl:variable.
Relies upon tan:most-common-item()
.
TAN-extra-functions
This variable has a complex definition. See stylesheet for definiton.
Used by function tan:namespace()
.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
This variable has a complex definition. See stylesheet for definiton.
No variables, keys, functions, or named templates depend upon this xsl:variable.
Relies upon $orig-self
, ŧ imitate-validation
.
TAN-extra-functions
Definition: tan:get-1st-doc($head/tan:predecessor)
Used by variable $predecessors-resolved
.
Relies upon $head
, tan:get-1st-doc()
.
TAN-extra-functions
Definition: tan:resolve-doc($predecessors-1st-da, false(), tan:attr('relationship', 'predecessor'))
No variables, keys, functions, or named templates depend upon this xsl:variable.
Relies upon $predecessors-1st-da
, tan:attr()
, tan:resolve-doc()
.
TAN-extra-functions
Definition: tan:get-1st-doc($head/tan:see-also)
Used by variable $see-alsos-resolved
.
Relies upon $head
, tan:get-1st-doc()
.
TAN-extra-functions
Definition: tan:resolve-doc($see-alsos-1st-da, false(), tan:attr('relationship', 'see-also'))
No variables, keys, functions, or named templates depend upon this xsl:variable.
Relies upon $see-alsos-1st-da
, tan:attr()
, tan:resolve-doc()
.
TAN-extra-functions
Definition: tan:get-1st-doc($head/tan:successor)
Used by variable $successors-resolved
.
Relies upon $head
, tan:get-1st-doc()
.
TAN-extra-functions
Definition: tan:resolve-doc($successors-1st-da, false(), tan:attr('relationship', 'successor'))
No variables, keys, functions, or named templates depend upon this xsl:variable.
Relies upon $successors-1st-da
, tan:attr()
, tan:resolve-doc()
.
TAN-extra-functions
Definition: format-date(current-date(), '[Y0001]-[M01]-[D01]')
No variables, keys, functions, or named templates depend upon this xsl:variable.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
Definition: \S+\.\w+
Used by function tan:parse-urls()
.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
Definition: '\{[^\}]+?\}'
Used by function tan:evaluate()
.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
Looks for elements matching tan:ana
Used by function tan:lm-data()
.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
tan:acronym($string-input as xs:string*) as xs:string?
Input: any strings
Output: the acronym of those strings (initial letters joined without spaces)
No variables, keys, functions, or named templates depend upon this xsl:function.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
tan:add-attribute($elements-to-change as element()*, $attribute-name as xs:string?, $attribute-value as item()?) as element()*
Input: elements; a string and a value
Output: Each element with an attribute given the name of the string and a value of the value
No variables, keys, functions, or named templates depend upon this xsl:function.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
tan:analyze-stats($arg as xs:anyAtomicType*) as element()?
Input: a sequence of numbers
Output: a single<stats>
with attributes calculating the count, sum, average, max, min, variance, standard deviation, and then one child<d>
per datum with the value of the datum
Used by function tan:merge-analyzed-stats()
.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
tan:base64-to-bin($base64 as xs:base64Binary?) as xs:string?
Input: a base64 datum
Output: a string representing the datum in binary code
No variables, keys, functions, or named templates depend upon this xsl:function.
Relies upon tan:base64-to-dec()
, tan:dec-to-bin()
.
TAN-extra-functions
tan:base64-to-dec($base64 as xs:base64Binary?) as xs:integer?
Input: a base64 datum
Output: an integer representing the base-10 value of the input
Used by function tan:base64-to-bin()
.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
tan:batch-replace-advanced($string as xs:string?, $replace-elements as element()*) as item()*
Input: a string; a sequence of elements <[ANY NAME] pattern="" [flags=""]>[ANY CONTENT]</[ANY NAME]>
Output: a sequence of items, with instances of @pattern
replaced by the content of
the elements
This is a more advanced form of tan:batch-replace()
, in that it allows text to be
replaced by elements.
The function was devised to convert raw text into TAN-T. Textual references can be turned into <div n=""/> anchors, and the result can then be changed into a traditional hierarchy.
Used by function tan:batch-replace-advanced()
.
Relies upon tan:batch-replace-advanced()
, ŧ batch-replace-advanced
.
TAN-extra-functions
tan:blend-alpha-value($alpha-a as xs:double, $alpha-b as xs:double, $blend-mid-point as xs:double) as xs:double?
Input: three doubles between zero and 1
Output: the blend of the first two doubles, interpreted as alpha values and the third interpreted as a midpoint
Used by function tan:blend-colors()
.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
tan:blend-color-channel-value($color-a as xs:double, $color-b as xs:double, $blend-mid-point as xs:double) as xs:double?
Input: two integers and a double between zero and 1
Output: a double representing a blend between the first two numbers, interpreted as RGB values
Used by function tan:blend-color-channel-value()
, tan:blend-colors()
.
Relies upon tan:blend-color-channel-value()
.
TAN-extra-functions
tan:blend-colors($rgb-color-1 as item()+, $rgb-color-2 as item()+, $blend-mid-point as xs:double) as xs:double*
Input: two sequences of doubles (the first three items being from 0 through 255 and the fourth and last between 0 and 1); a double between zero and 1
Output: a sequence of doubles representing a blend of the first two sequences, interpreted as RGB colors, and the last double as a desired midpoint
Used by function tan:blend-colors()
.
Relies upon tan:blend-alpha-value()
, tan:blend-color-channel-value()
, tan:blend-colors()
.
Option 1 (TAN-extra-functions)
tan:commas-and-ands($input-strings as xs:string*) as xs:string?
One-parameter version of the full one below
Used by function tan:commas-and-ands()
.
Relies upon tan:commas-and-ands()
.
Option 2 (TAN-extra-functions)
tan:commas-and-ands($input-strings as xs:string*, $oxford-comma as xs:boolean) as xs:string?
Input: sequences of strings
Output: the strings joined together with , and 'and'
Used by function tan:commas-and-ands()
.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
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-extra-functions
tan:dec-to-bin($in as xs:integer?) as xs:string?
Input: a decimal
Output: the number in binary, represented as a string
Used by function tan:base64-to-bin()
.
Does not rely upon global variables, keys, functions, or templates.
Option 1 (TAN-extra-functions)
tan:evaluate($string-with-xpath-to-evaluate as xs:string, $context-1 as item()*) as item()*
2-param version of the fuller one below
Used by function tan:evaluate()
, tan:group-elements()
.
Relies upon tan:evaluate()
.
Option 2 (TAN-extra-functions)
tan:evaluate($string-with-xpath-to-evaluate as xs:string, $context-1 as item()*, $context-2 as item()*) as item()*
Input: a string to be evaluated in light of XPath expressions; a context node
Output: the result of the string evaluated as an XPath statement against the context node
Used by function tan:evaluate()
, tan:group-elements()
.
Relies upon $xpath-pattern
.
TAN-extra-functions
tan:glob-to-regex($globs as xs:string*) as xs:string*
Input: any strings that follow a glob-like syntax
Output: the strings converted to regular expressions
No variables, keys, functions, or named templates depend upon this xsl:function.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
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-extra-functions
tan:group-elements($elements-to-group as element()*, $group-min as xs:double?, $label-to-prepend) as element()*
Input: any elements that should be grouped; parameters specifying minimum size of grouping and the name of a label to prepend
Output: those elements grouped
This function was written primarily for the major alter function
No variables, keys, functions, or named templates depend upon this xsl:function.
Relies upon tan:evaluate()
.
TAN-extra-functions
tan:initial-upper-case($strings as xs:string*) as xs:string*
Input: any strings
Output: each string with the initial letters capitalized and the rest set lower-case
Used by template ŧ title-case
.
Used by function tan:title-case()
.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
tan:int-to-aaa($integers as xs:integer*) as xs:string*
Input: any integers
Output: the alphabetic representation of those numerals
No variables, keys, functions, or named templates depend upon this xsl:function.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
tan:int-to-grc($integers as xs:integer*) as xs:string*
Input: any integers
Output: the integers expressed as lowercase Greek alphabetic numerals, with
numeral marker(
s)
No variables, keys, functions, or named templates depend upon this xsl:function.
Relies upon tan:chop-string()
.
TAN-extra-functions
tan:integers-to-sequence($input-integers as xs:integer*) as xs:string?
Input: any integers
Output: a string that compactly expresses those integers
Example: (1, 3, 6, 1, 2) - > "1-3, 6"
No variables, keys, functions, or named templates depend upon this xsl:function.
Relies upon ŧ integers-to-sequence
.
TAN-extra-functions
tan:lengths-to-positions($seq as xs:integer*) as xs:integer*
Input: sequence of numbers representing legnths of items.
Output: sequence of numbers representing the first position of each input item, if the sequence concatenated. 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-extra-functions
tan:lm-data($token-value as xs:string?, $lang-codes as xs:string*) as element()*
Input: token value; a language code
Output: <lm>
data for that token value from any available resources
No variables, keys, functions, or named templates depend upon this xsl:function.
Relies upon tan:base-uri()
, tan:lang-catalog()
, tan:search-morpheus()
, tan:search-results-to-claims()
.
TAN-extra-functions
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-extra-functions
tan:merge-analyzed-stats($analyzed-stats as element()*, $add-stats as xs:boolean?) as element()
Input: Results from tan:analyze-stats()
; a boolean
Output: A synthesis of the results. If the second parameter is true, the stats are added; if false, the first statistic will be compared to the sum of all subsequent ones.
Used by function tan:merge-analyzed-stats()
.
Relies upon tan:analyze-stats()
, tan:merge-analyzed-stats()
.
TAN-extra-functions
tan:most-common-item($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
Used by variable $most-common-indentations
.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
tan:namespace($prefix-or-uri as xs:string*) as xs:string*
Input: any strings representing a namespace prefix or uri
Output: the corresponding prefix or uri whenever a match is found in the global variable
No variables, keys, functions, or named templates depend upon this xsl:function.
Relies upon $namespaces-and-prefixes
.
TAN-extra-functions
tan:no-outliers($numbers as xs:anyAtomicType*) as xs:anyAtomicType*
Input: any sequence of numbers
Output: the same sequence, without outliers
No variables, keys, functions, or named templates depend upon this xsl:function.
Relies upon tan:outliers()
.
TAN-extra-functions
tan:node-type($xml-items as item()*) as xs:string*
Input: any XML items
Output: the node types of each item
Used by function tan:search-morpheus()
.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
tan:normalize-xml-element-space($element-to-normalize as element()?) as element()?
Input: an element
Output: the same element, but with text node descendants space-normalized
If a text node begins with a space, and its first preceding sibling text node ends with a space, then the preceding space is dropped, otherwise it is normalized to a single space
No variables, keys, functions, or named templates depend upon this xsl:function.
Relies upon ŧ normalize-xml-fragment-space
.
TAN-extra-functions
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.
Option 1 (TAN-extra-functions)
tan:open-file($resolved-urls)
1-parameter function of the main one below
Used by function tan:open-file()
.
Relies upon tan:open-file()
.
Option 2 (TAN-extra-functions)
tan:open-file($resolved-urls, $target-fallback-encoding as xs:string*) as document-node()*
Input: items that can be resolved as strings; a string
Output: for each resolvable string in the first parameter, if a document is available, the document; if it is not, but unparsed text is available, a document with the unparsed text wrapped in a root element; otherwise an empty document node. If unparsed text is not available, another attempt will be made on a fallback encoding specified by the 2nd parameter.
If the file is not an XML document, the content will be wrapped by a root element of an
XML document. That root node will have @xml:base
pointing to the source url.
Used by function tan:open-file()
.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
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()
, tan:outliers()
.
Relies upon tan:median()
, tan:number-sort()
, tan:outliers()
.
TAN-extra-functions
tan:parse-urls($input-strings as xs:string*) as element()*
Input: any sequence of strings
Output: one element per string, parsed into children<non-url>
and<url>
No variables, keys, functions, or named templates depend upon this xsl:function.
Relies upon $url-regex
.
TAN-extra-functions
tan:possible-bibliography-id($bibl-cit as xs:string) as xs:string
Input: a string with a bibliographic entry
Output: unique values of the two longest words and the first numeral that looks like a date
When working with bibliographical data, it is next to impossible to rely upon an exact match to tell whether two citations refer to the same item.
Many times, however, the longest word or two, plus the four-digit date, are good ways to try to find matches.
No variables, keys, functions, or named templates depend upon this xsl:function.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
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-extra-functions
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()
.
Option 1 (TAN-extra-functions)
tan:remove-duplicate-siblings($items-to-process as item()*) as item()*
No variables, keys, functions, or named templates depend upon this xsl:function.
Relies upon ŧ remove-duplicate-siblings
.
Option 2 (TAN-extra-functions)
tan:remove-duplicate-siblings($items-to-process as document-node()*, $element-names-to-check as xs:string*) as item()*
Input: any items
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
No variables, keys, functions, or named templates depend upon this xsl:function.
Relies upon ŧ remove-duplicate-siblings
.
TAN-extra-functions
tan:reset-hierarchy($expanded-class-1-docs as document-node()*, $flag-misplaced-leaf-divs as xs:boolean?) as document-node()*
Input: any expanded class-1 documents whose<div>
s may be in the wrong place, because<rename>
or<reassign>
have altered the<ref>
values; a boolean indicating whether misplaced leaf divs should be flagged
Output: the same documents, with <div>
s restored to their proper place in the
hierarchy
No variables, keys, functions, or named templates depend upon this xsl:function.
Relies upon ŧ reset-hierarchy
.
TAN-extra-functions
tan:revise-hrefs($item-to-resolve as item()?, $items-original-url as xs:string, $items-destination-url as xs:string) as item()*
Input: an item that should have urls resolved; the original url of the item; the target url (the item's destination)
Output: the item with each@href
(including those in processing instructions) and html:*/@src
resolved
Used by function tan:revise-hrefs()
.
Relies upon tan:revise-hrefs()
, ŧ revise-hrefs
.
Option 1 (TAN-extra-functions)
tan:sequence-to-tree($sequence-to-reconstruct as item()*) as item()*
One-parameter version of the more complete one below
Used by function tan:sequence-to-tree()
.
Relies upon tan:sequence-to-tree()
.
Option 2 (TAN-extra-functions)
tan:sequence-to-tree($sequence-to-reconstruct as item()*, $fix-orphan-text as xs:boolean) as item()*
Input: a result of tan:tree-to-sequence()
; a boolean
Output: the original tree; if the boolean is true, then any first children that are text nodes will be wrapped in a shallow copy of the first child element
Used by function tan:sequence-to-tree()
.
Relies upon ŧ sequence-to-tree
.
TAN-extra-functions
tan:syr-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-extra-functions
tan:title-case($string-to-convert as xs:string*) as xs:string*
Input: a sequence of strings
Output: each string set in title case, following the conventions of English (one of the only languages that bother with title-case)
According to Chicago rules of title casing, the first and last words are always capitalized, and interior words are capitalzied unless they are a preposition or article
No variables, keys, functions, or named templates depend upon this xsl:function.
Relies upon $english-articles
, $english-prepositions
, tan:initial-upper-case()
, ŧ title-case
.
TAN-extra-functions
tan:tree-to-sequence($xml-fragment as item()*) as item()*
Input: any XML fragment
Output: a flattened sequence of XML nodes representing the original fragment. Each
element is given a new @level
specifying the level of hierarchy the element had in the
original.
No variables, keys, functions, or named templates depend upon this xsl:function.
Relies upon ŧ tree-to-sequence
.
TAN-extra-functions
tan:true($string as xs:string*) as xs:boolean*
Input: a sequence of strings representing truth values
Output: the same number of booleans; if the string is some approximation of y, yes, 1, or true, then it is true, and false otherwise
No variables, keys, functions, or named templates depend upon this xsl:function.
Does not rely upon global variables, keys, functions, or templates.
TAN-extra-functions
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.