The xtpxlib-common component contains the following XSLT modules. The ones used most frequently are general.mod.xsl and href.mod.xsl.

Module/PipelineDescription
compare.mod.xslXSL library module with support for comparing XML documents/elements:
date-time.mod.xslXSLT library module containing functions for working with dates and times.
format-output.mod.xslXSLT library with functions for formatting output/strings.
general.mod.xslXSLT library module with general constants and code.
href.mod.xslXSLT library module with functions for the generic handling of href-s (filenames/paths).
message.mod.xslMessage related templates.
mimetypes.mod.xslMIME type conversion related functions.
parameters.mod.xslTakes an XML document with parameters and turns this into a parameter map.
uuid.mod.xslUUID related functions.

2.1 XSLT (2.0): compare.mod.xsl

File: xslmod/compare.mod.xsl

XSL library module with support for comparing XML documents/elements:

PrefixNamespace URI
xtlchttp://www.xtpxlib.nl/ns/common
Named templateDescription
xtlc:compare-documentsCompares two XML documents with each other:

2.1.1 Named template: xtlc:compare-documents as element(xtlc:message)*

Compares two XML documents with each other:

  • Comments and processing instructions are ignored

  • Text nodes are normalized before comparison

  • Empty text nodes (after normalization) are ignored

  • The comparison stops after the first difference is encountered.

  • The result is either:

    • An empty set, when no differences found

    • One or more xtlc:message elements, status="error" when differences were found (you can only get more than one message on attribute differences)

ParameterTypeRq?DefaultDescription
doc1document-node()yesFirst document to compare.
doc2document-node()yesSecond document to compare.

2.2 XSLT (2.0): date-time.mod.xsl

File: xslmod/date-time.mod.xsl

XSLT library module containing functions for working with dates and times.

When language based, it only distinguishes between Dutch and non-Dutch (which now means: English).

PrefixNamespace URI
xtlchttp://www.xtpxlib.nl/ns/common
VariableTypeValueDescription
xtlc:day-names-enxs:string+('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saterday', 'Sunday')Sequence with the names of the days in English
xtlc:day-names-nlxs:string+('maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag', 'zondag')Sequence with the names of the days in Dutch
xtlc:month-names-enxs:string+('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December')Sequence with the names of the months in English
xtlc:month-names-nlxs:string+('januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december')Sequence with the names of the months in Dutch
FunctionDescription
xtlc:day-in-year-number()Computes the day number in the year: January 1 is 1, December 31 is 365 (or 366 in leap years).
xtlc:days-in-month()Computes the number of days in a particular month. If values are out of range it returns 0.
xtlc:format-date-as-text()Formats a date as a string with the month name in full.
xtlc:format-date-as-text-short()Formats a date as a string with the month name in short.
xtlc:is-leap-year()Returns true when a given year is a leap year
xtlc:month-name()Returns the name of a month.
xtlc:month-name-short()Returns the name of a month in short (abbreviated to 3 characters).
xtlc:to-date()Creates a date from its components.
xtlc:unix-epoch()Computes the UNIX "epoch" code (number of seconds since 1-1-1970) for a given date/time.
xtlc:week-number()Computes the ISO week number for a given date.
xtlc:weekday-name()Returns the name of a month.
xtlc:weekday-number()The number of the weekday (1=Monday, 7=Sunday).

2.2.1 Function: xtlc:day-in-year-number() as xs:integer

Computes the day number in the year: January 1 is 1, December 31 is 365 (or 366 in leap years).

ParameterTypeDescription
datexs:dateDate to use.

2.2.2 Function: xtlc:days-in-month() as xs:integer

Computes the number of days in a particular month. If values are out of range it returns 0.

ParameterTypeDescription
month-numberxs:integerThe month to calculate the number of days for.
yearxs:integerThe year this month is in (important because of leap years).

2.2.3 Function: xtlc:format-date-as-text() as xs:string

Formats a date as a string with the month name in full.

ParameterTypeDescription
datexs:dateThe date to format.
langxs:stringThe language for the conversion.

2.2.4 Function: xtlc:format-date-as-text-short() as xs:string

