util.xsl

Utility functions used by other stylesheets
Author:
ibirrer
CVS Id:
util.xsl 24 2005-01-04 10:13:06Z ibirrer
Copyright:
2004, P&P Software GmbH
XSLT Version:
2.0
Namespace Prefix Summary:
util - http://www.pnp-software.com/util
xd - http://www.pnp-software.com/XSLTdoc
xs - http://www.w3.org/2001/XMLSchema
xsl - http://www.w3.org/1999/XSL/Transform

Template Modes Summary

No short description available
No short description available
No short description available

Match Templates Summary

* (mode: stripXML) - source
Helper template for stripXML function
Helper template for stripXML function
Helper template for stripXML function
* (mode: xmlToHtml) - source
Helper template for xmlToHtml function
Helper template for xmlToHtml function
* (mode: xmlToString) - source
Helper template for xmlToString function

Functions Summary

element() util:appendElement (param: element() containerelement() element) - source
Appends an element to another element
util:fileSuffixToHtml (param: fileUri) - source
util:getFile (param: xs:string uri) - source
Extracts the filename of an URI
util:getFolder (param: xs:string uri) - source
Extracts the folder part of an URI
util:getRelativeUri (param: xs:string fromxs:string to) - source
Returns the relative link of a given folder resolved to another folder
util:getRelativeUriFiles (param: xs:string fromxs:string toxs:boolean reverse) - source
Builds realive link between to files
util:getSharedPath (param: xs:string folder1xs:string folder2) - source
Get the shared path of two folders
util:indentText (param: string textstring indent) - source
Adds indentation to each line of a text
util:indentText (param: string textstring indentboolean indentFirstLine) - source
Adds indentation to each line of a text
xs:boolean util:isAbsolutePath (param: xs:string path) - source
Tests if a the given path describes an absolute path
util:normalizeFolder (param: xs:string uri) - source
If the uri does not end with a slash, a slash is added at the end.
util:normalizeUri (param: xs:string uri) - source
Replaces triple slashes '///' by a single slash
util:pathToUri (param: xs:string path) - source
Transforms a filesystem path to a URI.
util:removeTextIndent (param: string text) - source
Removes all indentation from each line of a text
util:removeTextIndent (param: string textstring indent) - source
Removes specific indentation from each line of a text
util:repeatString (param: string textint count) - source
Repeats a string several times
util:stripXML (param: nodes) - source
Strips all xml elements and comments from a set of nodes and returns only the text nodes
util:substringAfterLast (param: texttoken) - source
Returns the string after the last occurence of a given character
item()* util:xmlToHtml (param: item()* xml) - source
No short description available
util:xmlToString (param: item()* xml) - source
Transforms an XML structure to a plain string

Template Modes Detail

No short description available
Templates Using This Mode:
No short description available
Templates Using This Mode:
No short description available
Templates Using This Mode:

Match Templates Detail

* (mode: stripXML) - source
Helper template for stripXML function
Do not output elements, but process subelements
Helper template for stripXML function
Delete all XML comments
Helper template for stripXML function
Output all text nodes
* (mode: xmlToHtml) - source
Helper template for xmlToHtml function
Namespace Prefix Summary:
#default - http://www.w3.org/1999/xhtml
Helper template for xmlToHtml function
Namespace Prefix Summary:
#default - http://www.w3.org/1999/xhtml
* (mode: xmlToString) - source
Helper template for xmlToString function

Functions Detail

element() util:appendElement (param: element() containerelement() element) - source
Appends an element to another element
Parameters:
element() container -
element() element -
util:fileSuffixToHtml (param: fileUri) - source
Parameters:
fileUri -
util:getFile (param: xs:string uri) - source
Extracts the filename of an URI
Parameters:
xs:string uri -
util:getFolder (param: xs:string uri) - source
Extracts the folder part of an URI
Parameters:
xs:string uri -
util:getRelativeUri (param: xs:string fromxs:string to) - source
Returns the relative link of a given folder resolved to another folder
Parameters:
xs:string from - An absolute URI of a folder
xs:string to - An absolute URI of a folder
util:getRelativeUriFiles (param: xs:string fromxs:string toxs:boolean reverse) - source
Builds realive link between to files
Parameters:
xs:string from - An absolute URI of a file
xs:string to - An absolute URI of a file
xs:boolean reverse -
util:getSharedPath (param: xs:string folder1xs:string folder2) - source
Get the shared path of two folders
If no shared path is found the empty string is returned.
Parameters:
xs:string folder1 -
xs:string folder2 -
util:indentText (param: string textstring indent) - source
Adds indentation to each line of a text
Parameters:
string text - The text the indentation should be added to.
string indent - String that is used for indentation.
util:indentText (param: string textstring indentboolean indentFirstLine) - source
Adds indentation to each line of a text
Parameters:
string text - The text the indentation should be added to.
string indent - String that is used for indentation.
boolean indentFirstLine - If true the first line is not indented
xs:boolean util:isAbsolutePath (param: xs:string path) - source
Tests if a the given path describes an absolute path
Parameters:
xs:string path -
util:normalizeFolder (param: xs:string uri) - source
If the uri does not end with a slash, a slash is added at the end.
Otherwise the uri is left unchanged. The result is normalized with normalizeUri
Parameters:
xs:string uri - An uri that points to a folder.
util:normalizeUri (param: xs:string uri) - source
Replaces triple slashes '///' by a single slash
Also removes any single-dot path segments.
Parameters:
xs:string uri - The uri to be normalized.
util:pathToUri (param: xs:string path) - source
Transforms a filesystem path to a URI.
Backward slashes are transformed to forward slashes and the prefix file:/ is added, if the goven path is an absoulte path. If the argument is already a URI, it is left unchanged.
Parameters:
xs:string path - The Path to be transformed as a string
util:removeTextIndent (param: string text) - source
Removes all indentation from each line of a text
Parameters:
string text - The text the indentation should be added to.
util:removeTextIndent (param: string textstring indent) - source
Removes specific indentation from each line of a text
Parameters:
string text - The text the indentation should removed from.
string indent - The indentation to be removed.
util:repeatString (param: string textint count) - source
Repeats a string several times
Parameters:
string text - The string to repeat
int count - how many times should the string be repeated
util:stripXML (param: nodes) - source
Strips all xml elements and comments from a set of nodes and returns only the text nodes
Parameters:
nodes -
util:substringAfterLast (param: texttoken) - source
Returns the string after the last occurence of a given character
If the given character is not found the text is returned without change.
Parameters:
text - The text from which to extarct the substring
token - The character after which the text should be returned
item()* util:xmlToHtml (param: item()* xml) - source
No short description available
Parameters:
item()* xml -
util:xmlToString (param: item()* xml) - source
Transforms an XML structure to a plain string
Parameters:
item()* xml - XML Element. Can also be a sequence of elements.