All Downloads are FREE. Search and download functionalities are using the official Maven repository.

xslt.base.common.functions.xsl Maven / Gradle / Ivy






Common Functions Reference

  
    Walsh
    Norman
  

2004
Norman Walsh


$Id: functions.xsl 8562 2009-12-17 23:10:25Z nwalsh $




Introduction This is technical reference documentation for the DocBook XSL Stylesheets; it documents (some of) the parameters, templates, and other elements of the stylesheets. This is not intended to be user documentation. It is provided for developers writing customization layers for the stylesheets, and for anyone who's interested in how it works. Although I am trying to be thorough, this documentation is known to be incomplete. Don't forget to read the source, too :-)
Returns an XPointer-style ID for the specified node This function returns the id or xml:id of the specified node. If the node does not have an ID, an XPointer-style “tumbler” ID is used to create one. In order to make sure that the value is a valid ID, the root is represented by “R.” and “.”s are used between each number. The value of xptr-id’s over node-ids is that they are stable. If the same document is processed more than once, each pass will produce the same XPointer IDs. node The node for which an ID will be generated. The ID. R. Returns the number of the first item in an ordered list This function returns the number of the first item in an orderedlist. list The orderedlist element for which the starting number is to be determined. The starting list number. Returns the processing-instructions that are in scope Processing instructions can be used to control some of the behavior of the DocBook stylesheets. This function returns the ones that are “in scope” for any given element. The general rules is that processing instructions that are the children of the context node are in scope, as are processing instructions that appear before the root node of the document. context The context node target The PI target that is to be returned The sequence of in-scope PIs. Returns the value of the first matching pseudo-attribute This function searches a list of processing instructions for the first psuedo-attribute matching the specified name and returns its value. pis The list of processing instructions. attribute The name of the pseudo-attribute to return. The value of the pseudo-attribute or an empty sequence if no such attribute can be found. Returns a pseudo-XPath expression locating the specified node This function returns a psuedo-XPath expression that navigates from the root of the document to the specified node. The XPath returned uses only the local-name of the node so it relies on the default namespace. For a mixed-namespace document, this may simply be impossible. node The node for which a pseudo-XPath will be generated. The pseudo-XPath. / Returns true if the specified node is a “component” This function return true if the specified node is a “component,” that is a appendix, article, chapter, preface, bibliography, glossary, or index. It is defined as a function so that customizers can add other elements to the list of components, if necessary. node The node to test. True if the node is a component, false otherwise. Returns true if the specified node is a “section” This function return true if the specified node is a “section,” that is a section, sect1-5, refsect1-3, or simplesect. It is defined as a function so that customizers can add other elements to the list of sections, if necessary. node The node to test. True if the node is a section, false otherwise. Returns the nesting depth of the specified section This function return the nesting depth of the specified section. Top level sections are at level “1”. If the section belongs to a refentry, the value of refentry-section-level is returned. section The section element for which the depth should be calculated. The section level. 1 2 3 4 5 2 3 4 5 6 1 1 Returns the nesting depth of the specified element This function return the nesting depth of the specified element. The purpose of this function is to calculate the effective depth of an element, as if it were a section. (If it really is a section, use section-level instead.) This can be used to calculate the appropriate size for the titles of elements such as qanda. node The element for which the depth should be calculated. The element's pseudo section level. 1 Returns the nesting depth of the specified refentry section This function return the nesting depth of the specified section in a refentry. Top level sections are at level 1 greater than the level of the enclosing refentry; see refentry-level. section The section element for which the depth should be calculated. The section level. 1 1 2 3 1 Returns the nesting depth of the specified refentry This function return the nesting depth of the specified refentry. The level of a refentry depends on the context in which it occurs. They are at level 1 greater than the level of the section that contains them, if they occur in a section, and at level “1” otherwise. refentry The refentry element for which the depth should be calculated. The refentry level. 1 Constructs a string of the specified length Returns a string of char characters that is count characters long. count The desired string length. char The single character that should be repeated to construct the string. The string of the specified length. Finds a particular node in a sequence of nodes This function searches a sequence of nodes and returns the position of a particular node in that sequence. The function returns 0 if the node is not found. Note that this function searches based on node identity, the target node must literally be in the sequence; it is not sufficient, for example, for another node with the same name to appear in the sequence. nodes The sequence to search. target The node to find. start The position at which to begin searching. The ordinal position of the node, or 0 if it is not found. 0 Finds the TOC parameters for an element This function returns the matching TOC parameter element in the specified list. The matching parameter is the one with the longest matching path. node The node to use for matching, usually the context node. toc The TOC parameter list. The matching node or the empty sequence if no node matches. Trim common leading path information from a URI This function trims common leading path components from a relative URI. uriA The first URI. uriB The second URI. The uriA trimmed of all the initial path components that it has in common with uriB. Return the filename part of a directory name This function returns the last path component of a directory name or URI in a hierarchical URI scheme. This function assumes all filenames are really URIs and always expects “/” to be the component separator. filename The full filename with path or other components. The last path component. /path/to/my/file.ext 'file.ext' http://path/spec/to/here 'here' noslashes 'noslashes' Unrecognized unit of measure: ; using Returns the ID portion of an XPointer The xpointer-idref template returns the ID portion of an XPointer which is a pointer to an ID within the current document, or the empty string if it is not. In other words, xpointer-idref returns foo when passed either #foo or #xpointer(id('foo')), otherwise it returns the empty string. xpointer The string containing the XPointer. The ID portion of the XPointer or an empty string. Resolves a relative URI against an absolute path The resolve-path resolves the uri against the abspath and returns the resulting path. This function avoids the problem that fn:resolve-uri requires an absolute URI (including a scheme!). uri The relative URI to be resolved. abspath The base URI (or absolute path) against which to resolve uri. The resolved path. Strip file: URI shemes off URIs The strip-file-uri-scheme removes any leading file: URI schemes from the URI. uri The URI to be stripped. The uri without the leading scheme.




© 2015 - 2024 Weber Informatics LLC | Privacy Policy