Formats a date as a string with the month name in short.

ParameterTypeDescription
datexs:dateThe date to format.
langxs:stringThe language for the conversion.

2.2.5 Function: xtlc:is-leap-year() as xs:boolean

Returns true when a given year is a leap year

ParameterTypeDescription
yearxs:integerThe year to check.

2.2.6 Function: xtlc:month-name() as xs:string

Returns the name of a month.

ParameterTypeDescription
month-numberxs:integerThe month number (1-12).
langxs:stringThe language you want the month name in.

2.2.7 Function: xtlc:month-name-short() as xs:string

Returns the name of a month in short (abbreviated to 3 characters).

ParameterTypeDescription
month-numberxs:integerThe month number (1-12).
langxs:stringThe language you want the month name in.

2.2.8 Function: xtlc:to-date() as xs:date

Creates a date from its components.

ParameterTypeDescription
dayxs:integerDay number to use.
monthxs:integerMonth number to use.
yearxs:integerYear to use.

2.2.9 Function: xtlc:unix-epoch() as xs:decimal

Computes the UNIX "epoch" code (number of seconds since 1-1-1970) for a given date/time.

ParameterTypeDescription
datetimexs:dateTimeThe date/time to compute the epoch code for.

2.2.10 Function: xtlc:week-number() as xs:integer

Computes the ISO week number for a given date.

ParameterTypeDescription
datexs:dateDate to use.

2.2.11 Function: xtlc:weekday-name() as xs:string

Returns the name of a month.

ParameterTypeDescription
day-numberxs:integerThe day number (1-7).
langxs:stringThe language you want the month name in.

2.2.12 Function: xtlc:weekday-number() as xs:integer

The number of the weekday (1=Monday, 7=Sunday).

ParameterTypeDescription
datexs:dateDate to use.

2.3 XSLT (2.0): format-output.mod.xsl

File: xslmod/format-output.mod.xsl

XSLT library with functions for formatting output/strings.

When language based, we only distinguish between Dutch and non-Dutch (usually English).

PrefixNamespace URI
xtlchttp://www.xtpxlib.nl/ns/common
FunctionDescription
xtlc:duration2str()Turns a day/time duration into a more readable string, e.g. 1d3h40m12s
xtlc:format-amount()Formats an amount by adding a € sign and always use double digits.
xtlc:format-double()Formats a double as a string with a given amount of digits.
xtlc:size2str()Turns an integer (e.g. a file size) into a (rounded) number using a Kb/Mb/Gb suffix.

2.3.1 Function: xtlc:duration2str() as xs:string

Turns a day/time duration into a more readable string, e.g. 1d3h40m12s

ParameterTypeDescription
durationxs:dayTimeDurationThe duration to convert.
round-secondsxs:booleanWhether the seconds part must be rounded.

2.3.2 Function: xtlc:format-amount() as xs:string

Formats an amount by adding a € sign and always use double digits.

For the Dutch language, . and , are swapped.

ParameterTypeDescription
amountxs:doubleThe amount to format.
langxs:stringThe language for the conversion.

2.3.3 Function: xtlc:format-double() as xs:string

Formats a double as a string with a given amount of digits.

For the Dutch language, . and , are swapped.

ParameterTypeDescription
dblxs:doubleNumber to convert
digitsxs:integerThe number of digits to use. When < 0 this is left open.
langxs:stringThe language for the conversion.

2.3.4 Function: xtlc:size2str() as xs:string

Turns an integer (e.g. a file size) into a (rounded) number using a Kb/Mb/Gb suffix.

ParameterTypeDescription
sizexs:integerThe size to convert.

2.4 XSLT (2.0): general.mod.xsl

File: xslmod/general.mod.xsl

XSLT library module with general constants and code.

