XPath 1.0 Functions

XML Path Language (XPath) Version 1.0 - Section 4 Core Function Library

Node-Set Functions

Function Description
number last() Returns the position of the last node in the context list.
number position() Returns the position of the current context node.
number count( node-set ) Returns the number of nodes in the node-set.
node-set id( object ) Retruns the element specified by it's unique id.
string local-name( node-set ) Returns the local-name for the first node in the node-set.
string local-name() Returns the local-name for the context node.
string namespace-uri( node-set ) Returns the namespace-uri for the first node in the node-set.
string namespace-uri() Returns the namespace-uri for the context node.
string name( node-set ) Returns the name for the first node in the node-set.
string name() Returns the name for the context node.

XML Path Language (XPath) Version 1.0 - Section 4.1 Node Set Functions

String Functions

Function Description
string string( object ) Returns the string representation of the object argument.
string string() Returns a string value representation of the context node.
string concat( string, string, string* ) Returns the concatenation of its arguments.
boolean starts-with( string, string ) Returns true if the first argument string starts with the second argument string.
boolean contains( string, string ) Returns true if the first argument string contains the second argument string.
string substring-before( string, string ) Returns the substring of the first argument string that comes before the first occurrence of the second argument.
string substring-after( string, string ) Returns the substring of the first argument string that comes after the first occurrence of the second argument.
string substring( string, number, number ) Returns the substring of the first argument starting at the position specified by the second argument and the length specified by the third argument.
string substring( string, number ) Returns the substring of the first argument from the position specified by the second argument.
number string-length( string ) Returns the length of the string specified by the argument.
number string-length() Returns the length of the string specified by the context node.
string normalize-space( string ) Returns a white-space normalized string specified by the argument.
string normalize-space() Returns a white-space normalized string specified by the context-node.
string translate( string, string, string ) Replaces characters in the string specified by the second argument with characters specified by the third argument.

XML Path Language (XPath) Version 1.0 - Section 4.2 String Functions

Boolean Functions

Function Description
boolean boolean( object ) Returns the boolean representation of the object argument.
boolean not( boolean ) Returns a boolean with the opposite value of its argument.
boolean true() Returns a boolean with the value of true.
boolean false() Returns a boolean with the value of false.
boolean lang( string ) Returns true if the language of the context node is the same as the languag specified by the argument.

XML Path Language (XPath) Version 1.0 - Section 4.3 Boolean Functions

Number Functions

Function Description
number number( object ) Returns the number representation of the object argument.
number number() Returns the number representation of the context node.
number sum( node-set ) Returns the sum of all nodes in the node-set.
number floor( number ) Returns the largest integer value not greater than the argument.
number ceiling( number ) Returns the smallest integer value not less than the argument.
number round( number ) Returns the integer value closest to the argument.

XML Path Language (XPath) Version 1.0 - Section 4.4 Number Functions