XML information pipe

Ihre Spezialisten für XML

Banner Werbung

XPath 1.0 reference

The reference is based on the W3C recommendation XML Path Language (XPath) 1.0, from which majority descriptions has been extracted.

XPaths  |  functions

boolean  |  ceiling  |  comment  |  concat  |  contains  |  count  |  false  |  floor  |  id  |  lang  |  last  |  local-name  |  name  |  namespace-uri  |  node  |  normalize-space  |  not  |  number  |  position  |  processing-instruction  |  round  |  start-with  |  string  |  string-length  |  substring  |  stubstring-after  |  substring-before  |  sum  |  text  |  translate  |  true  | 


XPaths  |  expressions

!=  |  " "  |  >  |  >=  |  <  |  <=  |  "  |  ()  |  *  |  +  |    |    |  ::  |  =  |  @*  |  []  |  and  |  asix nodetest predicate  |  div  |  func()  |  mod  |  name  |  or  |  |  | 


XPaths  |  axes

ancestor  |  ancestor-or-self  |  attribute  |  child  |  descendant  |  descendant-or-self  |  following  |  following-sibling  |  namespace  |  parent  |  preceding  |  preceding-sibling  |  self  | 




XPaths  |  functions


boolean

boolean boolean(object)

The boolean function converts its argument to a boolean as follows: a number is true if and only if it is neither positive or negative zero nor NaN, a node-set is true if and only if it is non-empty, a string is true if and only if its length is non-zero an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type

XPaths  |  functions

ceiling

number ceiling(number)

The ceiling function returns the smallest (closest to negative infinity) number that is not less than the argument and that is an integer.

XPaths  |  functions

comment

comment()

The node test comment() is true for any comment node.

XPaths  |  functions

concat

string concat(string, string, string*)

The concat function returns the concatenation of its arguments.

XPaths  |  functions


etc. etc. etc.




XPaths  |  expressions


!=

!=

If both objects to be compared are node-sets, then the comparison will be true if and only if there is a node in the first node-set and a node in the second node-set such that the result of performing the comparison on the string-values of the two nodes is true. If one object to be compared is a node-set and the other is a number, then the comparison will be true if and only if there is a node in the node-set such that the result of performing the comparison on the number to be compared and on the result of converting the string-value of that node to a number using the number function is true. If one object to be compared is a node-set and the other is a string, then the comparison will be true if and only if there is a node in the node-set such that the result of performing the comparison on the string-value of the node and the other string is true. If one object to be compared is a node-set and the other is a boolean, then the comparison will be true if and only if the result of performing the comparison on the boolean and on the result of converting the node-set to a boolean using the boolean function is true.


When neither object to be compared is a node-set and the operator is = or !=, then the objects are compared by converting them to a common type as follows and then comparing them. If at least one object to be compared is a boolean, then each object to be compared is converted to a boolean as if by applying the boolean function. Otherwise, if at least one object to be compared is a number, then each object to be compared is converted to a number as if by applying the number function. Otherwise, both objects to be compared are converted to strings as if by applying the string function. The = comparison will be true if and only if the objects are equal; the != comparison will be true if and only if the objects are not equal. Numbers are compared for equality according to IEEE 754 [IEEE 754]. Two booleans are equal if either both are true or both are false. Two strings are equal if and only if they consist of the same sequence of UCS characters.

XPaths  |  expressions

" "

" "

XPath expressions often occur in XML attributes. Within expressions, literal strings are delimited by single or double quotation marks, which are also used to delimit XML attributes. To avoid a quotation mark in an expression being interpreted by the XML processor as terminating the attribute value the quotation mark can be entered as a character reference (" or '). Alternatively, the expression can use single quotation marks if the XML attribute is delimited with double quotation marks or vice-versa.

XPaths  |  expressions

>

>

If both objects to be compared are node-sets, then the comparison will be true if and only if there is a node in the first node-set and a node in the second node-set such that the result of performing the comparison on the string-values of the two nodes is true. If one object to be compared is a node-set and the other is a number, then the comparison will be true if and only if there is a node in the node-set such that the result of performing the comparison on the number to be compared and on the result of converting the string-value of that node to a number using the number function is true. If one object to be compared is a node-set and the other is a string, then the comparison will be true if and only if there is a node in the node-set such that the result of performing the comparison on the string-value of the node and the other string is true. If one object to be compared is a node-set and the other is a boolean, then the comparison will be true if and only if the result of performing the comparison on the boolean and on the result of converting the node-set to a boolean using the boolean function is true.


When neither object to be compared is a node-set and the operator is <=, <, >= or >, then the objects are compared by converting both objects to numbers and comparing the numbers according to IEEE 754. The > comparison will be true if and only if the first number is greater than the second number.

XPaths  |  expressions

>=

>=

If both objects to be compared are node-sets, then the comparison will be true if and only if there is a node in the first node-set and a node in the second node-set such that the result of performing the comparison on the string-values of the two nodes is true. If one object to be compared is a node-set and the other is a number, then the comparison will be true if and only if there is a node in the node-set such that the result of performing the comparison on the number to be compared and on the result of converting the string-value of that node to a number using the number function is true. If one object to be compared is a node-set and the other is a string, then the comparison will be true if and only if there is a node in the node-set such that the result of performing the comparison on the string-value of the node and the other string is true. If one object to be compared is a node-set and the other is a boolean, then the comparison will be true if and only if the result of performing the comparison on the boolean and on the result of converting the node-set to a boolean using the boolean function is true.


When neither object to be compared is a node-set and the operator is <=, <, >= or >, then the objects are compared by converting both objects to numbers and comparing the numbers according to IEEE 754. The >= comparison will be true if and only if the first number is greater than or equal to the second number.

XPaths  |  expressions


etc. etc. etc.




XPaths  |  axes


ancestor

ancestor

the ancestor axis contains the ancestors of the context node; the ancestors of the context node consist of the parent of context node and the parent's parent and so on; thus, the ancestor axis will always include the root node, unless the context node is the root node

XPaths  |  axes

ancestor-or-self

ancestor-or-self

the ancestor-or-self axis contains the context node and the ancestors of the context node; thus, the ancestor axis will always include the root no

XPaths  |  axes

attribute

attribute

the attribute axis contains the attributes of the context node; the axis will be empty unless the context node is an element

XPaths  |  axes