Tests and Conditions

   

Functions

XPath and XSLT define many functions. Most of these functions take an XPath for a parameter. However, when called with no parameter, they apply to the current node:

 position("//Product")    position() 

The following are the most useful functions:

  • position() ”Returns the position of the expression evaluation context.

  • last() ”Returns the position of the last node from the expression evaluation context.

  • count() ”Returns the number of nodes from the expression evaluation context.

  • string() ”Converts its parameter to a string.

  • substring() ”Returns a substring of the first argument.

  • not() ”Performs a logical not.

  • format-number() ”Converts its first argument to a string using a format pattern.

  • generate-id () ”Returns a string that uniquely identifies the current node. If the function is called again on the same node, it will return the same ID.

   


Applied XML Solutions
Applied XML Solutions
ISBN: 0672320541
EAN: 2147483647
Year: 1999
Pages: 142

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net