PrefixNamespace URI
xtlchttp://www.xtpxlib.nl/ns/common
VariableTypeValueDescription
xtlc:default-dt-formatxs:string'[Y]-[M01]-[D01] [H01]:[m01]:[s01]'Default date/time format string (yyyy-mm-dd …).
xtlc:default-dt-format-enxs:string'[M01]-[D01]-[Y] [H01]:[m01]:[s01]'Date/time format string (English: mm-dd-yyyy …).
xtlc:default-dt-format-nlxs:string'[D01]-[M01]-[Y] [H01]:[m01]:[s01]'Date/time format string (Dutch: dd-mm-yyyy …).
xtlc:internal-error-promptxs:string'Internal error: 'Add this in front of any internal error raised.
xtlc:language-enxs:string'en'Language code for English
xtlc:language-nlxs:string'nl'Language code for Dutch
xtlc:namespace-xtlc-commonxs:stringnamespace-uri-for-prefix('xtlc', doc('')/*)Namespace used for xtpxlib-common.
xtlc:status-codesxs:string+($xtlc:status-info, $xtlc:status-warning, $xtlc:status-error, $xtlc:status-debug)Sequence with all valid status codes.
xtlc:status-debugxs:string'debug'Generic debug status/severity code.
xtlc:status-errorxs:string'error'Generic error status/severity code.
xtlc:status-infoxs:string'info'Generic info (a.k.a. OK) status/severity code.
xtlc:status-warningxs:string'warning'Generic warning status/severity code.
Named templateDescription
xtlc:raise-errorStops any processing by raising an error.
FunctionDescription
xtlc:att2str()Turns an attribute into a string representation, suitable for display (e.g. name="value").
xtlc:capitalize()Capitalizes a string (makes the first character uppercase).
xtlc:char-repeat()Returns a string with a single character repeated a given number of times.
xtlc:count-leading-whitespace()Counts the number of whitespace characters at the beginning of a string
xtlc:elm2str()Turns an element into a descriptive string (the element with all its attributes, excluding schema references).
xtlc:item2element()Tries to find the element belonging to a given item.
xtlc:items2str()Creates a string from a sequence of items.
xtlc:prefix-to-length()Prefixes a string with a given character so it will get at least a given length.
xtlc:q()Returns the input string quoted ("$in")
xtlc:str2bln()Safe conversion of a string into a boolean.
xtlc:str2id()Turns a string into a valid identifier, adding a prefix.
xtlc:str2id()Turns a string into a valid identifier.
xtlc:str2int()Safe conversion of a string to an integer.
xtlc:str2regexp()Turns a string into a regular expression that matches the input exactly. Optionally anchors the regular expression so the match will be on this string only (result starts with ^ and ends with $).
xtlc:str2regexp()Turns a string into a regular expression that matches the input exactly.
xtlc:str2seq()Converts a string with a list of words into a sequence of words.
xtlc:text2lines()Converts text into separate lines.

2.4.1 Named template: xtlc:raise-error

Stops any processing by raising an error.

ParameterTypeRq?DefaultDescription
error-namexs:string $xtlc:status-errorThe (optional) name of the error. Must be an NCName.
msg-partsitem()+yesError message to show (in parts, all parts will be concatenated by xtlc:items2str()).

2.4.2 Function: xtlc:att2str() as xs:string

Turns an attribute into a string representation, suitable for display (e.g. name="value").

ParameterTypeDescription
attattribute()?Attribute to convert.

2.4.3 Function: xtlc:capitalize() as xs:string

Capitalizes a string (makes the first character uppercase).

ParameterTypeDescription
inxs:stringThe string to work on.

2.4.4 Function: xtlc:char-repeat() as xs:string

Returns a string with a single character repeated a given number of times.

ParameterTypeDescription
charxs:stringThe first character of this string is the character to repeat. If empty, an empty string is returned.
repeatxs:integerThe number of repeats. If <= 0, an empty string is returned.

2.4.5 Function: xtlc:count-leading-whitespace() as xs:integer

Counts the number of whitespace characters at the beginning of a string

ParameterTypeDescription
textxs:stringText to work on.

2.4.6 Function: xtlc:elm2str() as xs:string

Turns an element into a descriptive string (the element with all its attributes, excluding schema references).

ParameterTypeDescription
elmelement()?Element to convert

2.4.7 Function: xtlc:item2element() as element()?

Tries to find the element belonging to a given item.

  • When the item is of type xs:string or xs:anyURI, it is assumed to be a document reference. The root element of this is returned.

  • When the item is of type document-node(), the root element of this document is returned

  • When the item is of type element(), this is returned

You can choose whether to produce an error message or () when the item cannot be resolved.

ParameterTypeDescription
itemitem()The item to work on
error-on-non-resolvexs:booleanWhether to generate an error when $item could not be resolved. Otherwise, the function will return ().

2.4.8 Function: xtlc:items2str() as xs:string

Creates a string from a sequence of items.

Useful for easy creation of messages consisting of multiple parts and pieces.

ParameterTypeDescription
itemsitem()*The message parts to combine

2.4.9 Function: xtlc:prefix-to-length() as xs:string

Prefixes a string with a given character so it will get at least a given length.

ParameterTypeDescription
inxs:stringString to prefix
prefix-charxs:stringString to prefix with. Only first character is used. If empty, * is used.
lengthxs:integerThe length to reach.

2.4.10 Function: xtlc:q() as xs:string

Returns the input string quoted ("$in")

ParameterTypeDescription
inxs:string?String to convert.

2.4.11 Function: xtlc:str2bln() as xs:boolean

Safe conversion of a string into a boolean.

When $in is empty or not convertible into a boolean, $default is returned.

ParameterTypeDescription
inxs:string?String to convert.
defaultxs:booleanDefault value to return when $in is empty or cannot be converted.

2.4.12 Function: xtlc:str2id() as xs:string

Turns a string into a valid identifier, adding a prefix.

All characters that are not allowed in an identifier are converted into underscores.

When the result does not start with a letter or underscore, the prefix id- is added.

ParameterTypeDescription
inxs:stringString to convert.
prefixxs:string?Prefix to apply.

2.4.13 Function: xtlc:str2id() as xs:string

Turns a string into a valid identifier.

All characters that are not allowed in an identifier are converted into underscores.

When the result does not start with a letter or underscore, the prefix id- is added.

ParameterTypeDescription
inxs:stringString to convert.

2.4.14 Function: xtlc:str2int() as xs:integer

Safe conversion of a string to an integer.

When $in is empty or not convertible to an integer, $default is returned.

ParameterTypeDescription
inxs:string?String to convert.
defaultxs:integerDefault value to return when $in is empty or cannot be converted.

2.4.15 Function: xtlc:str2regexp() as xs:string

Turns a string into a regular expression that matches the input exactly. Optionally anchors the regular expression so the match will be on this string only (result starts with ^ and ends with $).

ParameterTypeDescription
inxs:string?String to convert
anchorxs:booleanIf true, the resulting string will be anchored (start with ^ and ends with $)

2.4.16 Function: xtlc:str2regexp() as xs:string

Turns a string into a regular expression that matches the input exactly.

ParameterTypeDescription
inxs:string?String to convert

2.4.17 Function: xtlc:str2seq() as xs:string*

Converts a string with a list of words into a sequence of words.

ParameterTypeDescription
inxs:string?String to convert.

2.4.18 Function: xtlc:text2lines() as xs:string*

Converts text into separate lines.

Uses the LF as separator; CRs are removed.

ParameterTypeDescription
textxs:string?The text to convert.
remove-empty-start-end-linesxs:booleanWhen true any empty (containing whitespace only) lines at the beginning and end are removed.
normalize-indentsxs:booleanWhen true the indents of the lines are normalized: the indent of the non-whitespace line with the minimum leading whitespace is removed from all other lines. Lines that contain only whitespace will become zero length.

2.5 XSLT (2.0): href.mod.xsl

File: xslmod/href.mod.xsl

XSLT library module with functions for the generic handling of href-s (filenames/paths).

PrefixNamespace URI
xtlchttp://www.xtpxlib.nl/ns/common
VariableTypeValueDescription
xtlc:protocol-filexs:string'file'File protocol specifier.
FunctionDescription
xtlc:href-add-encoding()Percent encodes all "strange" characters (%xx). Any existing percentage encodings will be kept as is.
xtlc:href-canonical()Makes an href canonical (remove any .. and . directory specifiers).
xtlc:href-concat()Performs a safe concatenation of href components:
xtlc:href-decode-uri()Reverse function of encode-fo-uri(). Translates percent encodings (%xx) into their actual characters.
xtlc:href-ext()Returns the extension part of an href.
xtlc:href-is-absolute()Returns true if the href is considered absolute.
xtlc:href-name()Returns the (file)name part of an href.
xtlc:href-name-noext()Returns the (file)name part of an href without its extension.
xtlc:href-noext()Returns the complete href path without its extension.
xtlc:href-path()Returns the path part of an href.
xtlc:href-protocol()Returns the protocol part of an href (without the ://).
xtlc:href-protocol()Returns the protocol part of an href (without the ://) or a default value when none present.
xtlc:href-protocol-add()Adds a protocol specifier (written without the trailing ://, e.g. http) to an href.
xtlc:href-protocol-present()Returns true when an href has a protocol specifier (e.g. file:// or http://).
xtlc:href-protocol-remove()Removes the protocol part from an href.
xtlc:href-relative()Computes a relative href from one document to another.
xtlc:href-relative-from-path()Computes a relative href from a directory path to a document.
xtlc:href-result-doc()Transforms an href into something xsl:result-document/@href can use.

2.5.1 Function: xtlc:href-add-encoding() as xs:string

Percent encodes all "strange" characters (%xx). Any existing percentage encodings will be kept as is.

ParameterTypeDescription
hrefxs:stringhref to work on.

2.5.2 Function: xtlc:href-canonical() as xs:string

Makes an href canonical (remove any .. and . directory specifiers).

Examples:

  • href-canonical('a/b/../c') ==> 'a/c'

ParameterTypeDescription
hrefxs:stringhref to work on.

2.5.3 Function: xtlc:href-concat() as xs:string

Performs a safe concatenation of href components:

  • Translates all backslashes into slashes

  • Makes sure that all components are separated with a single slash

  • If somewhere in the list is an absolute path, the concatenation stops.

Examples:

  • xtlc:href-concat(('a', 'b', 'c')) ==> 'a/b/c'

  • xtlc:href-concat(('a', '/b', 'c')) ==> '/b/c'

ParameterTypeDescription
href-path-componentsxs:string*The path components to concatenate into a full href.

2.5.4 Function: xtlc:href-decode-uri() as xs:string

Reverse function of encode-fo-uri(). Translates percent encodings (%xx) into their actual characters.

ParameterTypeDescription
hrefxs:stringhref to work on.

2.5.5 Function: xtlc:href-ext() as xs:string

Returns the extension part of an href.

Examples:

  • xtlc:href-ext('a/b/c.xml') ==> 'xml'

  • xtlc:href-ext('a/b/c') ==> ''

ParameterTypeDescription
hrefxs:stringhref to work on.

2.5.6 Function: xtlc:href-is-absolute() as xs:boolean

Returns true if the href is considered absolute.

An href is considered absolute when it starts with a / or \, contains a protocol specifier (e.g. file://) or starts with a Windows drive letter (e.g. C:).

ParameterTypeDescription
hrefxs:stringhref to work on.

2.5.7 Function: xtlc:href-name() as xs:string

Returns the (file)name part of an href.

Examples:

  • xtlc:href-name('a/b/c') ==> 'c'

  • xtlc:href-name('c') ==> 'c'

ParameterTypeDescription
hrefxs:stringhref to work on.

2.5.8 Function: xtlc:href-name-noext() as xs:string

Returns the (file)name part of an href without its extension.

Examples:

  • xtlc:href-name-noext('a/b/c.xml') ==> 'c'

  • xtlc:href-name-noext('a/b/c') ==> 'c'

ParameterTypeDescription
hrefxs:stringhref to work on.

2.5.9 Function: xtlc:href-noext() as xs:string

Returns the complete href path without its extension.

Examples:

  • xtlc:href-noext('a/b/c.xml') ==> 'a/b/c'

  • xtlc:href-noext('a/b/c') ==> 'a/b/c'

ParameterTypeDescription
hrefxs:stringhref to work on.

2.5.10 Function: xtlc:href-path() as xs:string

Returns the path part of an href.

Examples:

  • xtlc:href-path('a/b/c') ==> 'a/b'

  • xtlc:href-path('c') ==> ''

ParameterTypeDescription
hrefxs:stringhref to work on.

2.5.11 Function: xtlc:href-protocol() as xs:string

Returns the protocol part of an href (without the ://).

Examples:

  • xtlc:href-protocol('http://…') ==> 'http'

ParameterTypeDescription
hrefxs:stringhref to work on.

2.5.12 Function: xtlc:href-protocol() as xs:string

Returns the protocol part of an href (without the ://) or a default value when none present.

Examples:

  • xtlc:href-protocol('http://…', 'file') ==> 'http'

  • xtlc:href-protocol('/a/b/c', 'file') ==> 'file'

ParameterTypeDescription
hrefxs:stringhref to work on.
default-protocolxs:stringDefault protocol to return when $ref contains none.

2.5.13 Function: xtlc:href-protocol-add() as xs:string

Adds a protocol specifier (written without the trailing ://, e.g. http) to an href.

ParameterTypeDescription
hrefxs:stringhref to work on.
protocolxs:stringThe protocol to add, without a leading :// part (e.g. just file or http).
forcexs:booleanWhen true an existing protocol is removed first. When false, a reference with an existing protocol is left unchanged.

2.5.14 Function: xtlc:href-protocol-present() as xs:boolean

Returns true when an href has a protocol specifier (e.g. file:// or http://).

ParameterTypeDescription
hrefxs:stringhref to work on.

2.5.15 Function: xtlc:href-protocol-remove() as xs:string

Removes the protocol part from an href.

Examples:

  • xtlc:protocol-remove('file:///a/b/c') ==> '/a/b/c'

Weird exceptions:

  • xtlc:protocol-remove('file:/a/b/c') ==> '/a/b/c'

  • xtlc:protocol-remove('file:/C:/a/b/c') ==> 'C:/a/b/c'

ParameterTypeDescription
hrefxs:stringhref to work on.

2.5.16 Function: xtlc:href-relative() as xs:string

Computes a relative href from one document to another.

Examples:

  • href-relative('a/b/c/from.xml', 'a/b/to.xml') ==> '../to.xml'

  • href-relative('a/b/c/from.xml', 'a/b/d/to.xml') ==> '../d/to.xml'

ParameterTypeDescription
from-hrefxs:stringhref (of a document) of the starting point.
to-hrefxs:stringhref (of a document) of the target.

2.5.17 Function: xtlc:href-relative-from-path() as xs:string

Computes a relative href from a directory path to a document.

Examples:

  • href-relative-from-path('a/b/c', 'a/b/to.xml') ==> '../to.xml'

  • href-relative-from-path('a/b/c', 'a/b/d/to.xml') ==> '../d/to.xml'

ParameterTypeDescription
from-href-pathxs:stringhref (of a directory) of the starting point.
to-hrefxs:stringhref (of a document) of the target.

2.5.18 Function: xtlc:href-result-doc() as xs:string

Transforms an href into something xsl:result-document/@href can use.

xsl:result-document/@href needs a file:// in front and has some strict rules about the formatting. The input to this function must be an absolute href!

ParameterTypeDescription
hrefxs:stringhref to work on. Must be absolute!

2.6 XSLT (2.0): message.mod.xsl

File: xslmod/message.mod.xsl

Message related templates.

A message is a standardized piece of XML used for inserting (error, debug, etc.) messages into XML documents.

PrefixNamespace URI
xtlchttp://www.xtpxlib.nl/ns/common
Named templateDescription
xtlc:msg-createGenerates a standard xtlc:message element.

2.6.1 Named template: xtlc:msg-create as element(xtlc:message)

Generates a standard xtlc:message element.

ParameterTypeRq?DefaultDescription
extra-attributesattribute()* ()Any extra attributes to add to the message.
extra-contentselement()* ()Any extra elements to add to the message.
msg-partsitem()+yesMessage to show (parts will be concatenated by xtlc:items2str()).
statusxs:stringyesThe status of the message. Must be one of the $xtlc:status-* constants as defined in general.mod.xsl.

2.7 XSLT (2.0): mimetypes.mod.xsl

File: xslmod/mimetypes.mod.xsl

MIME type conversion related functions.

These conversions work with an external MIME type/extension table.

PrefixNamespace URI
xtlchttp://www.xtpxlib.nl/ns/common
FunctionDescription
xtlc:ext2mimetype()Turns an href extension (e.g. xml') into the correct MIME type ('text/xml').
xtlc:mimetype2ext()Turns a MIME type (e.g. 'text/xml') into a corresponding href extension ('xml').

2.7.1 Function: xtlc:ext2mimetype() as xs:string

Turns an href extension (e.g. xml') into the correct MIME type ('text/xml').

When it cannot find an appropriate MIME type it returns the empty string.

ParameterTypeDescription
extxs:stringThe extension to convert.

2.7.2 Function: xtlc:mimetype2ext() as xs:string

Turns a MIME type (e.g. 'text/xml') into a corresponding href extension ('xml').

When it doesn't recognize the MIME type it returns the empty string.

ParameterTypeDescription
mimetypexs:stringThe MIME type to convert.

2.8 XSLT (3.0): parameters.mod.xsl

File: xslmod/parameters.mod.xsl

Takes an XML document with parameters and turns this into a parameter map.

More information here.

PrefixNamespace URI
xtlchttp://www.xtpxlib.nl/ns/common
VariableTypeValueDescription
xtlc:parameter-group-separatorxs:string'.'When a <group> element is encountered, this character is used as a separator after the group's name.
xtlc:parameter-main-trigger-characterxs:string'$'Use this variable for a quick check on whether something might contain a parameter: contains(..., $xtlc:parameter-main-trigger-character)
FunctionDescription
xtlc:expand-text-against-parameters()Expands parameter references in $text (either {$...} or ${...}) against the parameters in $parameter-map. If a parameter has multiple values, only the first one is used.
xtlc:parameters-get()Tries to locate a <parameters> element (in any namespace) underneath $root-item and processes the child <parameter> and <group> elements in here into a parameter map.

2.8.1 Function: xtlc:expand-text-against-parameters() as xs:string

Expands parameter references in $text (either {$...} or ${...}) against the parameters in $parameter-map. If a parameter has multiple values, only the first one is used.

ParameterTypeDescription
textxs:stringText to expand.
parameter-mapmap(xs:string, xs:string*)Map with parameter values.

2.8.2 Function: xtlc:parameters-get() as map(xs:string, xs:string*)

Tries to locate a <parameters> element (in any namespace) underneath $root-item and processes the child <parameter> and <group> elements in here into a parameter map.

The <value> elements are filtered according to the entries in $filters.

Parameter references in values (either {$...} or ${...}). are expanded. If a parameter has multiple values, only the first one is used.

ParameterTypeDescription
root-itemitem()Root item under which the first <parameters> element is processed. Can be an href, a document node or an element. See xtlc:item2element() on how this is processed.
filtersmap(xs:string, xs:string*)?Any filters for the parameter's <value> elements.

2.9 XSLT (2.0): uuid.mod.xsl

File: xslmod/uuid.mod.xsl

UUID related functions.

Works only in Saxon PE or EE (not in the free HE), because we are calling an underlying Java function.

PrefixNamespace URI
xtlchttp://www.xtpxlib.nl/ns/common
FunctionDescription
xtlc:get-uuid()Returns a random unique UUID (by calling an underlying Java function)
xtlc:is-real-uuid()Checks whether a string contains a "real" UUID (conforms to the UUID formatting rules).

2.9.1 Function: xtlc:get-uuid() as xs:string

Returns a random unique UUID (by calling an underlying Java function)

2.9.2 Function: xtlc:is-real-uuid() as xs:boolean

Checks whether a string contains a "real" UUID (conforms to the UUID formatting rules).

Example: 5EAE5C68-7394-48d7-A50B-1669E8D3A6C9 (upper/lower-case both admitted)

ParameterTypeDescription
idxs:string?UUID to check.