[1]W3C XML Path Language (XPath) Version 1.0 W3C Recommendation 16 November 1999 This version: [2]http://www.w3.org/TR/1999/REC-xpath-19991116 (available in [3]XML or [4]HTML) Latest version: [5]http://www.w3.org/TR/xpath Previous versions: [6]http://www.w3.org/TR/1999/PR-xpath-19991008 [7]http://www.w3.org/1999/08/WD-xpath-19990813 [8]http://www.w3.org/1999/07/WD-xpath-19990709 [9]http://www.w3.org/TR/1999/WD-xslt-19990421 Editors: James Clark [10] Steve DeRose (Inso Corp. and Brown University) [11] [12]Copyright © 1999 [13]W3C^® ([14]MIT, [15]INRIA, [16]Keio), All Rights Reserved. W3C [17]liability, [18]trademark, [19]document use and [20]software licensing rules apply. _________________________________________________________________ Abstract XPath is a language for addressing parts of an XML document, designed to be used by both XSLT and XPointer. Status of this document This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a W3C [21]Recommendation. It is a stable document and may be used as reference material or cited as a normative reference from other documents. W3C's role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web. The list of known errors in this specification is available at [22]http://www.w3.org/1999/11/REC-xpath-19991116-errata. Comments on this specification may be sent to [23]www-xpath-comments@w3.org; [24]archives of the comments are available. The English version of this specification is the only normative version. However, for translations of this document, see [25]http://www.w3.org/Style/XSL/translations.html. A list of current W3C Recommendations and other technical documents can be found at [26]http://www.w3.org/TR. This specification is joint work of the XSL Working Group and the XML Linking Working Group and so is part of the [27]W3C Style activity and of the [28]W3C XML activity. Table of contents 1 [29]Introduction 2 [30]Location Paths 2.1 [31]Location Steps 2.2 [32]Axes 2.3 [33]Node Tests 2.4 [34]Predicates 2.5 [35]Abbreviated Syntax 3 [36]Expressions 3.1 [37]Basics 3.2 [38]Function Calls 3.3 [39]Node-sets 3.4 [40]Booleans 3.5 [41]Numbers 3.6 [42]Strings 3.7 [43]Lexical Structure 4 [44]Core Function Library 4.1 [45]Node Set Functions 4.2 [46]String Functions 4.3 [47]Boolean Functions 4.4 [48]Number Functions 5 [49]Data Model 5.1 [50]Root Node 5.2 [51]Element Nodes 5.2.1 [52]Unique IDs 5.3 [53]Attribute Nodes 5.4 [54]Namespace Nodes 5.5 [55]Processing Instruction Nodes 5.6 [56]Comment Nodes 5.7 [57]Text Nodes 6 [58]Conformance Appendices A [59]References A.1 [60]Normative References A.2 [61]Other References B [62]XML Information Set Mapping (Non-Normative) _________________________________________________________________ 1 Introduction XPath is the result of an effort to provide a common syntax and semantics for functionality shared between XSL Transformations [63][XSLT] and XPointer [64][XPointer]. The primary purpose of XPath is to address parts of an XML [65][XML] document. In support of this primary purpose, it also provides basic facilities for manipulation of strings, numbers and booleans. XPath uses a compact, non-XML syntax to facilitate use of XPath within URIs and XML attribute values. XPath operates on the abstract, logical structure of an XML document, rather than its surface syntax. XPath gets its name from its use of a path notation as in URLs for navigating through the hierarchical structure of an XML document. In addition to its use for addressing, XPath is also designed so that it has a natural subset that can be used for matching (testing whether or not a node matches a pattern); this use of XPath is described in [66]XSLT. XPath models an XML document as a tree of nodes. There are different types of nodes, including element nodes, attribute nodes and text nodes. XPath defines a way to compute a [67]string-value for each type of node. Some types of nodes also have names. XPath fully supports XML Namespaces [68][XML Names]. Thus, the name of a node is modeled as a pair consisting of a local part and a possibly null namespace URI; this is called an [69]expanded-name. The data model is described in detail in [70][5 Data Model]. The primary syntactic construct in XPath is the expression. An expression matches the production [71]Expr. An expression is evaluated to yield an object, which has one of the following four basic types: * node-set (an unordered collection of nodes without duplicates) * boolean (true or false) * number (a floating-point number) * string (a sequence of UCS characters) Expression evaluation occurs with respect to a context. XSLT and XPointer specify how the context is determined for XPath expressions used in XSLT and XPointer respectively. The context consists of: * a node (the context node) * a pair of non-zero positive integers (the context position and the context size) * a set of variable bindings * a function library * the set of namespace declarations in scope for the expression The context position is always less than or equal to the context size. The variable bindings consist of a mapping from variable names to variable values. The value of a variable is an object, which can be of any of the types that are possible for the value of an expression, and may also be of additional types not specified here. The function library consists of a mapping from function names to functions. Each function takes zero or more arguments and returns a single result. This document defines a core function library that all XPath implementations must support (see [72][4 Core Function Library]). For a function in the core function library, arguments and result are of the four basic types. Both XSLT and XPointer extend XPath by defining additional functions; some of these functions operate on the four basic types; others operate on additional data types defined by XSLT and XPointer. The namespace declarations consist of a mapping from prefixes to namespace URIs. The variable bindings, function library and namespace declarations used to evaluate a subexpression are always the same as those used to evaluate the containing expression. The context node, context position, and context size used to evaluate a subexpression are sometimes different from those used to evaluate the containing expression. Several kinds of expressions change the context node; only predicates change the context position and context size (see [73][2.4 Predicates]). When the evaluation of a kind of expression is described, it will always be explicitly stated if the context node, context position, and context size change for the evaluation of subexpressions; if nothing is said about the context node, context position, and context size, they remain unchanged for the evaluation of subexpressions of that kind of expression. XPath expressions often occur in XML attributes. The grammar specified in this section applies to the attribute value after XML 1.0 normalization. So, for example, if the grammar uses the character <, this must not appear in the XML source as < but must be quoted according to XML 1.0 rules by, for example, entering it as <. 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. One important kind of expression is a location path. A location path selects a set of nodes relative to the context node. The result of evaluating an expression that is a location path is the node-set containing the nodes selected by the location path. Location paths can recursively contain expressions that are used to filter sets of nodes. A location path matches the production [74]LocationPath. In the following grammar, the non-terminals [75]QName and [76]NCName are defined in [77][XML Names], and [78]S is defined in [79][XML]. The grammar uses the same EBNF notation as [80][XML] (except that grammar symbols always have initial capital letters). Expressions are parsed by first dividing the character string to be parsed into tokens and then parsing the resulting sequence of tokens. Whitespace can be freely used between tokens. The tokenization process is described in [81][3.7 Lexical Structure]. 2 Location Paths Although location paths are not the most general grammatical construct in the language (a [82]LocationPath is a special case of an [83]Expr), they are the most important construct and will therefore be described first. Every location path can be expressed using a straightforward but rather verbose syntax. There are also a number of syntactic abbreviations that allow common cases to be expressed concisely. This section will explain the semantics of location paths using the unabbreviated syntax. The abbreviated syntax will then be explained by showing how it expands into the unabbreviated syntax (see [84][2.5 Abbreviated Syntax]). Here are some examples of location paths using the unabbreviated syntax: * child::para selects the para element children of the context node * child::* selects all element children of the context node * child::text() selects all text node children of the context node * child::node() selects all the children of the context node, whatever their node type * attribute::name selects the name attribute of the context node * attribute::* selects all the attributes of the context node * descendant::para selects the para element descendants of the context node * ancestor::div selects all div ancestors of the context node * ancestor-or-self::div selects the div ancestors of the context node and, if the context node is a div element, the context node as well * descendant-or-self::para selects the para element descendants of the context node and, if the context node is a para element, the context node as well * self::para selects the context node if it is a para element, and otherwise selects nothing * child::chapter/descendant::para selects the para element descendants of the chapter element children of the context node * child::*/child::para selects all para grandchildren of the context node * / selects the document root (which is always the parent of the document element) * /descendant::para selects all the para elements in the same document as the context node * /descendant::olist/child::item selects all the item elements that have an olist parent and that are in the same document as the context node * child::para[position()=1] selects the first para child of the context node * child::para[position()=last()] selects the last para child of the context node * child::para[position()=last()-1] selects the last but one para child of the context node * child::para[position()>1] selects all the para children of the context node other than the first para child of the context node * following-sibling::chapter[position()=1] selects the next chapter sibling of the context node * preceding-sibling::chapter[position()=1] selects the previous chapter sibling of the context node * /descendant::figure[position()=42] selects the forty-second figure element in the document * /child::doc/child::chapter[position()=5]/child::section[position() =2] selects the second section of the fifth chapter of the doc document element * child::para[attribute::type="warning"] selects all para children of the context node that have a type attribute with value warning * child::para[attribute::type='warning'][position()=5] selects the fifth para child of the context node that has a type attribute with value warning * child::para[position()=5][attribute::type="warning"] selects the fifth para child of the context node if that child has a type attribute with value warning * child::chapter[child::title='Introduction'] selects the chapter children of the context node that have one or more title children with [85]string-value equal to Introduction * child::chapter[child::title] selects the chapter children of the context node that have one or more title children * child::*[self::chapter or self::appendix] selects the chapter and appendix children of the context node * child::*[self::chapter or self::appendix][position()=last()] selects the last chapter or appendix child of the context node There are two kinds of location path: relative location paths and absolute location paths. A relative location path consists of a sequence of one or more location steps separated by /. The steps in a relative location path are composed together from left to right. Each step in turn selects a set of nodes relative to a context node. An initial sequence of steps is composed together with a following step as follows. The initial sequence of steps selects a set of nodes relative to a context node. Each node in that set is used as a context node for the following step. The sets of nodes identified by that step are unioned together. The set of nodes identified by the composition of the steps is this union. For example, child::div/child::para selects the para element children of the div element children of the context node, or, in other words, the para element grandchildren that have div parents. An absolute location path consists of / optionally followed by a relative location path. A / by itself selects the root node of the document containing the context node. If it is followed by a relative location path, then the location path selects the set of nodes that would be selected by the relative location path relative to the root node of the document containing the context node. Location Paths [1] LocationPath ::= [86]RelativeLocationPath | [87]AbsoluteLocationPath [2] AbsoluteLocationPath ::= '/' [88]RelativeLocationPath? | [89]AbbreviatedAbsoluteLocationPath [3] RelativeLocationPath ::= [90]Step | [91]RelativeLocationPath '/' [92]Step | [93]AbbreviatedRelativeLocationPath 2.1 Location Steps A location step has three parts: * an axis, which specifies the tree relationship between the nodes selected by the location step and the context node, * a node test, which specifies the node type and [94]expanded-name of the nodes selected by the location step, and * zero or more predicates, which use arbitrary expressions to further refine the set of nodes selected by the location step. The syntax for a location step is the axis name and node test separated by a double colon, followed by zero or more expressions each in square brackets. For example, in child::para[position()=1], child is the name of the axis, para is the node test and [position()=1] is a predicate. The node-set selected by the location step is the node-set that results from generating an initial node-set from the axis and node-test, and then filtering that node-set by each of the predicates in turn. The initial node-set consists of the nodes having the relationship to the context node specified by the axis, and having the node type and [95]expanded-name specified by the node test. For example, a location step descendant::para selects the para element descendants of the context node: descendant specifies that each node in the initial node-set must be a descendant of the context; para specifies that each node in the initial node-set must be an element named para. The available axes are described in [96][2.2 Axes]. The available node tests are described in [97][2.3 Node Tests]. The meaning of some node tests is dependent on the axis. The initial node-set is filtered by the first predicate to generate a new node-set; this new node-set is then filtered using the second predicate, and so on. The final node-set is the node-set selected by the location step. The axis affects how the expression in each predicate is evaluated and so the semantics of a predicate is defined with respect to an axis. See [98][2.4 Predicates]. Location Steps [4] Step ::= [99]AxisSpecifier [100]NodeTest [101]Predicate* | [102]AbbreviatedStep [5] AxisSpecifier ::= [103]AxisName '::' | [104]AbbreviatedAxisSpecifier 2.2 Axes The following axes are available: * the child axis contains the children of the context node * the descendant axis contains the descendants of the context node; a descendant is a child or a child of a child and so on; thus the descendant axis never contains attribute or namespace nodes * the parent axis contains the [105]parent of the context node, if there is one * the ancestor axis contains the ancestors of the context node; the ancestors of the context node consist of the [106]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 * the following-sibling axis contains all the following siblings of the context node; if the context node is an attribute node or namespace node, the following-sibling axis is empty * the preceding-sibling axis contains all the preceding siblings of the context node; if the context node is an attribute node or namespace node, the preceding-sibling axis is empty * the following axis contains all nodes in the same document as the context node that are after the context node in document order, excluding any descendants and excluding attribute nodes and namespace nodes * the preceding axis contains all nodes in the same document as the context node that are before the context node in document order, excluding any ancestors and excluding attribute nodes and namespace nodes * the attribute axis contains the attributes of the context node; the axis will be empty unless the context node is an element * the namespace axis contains the namespace nodes of the context node; the axis will be empty unless the context node is an element * the self axis contains just the context node itself * the descendant-or-self axis contains the context node and the descendants of the context node * 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 node NOTE: The ancestor, descendant, following, preceding and self axes partition a document (ignoring attribute and namespace nodes): they do not overlap and together they contain all the nodes in the document. Axes [6] AxisName ::= 'ancestor' | 'ancestor-or-self' | 'attribute' | 'child' | 'descendant' | 'descendant-or-self' | 'following' | 'following-sibling' | 'namespace' | 'parent' | 'preceding' | 'preceding-sibling' | 'self' 2.3 Node Tests Every axis has a principal node type. If an axis can contain elements, then the principal node type is element; otherwise, it is the type of the nodes that the axis can contain. Thus, * For the attribute axis, the principal node type is attribute. * For the namespace axis, the principal node type is namespace. * For other axes, the principal node type is element. A node test that is a [107]QName is true if and only if the type of the node (see [108][5 Data Model]) is the principal node type and has an [109]expanded-name equal to the [110]expanded-name specified by the [111]QName. For example, child::para selects the para element children of the context node; if the context node has no para children, it will select an empty set of nodes. attribute::href selects the href attribute of the context node; if the context node has no href attribute, it will select an empty set of nodes. A [112]QName in the node test is expanded into an [113]expanded-name using the namespace declarations from the expression context. This is the same way expansion is done for element type names in start and end-tags except that the default namespace declared with xmlns is not used: if the [114]QName does not have a prefix, then the namespace URI is null (this is the same way attribute names are expanded). It is an error if the [115]QName has a prefix for which there is no namespace declaration in the expression context. A node test * is true for any node of the principal node type. For example, child::* will select all element children of the context node, and attribute::* will select all attributes of the context node. A node test can have the form [116]NCName:*. In this case, the prefix is expanded in the same way as with a [117]QName, using the context namespace declarations. It is an error if there is no namespace declaration for the prefix in the expression context. The node test will be true for any node of the principal type whose [118]expanded-name has the namespace URI to which the prefix expands, regardless of the local part of the name. The node test text() is true for any text node. For example, child::text() will select the text node children of the context node. Similarly, the node test comment() is true for any comment node, and the node test processing-instruction() is true for any processing instruction. The processing-instruction() test may have an argument that is [119]Literal; in this case, it is true for any processing instruction that has a name equal to the value of the [120]Literal. A node test node() is true for any node of any type whatsoever. [7] NodeTest ::= [121]NameTest | [122]NodeType '(' ')' | 'processing-instruction' '(' [123]Literal ')' 2.4 Predicates An axis is either a forward axis or a reverse axis. An axis that only ever contains the context node or nodes that are after the context node in [124]document order is a forward axis. An axis that only ever contains the context node or nodes that are before the context node in [125]document order is a reverse axis. Thus, the ancestor, ancestor-or-self, preceding, and preceding-sibling axes are reverse axes; all other axes are forward axes. Since the self axis always contains at most one node, it makes no difference whether it is a forward or reverse axis. The proximity position of a member of a node-set with respect to an axis is defined to be the position of the node in the node-set ordered in document order if the axis is a forward axis and ordered in reverse document order if the axis is a reverse axis. The first position is 1. A predicate filters a node-set with respect to an axis to produce a new node-set. For each node in the node-set to be filtered, the [126]PredicateExpr is evaluated with that node as the context node, with the number of nodes in the node-set as the context size, and with the [127]proximity position of the node in the node-set with respect to the axis as the context position; if [128]PredicateExpr evaluates to true for that node, the node is included in the new node-set; otherwise, it is not included. A [129]PredicateExpr is evaluated by evaluating the [130]Expr and converting the result to a boolean. If the result is a number, the result will be converted to true if the number is equal to the context position and will be converted to false otherwise; if the result is not a number, then the result will be converted as if by a call to the [131]boolean function. Thus a location path para[3] is equivalent to para[position()=3]. Predicates [8] Predicate ::= '[' [132]PredicateExpr ']' [9] PredicateExpr ::= [133]Expr 2.5 Abbreviated Syntax Here are some examples of location paths using abbreviated syntax: * para selects the para element children of the context node * * selects all element children of the context node * text() selects all text node children of the context node * @name selects the name attribute of the context node * @* selects all the attributes of the context node * para[1] selects the first para child of the context node * para[last()] selects the last para child of the context node * */para selects all para grandchildren of the context node * /doc/chapter[5]/section[2] selects the second section of the fifth chapter of the doc * chapter//para selects the para element descendants of the chapter element children of the context node * //para selects all the para descendants of the document root and thus selects all para elements in the same document as the context node * //olist/item selects all the item elements in the same document as the context node that have an olist parent * . selects the context node * .//para selects the para element descendants of the context node * .. selects the parent of the context node * ../@lang selects the lang attribute of the parent of the context node * para[@type="warning"] selects all para children of the context node that have a type attribute with value warning * para[@type="warning"][5] selects the fifth para child of the context node that has a type attribute with value warning * para[5][@type="warning"] selects the fifth para child of the context node if that child has a type attribute with value warning * chapter[title="Introduction"] selects the chapter children of the context node that have one or more title children with [134]string-value equal to Introduction * chapter[title] selects the chapter children of the context node that have one or more title children * employee[@secretary and @assistant] selects all the employee children of the context node that have both a secretary attribute and an assistant attribute The most important abbreviation is that child:: can be omitted from a location step. In effect, child is the default axis. For example, a location path div/para is short for child::div/child::para. There is also an abbreviation for attributes: attribute:: can be abbreviated to @. For example, a location path para[@type="warning"] is short for child::para[attribute::type="warning"] and so selects para children with a type attribute with value equal to warning. // is short for /descendant-or-self::node()/. For example, //para is short for /descendant-or-self::node()/child::para and so will select any para element in the document (even a para element that is a document element will be selected by //para since the document element node is a child of the root node); div//para is short for div/descendant-or-self::node()/child::para and so will select all para descendants of div children. NOTE: The location path //para[1] does not mean the same as the location path /descendant::para[1]. The latter selects the first descendant para element; the former selects all descendant para elements that are the first para children of their parents. A location step of . is short for self::node(). This is particularly useful in conjunction with //. For example, the location path .//para is short for self::node()/descendant-or-self::node()/child::para and so will select all para descendant elements of the context node. Similarly, a location step of .. is short for parent::node(). For example, ../title is short for parent::node()/child::title and so will select the title children of the parent of the context node. Abbreviations [10] AbbreviatedAbsoluteLocationPath ::= '//' [135]RelativeLocationPath [11] AbbreviatedRelativeLocationPath ::= [136]RelativeLocationPath '//' [137]Step [12] AbbreviatedStep ::= '.' | '..' [13] AbbreviatedAxisSpecifier ::= '@'? 3 Expressions 3.1 Basics A [138]VariableReference evaluates to the value to which the variable name is bound in the set of variable bindings in the context. It is an error if the variable name is not bound to any value in the set of variable bindings in the expression context. Parentheses may be used for grouping. [14] Expr ::= [139]OrExpr [15] PrimaryExpr ::= [140]VariableReference | '(' [141]Expr ')' | [142]Literal | [143]Number | [144]FunctionCall 3.2 Function Calls A [145]FunctionCall expression is evaluated by using the [146]FunctionName to identify a function in the expression evaluation context function library, evaluating each of the [147]Arguments, converting each argument to the type required by the function, and finally calling the function, passing it the converted arguments. It is an error if the number of arguments is wrong or if an argument cannot be converted to the required type. The result of the [148]FunctionCall expression is the result returned by the function. An argument is converted to type string as if by calling the [149]string function. An argument is converted to type number as if by calling the [150]number function. An argument is converted to type boolean as if by calling the [151]boolean function. An argument that is not of type node-set cannot be converted to a node-set. [16] FunctionCall ::= [152]FunctionName '(' ( [153]Argument ( ',' [154]Argument )* )? ')' [17] Argument ::= [155]Expr 3.3 Node-sets A location path can be used as an expression. The expression returns the set of nodes selected by the path. The | operator computes the union of its operands, which must be node-sets. [156]Predicates are used to filter expressions in the same way that they are used in location paths. It is an error if the expression to be filtered does not evaluate to a node-set. The [157]Predicate filters the node-set with respect to the child axis. NOTE: The meaning of a [158]Predicate depends crucially on which axis applies. For example, preceding::foo[1] returns the first foo element in reverse document order, because the axis that applies to the [1] predicate is the preceding axis; by contrast, (preceding::foo)[1] returns the first foo element in document order, because the axis that applies to the [1] predicate is the child axis. The / and // operators compose an expression and a relative location path. It is an error if the expression does not evaluate to a node-set. The / operator does composition in the same way as when / is used in a location path. As in location paths, // is short for /descendant-or-self::node()/. There are no types of objects that can be converted to node-sets. [18] UnionExpr ::= [159]PathExpr | [160]UnionExpr '|' [161]PathExpr [19] PathExpr ::= [162]LocationPath | [163]FilterExpr | [164]FilterExpr '/' [165]RelativeLocationPath | [166]FilterExpr '//' [167]RelativeLocationPath [20] FilterExpr ::= [168]PrimaryExpr | [169]FilterExpr [170]Predicate 3.4 Booleans An object of type boolean can have one of two values, true and false. An or expression is evaluated by evaluating each operand and converting its value to a boolean as if by a call to the [171]boolean function. The result is true if either value is true and false otherwise. The right operand is not evaluated if the left operand evaluates to true. An and expression is evaluated by evaluating each operand and converting its value to a boolean as if by a call to the [172]boolean function. The result is true if both values are true and false otherwise. The right operand is not evaluated if the left operand evaluates to false. An [173]EqualityExpr (that is not just a [174]RelationalExpr) or a [175]RelationalExpr (that is not just an [176]AdditiveExpr) is evaluated by comparing the objects that result from evaluating the two operands. Comparison of the resulting objects is defined in the following three paragraphs. First, comparisons that involve node-sets are defined in terms of comparisons that do not involve node-sets; this is defined uniformly for =, !=, <=, <, >= and >. Second, comparisons that do not involve node-sets are defined for = and !=. Third, comparisons that do not involve node-sets are defined for <=, <, >= and >. 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 [177]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 [178]string-value of that node to a number using the [179]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 [180]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 [181]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 [182]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 [183]number function. Otherwise, both objects to be compared are converted to strings as if by applying the [184]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 [185][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. NOTE: If $x is bound to a node-set, then $x="foo" does not mean the same as not($x!="foo"): the former is true if and only if some node in $x has the string-value foo; the latter is true if and only if all nodes in $x have the string-value foo. 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 less than the second number. The <= comparison will be true if and only if the first number is less than or equal to the second number. The > comparison will be true if and only if the first number is greater than the second number. The >= comparison will be true if and only if the first number is greater than or equal to the second number. NOTE: When an XPath expression occurs in an XML document, any < and <= operators must be quoted according to XML 1.0 rules by using, for example, < and <=. In the following example the value of the test attribute is an XPath expression: ... [21] OrExpr ::= [186]AndExpr | [187]OrExpr 'or' [188]AndExpr [22] AndExpr ::= [189]EqualityExpr | [190]AndExpr 'and' [191]EqualityExpr [23] EqualityExpr ::= [192]RelationalExpr | [193]EqualityExpr '=' [194]RelationalExpr | [195]EqualityExpr '!=' [196]RelationalExpr [24] RelationalExpr ::= [197]AdditiveExpr | [198]RelationalExpr '<' [199]AdditiveExpr | [200]RelationalExpr '>' [201]AdditiveExpr | [202]RelationalExpr '<=' [203]AdditiveExpr | [204]RelationalExpr '>=' [205]AdditiveExpr NOTE: The effect of the above grammar is that the order of precedence is (lowest precedence first): * or * and * =, != * <=, <, >=, > and the operators are all left associative. For example, 3 > 2 > 1 is equivalent to (3 > 2) > 1, which evaluates to false. 3.5 Numbers A number represents a floating-point number. A number can have any double-precision 64-bit format IEEE 754 value [206][IEEE 754]. These include a special "Not-a-Number" (NaN) value, positive and negative infinity, and positive and negative zero. See [207]Section 4.2.3 of [208][JLS] for a summary of the key rules of the IEEE 754 standard. The numeric operators convert their operands to numbers as if by calling the [209]number function. The + operator performs addition. The - operator performs subtraction. NOTE: Since XML allows - in names, the - operator typically needs to be preceded by whitespace. For example, foo-bar evaluates to a node-set containing the child elements named foo-bar; foo - bar evaluates to the difference of the result of converting the [210]string-value of the first foo child element to a number and the result of converting the [211]string-value of the first bar child to a number. The div operator performs floating-point division according to IEEE 754. The mod operator returns the remainder from a truncating division. For example, * 5 mod 2 returns 1 * 5 mod -2 returns 1 * -5 mod 2 returns -1 * -5 mod -2 returns -1 NOTE: This is the same as the % operator in Java and ECMAScript. NOTE: This is not the same as the IEEE 754 remainder operation, which returns the remainder from a rounding division. Numeric Expressions [25] AdditiveExpr ::= [212]MultiplicativeExpr | [213]AdditiveExpr '+' [214]MultiplicativeExpr | [215]AdditiveExpr '-' [216]MultiplicativeExpr [26] MultiplicativeExpr ::= [217]UnaryExpr | [218]MultiplicativeExpr [219]MultiplyOperator [220]UnaryExpr | [221]MultiplicativeExpr 'div' [222]UnaryExpr | [223]MultiplicativeExpr 'mod' [224]UnaryExpr [27] UnaryExpr ::= [225]UnionExpr | '-' [226]UnaryExpr 3.6 Strings Strings consist of a sequence of zero or more characters, where a character is defined as in the XML Recommendation [227][XML]. A single character in XPath thus corresponds to a single Unicode abstract character with a single corresponding Unicode scalar value (see [228][Unicode]); this is not the same thing as a 16-bit Unicode code value: the Unicode coded character representation for an abstract character with Unicode scalar value greater that U+FFFF is a pair of 16-bit Unicode code values (a surrogate pair). In many programming languages, a string is represented by a sequence of 16-bit Unicode code values; implementations of XPath in such languages must take care to ensure that a surrogate pair is correctly treated as a single XPath character. NOTE: It is possible in Unicode for there to be two strings that should be treated as identical even though they consist of the distinct sequences of Unicode abstract characters. For example, some accented characters may be represented in either a precomposed or decomposed form. Therefore, XPath expressions may return unexpected results unless both the characters in the XPath expression and in the XML document have been normalized into a canonical form. See [229][Character Model]. 3.7 Lexical Structure When tokenizing, the longest possible token is always returned. For readability, whitespace may be used in expressions even though not explicitly allowed by the grammar: [230]ExprWhitespace may be freely added within patterns before or after any [231]ExprToken. The following special tokenization rules must be applied in the order specified to disambiguate the [232]ExprToken grammar: * If there is a preceding token and the preceding token is not one of @, ::, (, [, , or an [233]Operator, then a * must be recognized as a [234]MultiplyOperator and an [235]NCName must be recognized as an [236]OperatorName. * If the character following an [237]NCName (possibly after intervening [238]ExprWhitespace) is (, then the token must be recognized as a [239]NodeType or a [240]FunctionName. * If the two characters following an [241]NCName (possibly after intervening [242]ExprWhitespace) are ::, then the token must be recognized as an [243]AxisName. * Otherwise, the token must not be recognized as a [244]MultiplyOperator, an [245]OperatorName, a [246]NodeType, a [247]FunctionName, or an [248]AxisName. Expression Lexical Structure [28] ExprToken ::= '(' | ')' | '[' | ']' | '.' | '..' | '@' | ',' | '::' | [249]NameTest | [250]NodeType | [251]Operator | [252]FunctionName | [253]AxisName | [254]Literal | [255]Number | [256]VariableReference [29] Literal ::= '"' [^"]* '"' | "'" [^']* "'" [30] Number ::= [257]Digits ('.' [258]Digits?)? | '.' [259]Digits [31] Digits ::= [0-9]+ [32] Operator ::= [260]OperatorName | [261]MultiplyOperator | '/' | '//' | '|' | '+' | '-' | '=' | '!=' | '<' | '<=' | '>' | '>=' [33] OperatorName ::= 'and' | 'or' | 'mod' | 'div' [34] MultiplyOperator ::= '*' [35] FunctionName ::= [262]QName - [263]NodeType [36] VariableReference ::= '$' [264]QName [37] NameTest ::= '*' | [265]NCName ':' '*' | [266]QName [38] NodeType ::= 'comment' | 'text' | 'processing-instruction' | 'node' [39] ExprWhitespace ::= [267]S 4 Core Function Library This section describes functions that XPath implementations must always include in the function library that is used to evaluate expressions. Each function in the function library is specified using a function prototype, which gives the return type, the name of the function, and the type of the arguments. If an argument type is followed by a question mark, then the argument is optional; otherwise, the argument is required. 4.1 Node Set Functions Function: number last() The [268]last function returns a number equal to the [269]context size from the expression evaluation context. Function: number position() The [270]position function returns a number equal to the [271]context position from the expression evaluation context. Function: number count(node-set) The [272]count function returns the number of nodes in the argument node-set. Function: node-set id(object) The [273]id function selects elements by their unique ID (see [274][5.2.1 Unique IDs]). When the argument to [275]id is of type node-set, then the result is the union of the result of applying [276]id to the [277]string-value of each of the nodes in the argument node-set. When the argument to [278]id is of any other type, the argument is converted to a string as if by a call to the [279]string function; the string is split into a whitespace-separated list of tokens (whitespace is any sequence of characters matching the production [280]S); the result is a node-set containing the elements in the same document as the context node that have a unique ID equal to any of the tokens in the list. * id("foo") selects the element with unique ID foo * id("foo")/child::para[position()=5] selects the fifth para child of the element with unique ID foo Function: string local-name(node-set?) The [281]local-name function returns the local part of the [282]expanded-name of the node in the argument node-set that is first in [283]document order. If the argument node-set is empty or the first node has no [284]expanded-name, an empty string is returned. If the argument is omitted, it defaults to a node-set with the context node as its only member. Function: string namespace-uri(node-set?) The [285]namespace-uri function returns the namespace URI of the [286]expanded-name of the node in the argument node-set that is first in [287]document order. If the argument node-set is empty, the first node has no [288]expanded-name, or the namespace URI of the [289]expanded-name is null, an empty string is returned. If the argument is omitted, it defaults to a node-set with the context node as its only member. NOTE: The string returned by the [290]namespace-uri function will be empty except for element nodes and attribute nodes. Function: string name(node-set?) The [291]name function returns a string containing a [292]QName representing the [293]expanded-name of the node in the argument node-set that is first in [294]document order. The [295]QName must represent the [296]expanded-name with respect to the namespace declarations in effect on the node whose [297]expanded-name is being represented. Typically, this will be the [298]QName that occurred in the XML source. This need not be the case if there are namespace declarations in effect on the node that associate multiple prefixes with the same namespace. However, an implementation may include information about the original prefix in its representation of nodes; in this case, an implementation can ensure that the returned string is always the same as the [299]QName used in the XML source. If the argument node-set is empty or the first node has no [300]expanded-name, an empty string is returned. If the argument it omitted, it defaults to a node-set with the context node as its only member. NOTE: The string returned by the [301]name function will be the same as the string returned by the [302]local-name function except for element nodes and attribute nodes. 4.2 String Functions Function: string string(object?) The [303]string function converts an object to a string as follows: * A node-set is converted to a string by returning the [304]string-value of the node in the node-set that is first in [305]document order. If the node-set is empty, an empty string is returned. * A number is converted to a string as follows + NaN is converted to the string NaN + positive zero is converted to the string 0 + negative zero is converted to the string 0 + positive infinity is converted to the string Infinity + negative infinity is converted to the string -Infinity + if the number is an integer, the number is represented in decimal form as a [306]Number with no decimal point and no leading zeros, preceded by a minus sign (-) if the number is negative + otherwise, the number is represented in decimal form as a [307]Number including a decimal point with at least one digit before the decimal point and at least one digit after the decimal point, preceded by a minus sign (-) if the number is negative; there must be no leading zeros before the decimal point apart possibly from the one required digit immediately before the decimal point; beyond the one required digit after the decimal point there must be as many, but only as many, more digits as are needed to uniquely distinguish the number from all other IEEE 754 numeric values. * The boolean false value is converted to the string false. The boolean true value is converted to the string true. * An object of a type other than the four basic types is converted to a string in a way that is dependent on that type. If the argument is omitted, it defaults to a node-set with the context node as its only member. NOTE: The string function is not intended for converting numbers into strings for presentation to users. The format-number function and xsl:number element in [308][XSLT] provide this functionality. Function: string concat(string, string, string*) The [309]concat function returns the concatenation of its arguments. Function: boolean starts-with(string, string) The [310]starts-with function returns true if the first argument string starts with the second argument string, and otherwise returns false. Function: boolean contains(string, string) The [311]contains function returns true if the first argument string contains the second argument string, and otherwise returns false. Function: string substring-before(string, string) The [312]substring-before function returns the substring of the first argument string that precedes the first occurrence of the second argument string in the first argument string, or the empty string if the first argument string does not contain the second argument string. For example, substring-before("1999/04/01","/") returns 1999. Function: string substring-after(string, string) The [313]substring-after function returns the substring of the first argument string that follows the first occurrence of the second argument string in the first argument string, or the empty string if the first argument string does not contain the second argument string. For example, substring-after("1999/04/01","/") returns 04/01, and substring-after("1999/04/01","19") returns 99/04/01. Function: string substring(string, number, number?) The [314]substring function returns the substring of the first argument starting at the position specified in the second argument with length specified in the third argument. For example, substring("12345",2,3) returns "234". If the third argument is not specified, it returns the substring starting at the position specified in the second argument and continuing to the end of the string. For example, substring("12345",2) returns "2345". More precisely, each character in the string (see [315][3.6 Strings]) is considered to have a numeric position: the position of the first character is 1, the position of the second character is 2 and so on. NOTE: This differs from Java and ECMAScript, in which the String.substring method treats the position of the first character as 0. The returned substring contains those characters for which the position of the character is greater than or equal to the rounded value of the second argument and, if the third argument is specified, less than the sum of the rounded value of the second argument and the rounded value of the third argument; the comparisons and addition used for the above follow the standard IEEE 754 rules; rounding is done as if by a call to the [316]round function. The following examples illustrate various unusual cases: * substring("12345", 1.5, 2.6) returns "234" * substring("12345", 0, 3) returns "12" * substring("12345", 0 div 0, 3) returns "" * substring("12345", 1, 0 div 0) returns "" * substring("12345", -42, 1 div 0) returns "12345" * substring("12345", -1 div 0, 1 div 0) returns "" Function: number string-length(string?) The [317]string-length returns the number of characters in the string (see [318][3.6 Strings]). If the argument is omitted, it defaults to the context node converted to a string, in other words the [319]string-value of the context node. Function: string normalize-space(string?) The [320]normalize-space function returns the argument string with whitespace normalized by stripping leading and trailing whitespace and replacing sequences of whitespace characters by a single space. Whitespace characters are the same as those allowed by the [321]S production in XML. If the argument is omitted, it defaults to the context node converted to a string, in other words the [322]string-value of the context node. Function: string translate(string, string, string) The [323]translate function returns the first argument string with occurrences of characters in the second argument string replaced by the character at the corresponding position in the third argument string. For example, translate("bar","abc","ABC") returns the string BAr. If there is a character in the second argument string with no character at a corresponding position in the third argument string (because the second argument string is longer than the third argument string), then occurrences of that character in the first argument string are removed. For example, translate("--aaa--","abc-","ABC") returns "AAA". If a character occurs more than once in the second argument string, then the first occurrence determines the replacement character. If the third argument string is longer than the second argument string, then excess characters are ignored. NOTE: The [324]translate function is not a sufficient solution for case conversion in all languages. A future version of XPath may provide additional functions for case conversion. 4.3 Boolean Functions Function: boolean boolean(object) The [325]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 Function: boolean not(boolean) The [326]not function returns true if its argument is false, and false otherwise. Function: boolean true() The [327]true function returns true. Function: boolean false() The [328]false function returns false. Function: boolean lang(string) The [329]lang function returns true or false depending on whether the language of the context node as specified by xml:lang attributes is the same as or is a sublanguage of the language specified by the argument string. The language of the context node is determined by the value of the xml:lang attribute on the context node, or, if the context node has no xml:lang attribute, by the value of the xml:lang attribute on the nearest ancestor of the context node that has an xml:lang attribute. If there is no such attribute, then [330]lang returns false. If there is such an attribute, then [331]lang returns true if the attribute value is equal to the argument ignoring case, or if there is some suffix starting with - such that the attribute value is equal to the argument ignoring that suffix of the attribute value and ignoring case. For example, lang("en") would return true if the context node is any of these five elements:
4.4 Number Functions Function: number number(object?) The [332]number function converts its argument to a number as follows: * a string that consists of optional whitespace followed by an optional minus sign followed by a [333]Number followed by whitespace is converted to the IEEE 754 number that is nearest (according to the IEEE 754 round-to-nearest rule) to the mathematical value represented by the string; any other string is converted to NaN * boolean true is converted to 1; boolean false is converted to 0 * a node-set is first converted to a string as if by a call to the [334]string function and then converted in the same way as a string argument * an object of a type other than the four basic types is converted to a number in a way that is dependent on that type If the argument is omitted, it defaults to a node-set with the context node as its only member. NOTE: The [335]number function should not be used for conversion of numeric data occurring in an element in an XML document unless the element is of a type that represents numeric data in a language-neutral format (which would typically be transformed into a language-specific format for presentation to a user). In addition, the [336]number function cannot be used unless the language-neutral format used by the element is consistent with the XPath syntax for a [337]Number. Function: number sum(node-set) The [338]sum function returns the sum, for each node in the argument node-set, of the result of converting the [339]string-values of the node to a number. Function: number floor(number) The [340]floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer. Function: number ceiling(number) The [341]ceiling function returns the smallest (closest to negative infinity) number that is not less than the argument and that is an integer. Function: number round(number) The [342]round function returns the number that is closest to the argument and that is an integer. If there are two such numbers, then the one that is closest to positive infinity is returned. If the argument is NaN, then NaN is returned. If the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned. NOTE: For these last two cases, the result of calling the [343]round function is not the same as the result of adding 0.5 and then calling the [344]floor function. 5 Data Model XPath operates on an XML document as a tree. This section describes how XPath models an XML document as a tree. This model is conceptual only and does not mandate any particular implementation. The relationship of this model to the XML Information Set [345][XML Infoset] is described in [346][B XML Information Set Mapping]. XML documents operated on by XPath must conform to the XML Namespaces Recommendation [347][XML Names]. The tree contains nodes. There are seven types of node: * root nodes * element nodes * text nodes * attribute nodes * namespace nodes * processing instruction nodes * comment nodes For every type of node, there is a way of determining a string-value for a node of that type. For some types of node, the string-value is part of the node; for other types of node, the string-value is computed from the string-value of descendant nodes. NOTE: For element nodes and root nodes, the string-value of a node is not the same as the string returned by the DOM nodeValue method (see [348][DOM]). Some types of node also have an expanded-name, which is a pair consisting of a local part and a namespace URI. The local part is a string. The namespace URI is either null or a string. The namespace URI specified in the XML document can be a URI reference as defined in [349][RFC2396]; this means it can have a fragment identifier and can be relative. A relative URI should be resolved into an absolute URI during namespace processing: the namespace URIs of [350]expanded-names of nodes in the data model should be absolute. Two [351]expanded-names are equal if they have the same local part, and either both have a null namespace URI or both have non-null namespace URIs that are equal. There is an ordering, document order, defined on all the nodes in the document corresponding to the order in which the first character of the XML representation of each node occurs in the XML representation of the document after expansion of general entities. Thus, the root node will be the first node. Element nodes occur before their children. Thus, document order orders element nodes in order of the occurrence of their start-tag in the XML (after expansion of entities). The attribute nodes and namespace nodes of an element occur before the children of the element. The namespace nodes are defined to occur before the attribute nodes. The relative order of namespace nodes is implementation-dependent. The relative order of attribute nodes is implementation-dependent. Reverse document order is the reverse of [352]document order. Root nodes and element nodes have an ordered list of child nodes. Nodes never share children: if one node is not the same node as another node, then none of the children of the one node will be the same node as any of the children of another node. Every node other than the root node has exactly one parent, which is either an element node or the root node. A root node or an element node is the parent of each of its child nodes. The descendants of a node are the children of the node and the descendants of the children of the node. 5.1 Root Node The root node is the root of the tree. A root node does not occur except as the root of the tree. The element node for the document element is a child of the root node. The root node also has as children processing instruction and comment nodes for processing instructions and comments that occur in the prolog and after the end of the document element. The [353]string-value of the root node is the concatenation of the [354]string-values of all text node [355]descendants of the root node in document order. The root node does not have an [356]expanded-name. 5.2 Element Nodes There is an element node for every element in the document. An element node has an [357]expanded-name computed by expanding the [358]QName of the element specified in the tag in accordance with the XML Namespaces Recommendation [359][XML Names]. The namespace URI of the element's [360]expanded-name will be null if the [361]QName has no prefix and there is no applicable default namespace. NOTE: In the notation of Appendix A.3 of [362][XML Names], the local part of the expanded-name corresponds to the type attribute of the ExpEType element; the namespace URI of the expanded-name corresponds to the ns attribute of the ExpEType element, and is null if the ns attribute of the ExpEType element is omitted. The children of an element node are the element nodes, comment nodes, processing instruction nodes and text nodes for its content. Entity references to both internal and external entities are expanded. Character references are resolved. The [363]string-value of an element node is the concatenation of the [364]string-values of all text node [365]descendants of the element node in document order. 5.2.1 Unique IDs An element node may have a unique identifier (ID). This is the value of the attribute that is declared in the DTD as type ID. No two elements in a document may have the same unique ID. If an XML processor reports two elements in a document as having the same unique ID (which is possible only if the document is invalid) then the second element in document order must be treated as not having a unique ID. NOTE: If a document does not have a DTD, then no element in the document will have a unique ID. 5.3 Attribute Nodes Each element node has an associated set of attribute nodes; the element is the [366]parent of each of these attribute nodes; however, an attribute node is not a child of its parent element. NOTE: This is different from the DOM, which does not treat the element bearing an attribute as the parent of the attribute (see [367][DOM]). Elements never share attribute nodes: if one element node is not the same node as another element node, then none of the attribute nodes of the one element node will be the same node as the attribute nodes of another element node. NOTE: The = operator tests whether two nodes have the same value, not whether they are the same node. Thus attributes of two different elements may compare as equal using =, even though they are not the same node. A defaulted attribute is treated the same as a specified attribute. If an attribute was declared for the element type in the DTD, but the default was declared as #IMPLIED, and the attribute was not specified on the element, then the element's attribute set does not contain a node for the attribute. Some attributes, such as xml:lang and xml:space, have the semantics that they apply to all elements that are descendants of the element bearing the attribute, unless overridden with an instance of the same attribute on another descendant element. However, this does not affect where attribute nodes appear in the tree: an element has attribute nodes only for attributes that were explicitly specified in the start-tag or empty-element tag of that element or that were explicitly declared in the DTD with a default value. An attribute node has an [368]expanded-name and a [369]string-value. The [370]expanded-name is computed by expanding the [371]QName specified in the tag in the XML document in accordance with the XML Namespaces Recommendation [372][XML Names]. The namespace URI of the attribute's name will be null if the [373]QName of the attribute does not have a prefix. NOTE: In the notation of Appendix A.3 of [374][XML Names], the local part of the expanded-name corresponds to the name attribute of the ExpAName element; the namespace URI of the expanded-name corresponds to the ns attribute of the ExpAName element, and is null if the ns attribute of the ExpAName element is omitted. An attribute node has a [375]string-value. The [376]string-value is the normalized value as specified by the XML Recommendation [377][XML]. An attribute whose normalized value is a zero-length string is not treated specially: it results in an attribute node whose [378]string-value is a zero-length string. NOTE: It is possible for default attributes to be declared in an external DTD or an external parameter entity. The XML Recommendation does not require an XML processor to read an external DTD or an external parameter unless it is validating. A stylesheet or other facility that assumes that the XPath tree contains default attribute values declared in an external DTD or parameter entity may not work with some non-validating XML processors. There are no attribute nodes corresponding to attributes that declare namespaces (see [379][XML Names]). 5.4 Namespace Nodes Each element has an associated set of namespace nodes, one for each distinct namespace prefix that is in scope for the element (including the xml prefix, which is implicitly declared by the XML Namespaces Recommendation [380][XML Names]) and one for the default namespace if one is in scope for the element. The element is the [381]parent of each of these namespace nodes; however, a namespace node is not a child of its parent element. Elements never share namespace nodes: if one element node is not the same node as another element node, then none of the namespace nodes of the one element node will be the same node as the namespace nodes of another element node. This means that an element will have a namespace node: * for every attribute on the element whose name starts with xmlns:; * for every attribute on an ancestor element whose name starts xmlns: unless the element itself or a nearer ancestor redeclares the prefix; * for an xmlns attribute, if the element or some ancestor has an xmlns attribute, and the value of the xmlns attribute for the nearest such element is non-empty NOTE: An attribute xmlns="" "undeclares" the default namespace (see [382][XML Names]). A namespace node has an [383]expanded-name: the local part is the namespace prefix (this is empty if the namespace node is for the default namespace); the namespace URI is always null. The [384]string-value of a namespace node is the namespace URI that is being bound to the namespace prefix; if it is relative, it must be resolved just like a namespace URI in an [385]expanded-name. 5.5 Processing Instruction Nodes There is a processing instruction node for every processing instruction, except for any processing instruction that occurs within the document type declaration. A processing instruction has an [386]expanded-name: the local part is the processing instruction's target; the namespace URI is null. The [387]string-value of a processing instruction node is the part of the processing instruction following the target and any whitespace. It does not include the terminating ?>. NOTE: The XML declaration is not a processing instruction. Therefore, there is no processing instruction node corresponding to the XML declaration. 5.6 Comment Nodes There is a comment node for every comment, except for any comment that occurs within the document type declaration. The [388]string-value of comment is the content of the comment not including the opening . A comment node does not have an [389]expanded-name. 5.7 Text Nodes Character data is grouped into text nodes. As much character data as possible is grouped into each text node: a text node never has an immediately following or preceding sibling that is a text node. The [390]string-value of a text node is the character data. A text node always has at least one character of data. Each character within a CDATA section is treated as character data. Thus, in the source document will treated the same as <. Both will result in a single < character in a text node in the tree. Thus, a CDATA section is treated as if the were removed and every occurrence of < and & were replaced by < and & respectively. NOTE: When a text node that contains a < character is written out as XML, the < character must be escaped by, for example, using <, or including it in a CDATA section. Characters inside comments, processing instructions and attribute values do not produce text nodes. Line-endings in external entities are normalized to #xA as specified in the XML Recommendation [391][XML]. A text node does not have an [392]expanded-name. 6 Conformance XPath is intended primarily as a component that can be used by other specifications. Therefore, XPath relies on specifications that use XPath (such as [393][XPointer] and [394][XSLT]) to specify criteria for conformance of implementations of XPath and does not define any conformance criteria for independent implementations of XPath. _________________________________________________________________ A References A.1 Normative References IEEE 754 Institute of Electrical and Electronics Engineers. IEEE Standard for Binary Floating-Point Arithmetic. ANSI/IEEE Std 754-1985. RFC2396 T. Berners-Lee, R. Fielding, and L. Masinter. Uniform Resource Identifiers (URI): Generic Syntax. IETF RFC 2396. See [395]http://www.ietf.org/rfc/rfc2396.txt. XML World Wide Web Consortium. Extensible Markup Language (XML) 1.0. W3C Recommendation. See [396]http://www.w3.org/TR/1998/REC-xml-19980210 XML Names World Wide Web Consortium. Namespaces in XML. W3C Recommendation. See [397]http://www.w3.org/TR/REC-xml-names A.2 Other References Character Model World Wide Web Consortium. Character Model for the World Wide Web. W3C Working Draft. See [398]http://www.w3.org/TR/WD-charmod DOM World Wide Web Consortium. Document Object Model (DOM) Level 1 Specification. W3C Recommendation. See [399]http://www.w3.org/TR/REC-DOM-Level-1 JLS J. Gosling, B. Joy, and G. Steele. The Java Language Specification. See [400]http://java.sun.com/docs/books/jls/index.html. ISO/IEC 10646 ISO (International Organization for Standardization). ISO/IEC 10646-1:1993, Information technology -- Universal Multiple-Octet Coded Character Set (UCS) -- Part 1: Architecture and Basic Multilingual Plane. International Standard. See [401]http://www.iso.ch/cate/d18741.html. TEI C.M. Sperberg-McQueen, L. Burnard Guidelines for Electronic Text Encoding and Interchange. See [402]http://etext.virginia.edu/TEI.html. Unicode Unicode Consortium. The Unicode Standard. See [403]http://www.unicode.org/unicode/standard/standard.html. XML Infoset World Wide Web Consortium. XML Information Set. W3C Working Draft. See [404]http://www.w3.org/TR/xml-infoset XPointer World Wide Web Consortium. XML Pointer Language (XPointer). W3C Working Draft. See [405]http://www.w3.org/TR/WD-xptr XQL J. Robie, J. Lapp, D. Schach. XML Query Language (XQL). See [406]http://www.w3.org/TandS/QL/QL98/pp/xql.html XSLT World Wide Web Consortium. XSL Transformations (XSLT). W3C Recommendation. See [407]http://www.w3.org/TR/xslt B XML Information Set Mapping (Non-Normative) The nodes in the XPath data model can be derived from the information items provided by the XML Information Set [408][XML Infoset] as follows: NOTE: A new version of the XML Information Set Working Draft, which will replace the May 17 version, was close to completion at the time when the preparation of this version of XPath was completed and was expected to be released at the same time or shortly after the release of this version of XPath. The mapping is given for this new version of the XML Information Set Working Draft. If the new version of the XML Information Set Working has not yet been released, W3C members may consult the internal Working Group version [409]http://www.w3.org/XML/Group/1999/09/WD-xml-infoset-19990915.ht ml ([410]members only). * The root node comes from the document information item. The children of the root node come from the children and children - comments properties. * An element node comes from an element information item. The children of an element node come from the children and children - comments properties. The attributes of an element node come from the attributes property. The namespaces of an element node come from the in-scope namespaces property. The local part of the [411]expanded-name of the element node comes from the local name property. The namespace URI of the [412]expanded-name of the element node comes from the namespace URI property. The unique ID of the element node comes from the children property of the attribute information item in the attributes property that has an attribute type property equal to ID. * An attribute node comes from an attribute information item. The local part of the [413]expanded-name of the attribute node comes from the local name property. The namespace URI of the [414]expanded-name of the attribute node comes from the namespace URI property. The [415]string-value of the node comes from concatenating the character code property of each member of the children property. * A text node comes from a sequence of one or more consecutive character information items. The [416]string-value of the node comes from concatenating the character code property of each of the character information items. * A processing instruction node comes from a processing instruction information item. The local part of the [417]expanded-name of the node comes from the target property. (The namespace URI part of the [418]expanded-name of the node is null.) The [419]string-value of the node comes from the content property. There are no processing instruction nodes for processing instruction items that are children of document type declaration information item. * A comment node comes from a comment information item. The [420]string-value of the node comes from the content property. There are no comment nodes for comment information items that are children of document type declaration information item. * A namespace node comes from a namespace declaration information item. The local part of the [421]expanded-name of the node comes from the prefix property. (The namespace URI part of the [422]expanded-name of the node is null.) The [423]string-value of the node comes from the namespace URI property. References 1. http://www.w3.org/ 2. http://www.w3.org/TR/1999/REC-xpath-19991116 3. http://www.w3.org/TR/1999/REC-xpath-19991116.xml 4. http://www.w3.org/TR/1999/REC-xpath-19991116.html 5. http://www.w3.org/TR/xpath 6. http://www.w3.org/TR/1999/PR-xpath-19991008 7. http://www.w3.org/1999/08/WD-xpath-19990813 8. http://www.w3.org/1999/07/WD-xpath-19990709 9. http://www.w3.org/TR/1999/WD-xslt-19990421 10. mailto:jjc@jclark.com 11. mailto:Steven_DeRose@Brown.edu 12. http://www.w3.org/Consortium/Legal/ipr-notice.html#Copyright 13. http://www.w3.org/ 14. http://www.lcs.mit.edu/ 15. http://www.inria.fr/ 16. http://www.keio.ac.jp/ 17. http://www.w3.org/Consortium/Legal/ipr-notice.html#Legal_Disclaimer 18. http://www.w3.org/Consortium/Legal/ipr-notice.html#W3C_Trademarks 19. http://www.w3.org/Consortium/Legal/copyright-documents.html 20. http://www.w3.org/Consortium/Legal/copyright-software.html 21. http://www.w3.org/Consortium/Process/#RecsW3C 22. http://www.w3.org/1999/11/REC-xpath-19991116-errata 23. mailto:www-xpath-comments@w3.org 24. http://lists.w3.org/Archives/Public/www-xpath-comments 25. http://www.w3.org/Style/XSL/translations.html 26. http://www.w3.org/TR 27. http://www.w3.org/Style/Activity 28. http://www.w3.org/XML/Activity 29. http://www.w3.org/TR/xpath.html#section-Introduction 30. http://www.w3.org/TR/xpath.html#location-paths 31. http://www.w3.org/TR/xpath.html#section-Location-Steps 32. http://www.w3.org/TR/xpath.html#axes 33. http://www.w3.org/TR/xpath.html#node-tests 34. http://www.w3.org/TR/xpath.html#predicates 35. http://www.w3.org/TR/xpath.html#path-abbrev 36. http://www.w3.org/TR/xpath.html#section-Expressions 37. http://www.w3.org/TR/xpath.html#section-Basics 38. http://www.w3.org/TR/xpath.html#section-Function-Calls 39. http://www.w3.org/TR/xpath.html#node-sets 40. http://www.w3.org/TR/xpath.html#booleans 41. http://www.w3.org/TR/xpath.html#numbers 42. http://www.w3.org/TR/xpath.html#strings 43. http://www.w3.org/TR/xpath.html#exprlex 44. http://www.w3.org/TR/xpath.html#corelib 45. http://www.w3.org/TR/xpath.html#section-Node-Set-Functions 46. http://www.w3.org/TR/xpath.html#section-String-Functions 47. http://www.w3.org/TR/xpath.html#section-Boolean-Functions 48. http://www.w3.org/TR/xpath.html#section-Number-Functions 49. http://www.w3.org/TR/xpath.html#data-model 50. http://www.w3.org/TR/xpath.html#root-node 51. http://www.w3.org/TR/xpath.html#element-nodes 52. http://www.w3.org/TR/xpath.html#unique-id 53. http://www.w3.org/TR/xpath.html#attribute-nodes 54. http://www.w3.org/TR/xpath.html#namespace-nodes 55. http://www.w3.org/TR/xpath.html#section-Processing-Instruction-Nodes 56. http://www.w3.org/TR/xpath.html#section-Comment-Nodes 57. http://www.w3.org/TR/xpath.html#section-Text-Nodes 58. http://www.w3.org/TR/xpath.html#section-Conformance 59. http://www.w3.org/TR/xpath.html#section-References 60. http://www.w3.org/TR/xpath.html#section-Normative-References 61. http://www.w3.org/TR/xpath.html#section-Other-References 62. http://www.w3.org/TR/xpath.html#infoset 63. http://www.w3.org/TR/xpath.html#XSLT 64. http://www.w3.org/TR/xpath.html#XPTR 65. http://www.w3.org/TR/xpath.html#XML 66. http://www.w3.org/TR/WD-xslt#patterns 67. http://www.w3.org/TR/xpath.html#dt-string-value 68. http://www.w3.org/TR/xpath.html#XMLNAMES 69. http://www.w3.org/TR/xpath.html#dt-expanded-name 70. http://www.w3.org/TR/xpath.html#data-model 71. http://www.w3.org/TR/xpath.html#NT-Expr 72. http://www.w3.org/TR/xpath.html#corelib 73. http://www.w3.org/TR/xpath.html#predicates 74. http://www.w3.org/TR/xpath.html#NT-LocationPath 75. http://www.w3.org/TR/REC-xml-names#NT-QName 76. http://www.w3.org/TR/REC-xml-names#NT-NCName 77. http://www.w3.org/TR/xpath.html#XMLNAMES 78. http://www.w3.org/TR/REC-xml#NT-S 79. http://www.w3.org/TR/xpath.html#XML 80. http://www.w3.org/TR/xpath.html#XML 81. http://www.w3.org/TR/xpath.html#exprlex 82. http://www.w3.org/TR/xpath.html#NT-LocationPath 83. http://www.w3.org/TR/xpath.html#NT-Expr 84. http://www.w3.org/TR/xpath.html#path-abbrev 85. http://www.w3.org/TR/xpath.html#dt-string-value 86. http://www.w3.org/TR/xpath.html#NT-RelativeLocationPath 87. http://www.w3.org/TR/xpath.html#NT-AbsoluteLocationPath 88. http://www.w3.org/TR/xpath.html#NT-RelativeLocationPath 89. http://www.w3.org/TR/xpath.html#NT-AbbreviatedAbsoluteLocationPath 90. http://www.w3.org/TR/xpath.html#NT-Step 91. http://www.w3.org/TR/xpath.html#NT-RelativeLocationPath 92. http://www.w3.org/TR/xpath.html#NT-Step 93. http://www.w3.org/TR/xpath.html#NT-AbbreviatedRelativeLocationPath 94. http://www.w3.org/TR/xpath.html#dt-expanded-name 95. http://www.w3.org/TR/xpath.html#dt-expanded-name 96. http://www.w3.org/TR/xpath.html#axes 97. http://www.w3.org/TR/xpath.html#node-tests 98. http://www.w3.org/TR/xpath.html#predicates 99. http://www.w3.org/TR/xpath.html#NT-AxisSpecifier 100. http://www.w3.org/TR/xpath.html#NT-NodeTest 101. http://www.w3.org/TR/xpath.html#NT-Predicate 102. http://www.w3.org/TR/xpath.html#NT-AbbreviatedStep 103. http://www.w3.org/TR/xpath.html#NT-AxisName 104. http://www.w3.org/TR/xpath.html#NT-AbbreviatedAxisSpecifier 105. http://www.w3.org/TR/xpath.html#dt-parent 106. http://www.w3.org/TR/xpath.html#dt-parent 107. http://www.w3.org/TR/REC-xml-names#NT-QName 108. http://www.w3.org/TR/xpath.html#data-model 109. http://www.w3.org/TR/xpath.html#dt-expanded-name 110. http://www.w3.org/TR/xpath.html#dt-expanded-name 111. http://www.w3.org/TR/REC-xml-names#NT-QName 112. http://www.w3.org/TR/REC-xml-names#NT-QName 113. http://www.w3.org/TR/xpath.html#dt-expanded-name 114. http://www.w3.org/TR/REC-xml-names#NT-QName 115. http://www.w3.org/TR/REC-xml-names#NT-QName 116. http://www.w3.org/TR/REC-xml-names#NT-NCName 117. http://www.w3.org/TR/REC-xml-names#NT-QName 118. http://www.w3.org/TR/xpath.html#dt-expanded-name 119. http://www.w3.org/TR/xpath.html#NT-Literal 120. http://www.w3.org/TR/xpath.html#NT-Literal 121. http://www.w3.org/TR/xpath.html#NT-NameTest 122. http://www.w3.org/TR/xpath.html#NT-NodeType 123. http://www.w3.org/TR/xpath.html#NT-Literal 124. http://www.w3.org/TR/xpath.html#dt-document-order 125. http://www.w3.org/TR/xpath.html#dt-document-order 126. http://www.w3.org/TR/xpath.html#NT-PredicateExpr 127. http://www.w3.org/TR/xpath.html#dt-proximity-position 128. http://www.w3.org/TR/xpath.html#NT-PredicateExpr 129. http://www.w3.org/TR/xpath.html#NT-PredicateExpr 130. http://www.w3.org/TR/xpath.html#NT-Expr 131. http://www.w3.org/TR/xpath.html#function-boolean 132. http://www.w3.org/TR/xpath.html#NT-PredicateExpr 133. http://www.w3.org/TR/xpath.html#NT-Expr 134. http://www.w3.org/TR/xpath.html#dt-string-value 135. http://www.w3.org/TR/xpath.html#NT-RelativeLocationPath 136. http://www.w3.org/TR/xpath.html#NT-RelativeLocationPath 137. http://www.w3.org/TR/xpath.html#NT-Step 138. http://www.w3.org/TR/xpath.html#NT-VariableReference 139. http://www.w3.org/TR/xpath.html#NT-OrExpr 140. http://www.w3.org/TR/xpath.html#NT-VariableReference 141. http://www.w3.org/TR/xpath.html#NT-Expr 142. http://www.w3.org/TR/xpath.html#NT-Literal 143. http://www.w3.org/TR/xpath.html#NT-Number 144. http://www.w3.org/TR/xpath.html#NT-FunctionCall 145. http://www.w3.org/TR/xpath.html#NT-FunctionCall 146. http://www.w3.org/TR/xpath.html#NT-FunctionName 147. http://www.w3.org/TR/xpath.html#NT-Argument 148. http://www.w3.org/TR/xpath.html#NT-FunctionCall 149. http://www.w3.org/TR/xpath.html#function-string 150. http://www.w3.org/TR/xpath.html#function-number 151. http://www.w3.org/TR/xpath.html#function-boolean 152. http://www.w3.org/TR/xpath.html#NT-FunctionName 153. http://www.w3.org/TR/xpath.html#NT-Argument 154. http://www.w3.org/TR/xpath.html#NT-Argument 155. http://www.w3.org/TR/xpath.html#NT-Expr 156. http://www.w3.org/TR/xpath.html#NT-Predicate 157. http://www.w3.org/TR/xpath.html#NT-Predicate 158. http://www.w3.org/TR/xpath.html#NT-Predicate 159. http://www.w3.org/TR/xpath.html#NT-PathExpr 160. http://www.w3.org/TR/xpath.html#NT-UnionExpr 161. http://www.w3.org/TR/xpath.html#NT-PathExpr 162. http://www.w3.org/TR/xpath.html#NT-LocationPath 163. http://www.w3.org/TR/xpath.html#NT-FilterExpr 164. http://www.w3.org/TR/xpath.html#NT-FilterExpr 165. http://www.w3.org/TR/xpath.html#NT-RelativeLocationPath 166. http://www.w3.org/TR/xpath.html#NT-FilterExpr 167. http://www.w3.org/TR/xpath.html#NT-RelativeLocationPath 168. http://www.w3.org/TR/xpath.html#NT-PrimaryExpr 169. http://www.w3.org/TR/xpath.html#NT-FilterExpr 170. http://www.w3.org/TR/xpath.html#NT-Predicate 171. http://www.w3.org/TR/xpath.html#function-boolean 172. http://www.w3.org/TR/xpath.html#function-boolean 173. http://www.w3.org/TR/xpath.html#NT-EqualityExpr 174. http://www.w3.org/TR/xpath.html#NT-RelationalExpr 175. http://www.w3.org/TR/xpath.html#NT-RelationalExpr 176. http://www.w3.org/TR/xpath.html#NT-AdditiveExpr 177. http://www.w3.org/TR/xpath.html#dt-string-value 178. http://www.w3.org/TR/xpath.html#dt-string-value 179. http://www.w3.org/TR/xpath.html#function-number 180. http://www.w3.org/TR/xpath.html#dt-string-value 181. http://www.w3.org/TR/xpath.html#function-boolean 182. http://www.w3.org/TR/xpath.html#function-boolean 183. http://www.w3.org/TR/xpath.html#function-number 184. http://www.w3.org/TR/xpath.html#function-string 185. http://www.w3.org/TR/xpath.html#IEEE754 186. http://www.w3.org/TR/xpath.html#NT-AndExpr 187. http://www.w3.org/TR/xpath.html#NT-OrExpr 188. http://www.w3.org/TR/xpath.html#NT-AndExpr 189. http://www.w3.org/TR/xpath.html#NT-EqualityExpr 190. http://www.w3.org/TR/xpath.html#NT-AndExpr 191. http://www.w3.org/TR/xpath.html#NT-EqualityExpr 192. http://www.w3.org/TR/xpath.html#NT-RelationalExpr 193. http://www.w3.org/TR/xpath.html#NT-EqualityExpr 194. http://www.w3.org/TR/xpath.html#NT-RelationalExpr 195. http://www.w3.org/TR/xpath.html#NT-EqualityExpr 196. http://www.w3.org/TR/xpath.html#NT-RelationalExpr 197. http://www.w3.org/TR/xpath.html#NT-AdditiveExpr 198. http://www.w3.org/TR/xpath.html#NT-RelationalExpr 199. http://www.w3.org/TR/xpath.html#NT-AdditiveExpr 200. http://www.w3.org/TR/xpath.html#NT-RelationalExpr 201. http://www.w3.org/TR/xpath.html#NT-AdditiveExpr 202. http://www.w3.org/TR/xpath.html#NT-RelationalExpr 203. http://www.w3.org/TR/xpath.html#NT-AdditiveExpr 204. http://www.w3.org/TR/xpath.html#NT-RelationalExpr 205. http://www.w3.org/TR/xpath.html#NT-AdditiveExpr 206. http://www.w3.org/TR/xpath.html#IEEE754 207. http://java.sun.com/docs/books/jls/html/4.doc.html#9208 208. http://www.w3.org/TR/xpath.html#JLS 209. http://www.w3.org/TR/xpath.html#function-number 210. http://www.w3.org/TR/xpath.html#dt-string-value 211. http://www.w3.org/TR/xpath.html#dt-string-value 212. http://www.w3.org/TR/xpath.html#NT-MultiplicativeExpr 213. http://www.w3.org/TR/xpath.html#NT-AdditiveExpr 214. http://www.w3.org/TR/xpath.html#NT-MultiplicativeExpr 215. http://www.w3.org/TR/xpath.html#NT-AdditiveExpr 216. http://www.w3.org/TR/xpath.html#NT-MultiplicativeExpr 217. http://www.w3.org/TR/xpath.html#NT-UnaryExpr 218. http://www.w3.org/TR/xpath.html#NT-MultiplicativeExpr 219. http://www.w3.org/TR/xpath.html#NT-MultiplyOperator 220. http://www.w3.org/TR/xpath.html#NT-UnaryExpr 221. http://www.w3.org/TR/xpath.html#NT-MultiplicativeExpr 222. http://www.w3.org/TR/xpath.html#NT-UnaryExpr 223. http://www.w3.org/TR/xpath.html#NT-MultiplicativeExpr 224. http://www.w3.org/TR/xpath.html#NT-UnaryExpr 225. http://www.w3.org/TR/xpath.html#NT-UnionExpr 226. http://www.w3.org/TR/xpath.html#NT-UnaryExpr 227. http://www.w3.org/TR/xpath.html#XML 228. http://www.w3.org/TR/xpath.html#UNICODE 229. http://www.w3.org/TR/xpath.html#CHARMOD 230. http://www.w3.org/TR/xpath.html#NT-ExprWhitespace 231. http://www.w3.org/TR/xpath.html#NT-ExprToken 232. http://www.w3.org/TR/xpath.html#NT-ExprToken 233. http://www.w3.org/TR/xpath.html#NT-Operator 234. http://www.w3.org/TR/xpath.html#NT-MultiplyOperator 235. http://www.w3.org/TR/REC-xml-names#NT-NCName 236. http://www.w3.org/TR/xpath.html#NT-OperatorName 237. http://www.w3.org/TR/REC-xml-names#NT-NCName 238. http://www.w3.org/TR/xpath.html#NT-ExprWhitespace 239. http://www.w3.org/TR/xpath.html#NT-NodeType 240. http://www.w3.org/TR/xpath.html#NT-FunctionName 241. http://www.w3.org/TR/REC-xml-names#NT-NCName 242. http://www.w3.org/TR/xpath.html#NT-ExprWhitespace 243. http://www.w3.org/TR/xpath.html#NT-AxisName 244. http://www.w3.org/TR/xpath.html#NT-MultiplyOperator 245. http://www.w3.org/TR/xpath.html#NT-OperatorName 246. http://www.w3.org/TR/xpath.html#NT-NodeType 247. http://www.w3.org/TR/xpath.html#NT-FunctionName 248. http://www.w3.org/TR/xpath.html#NT-AxisName 249. http://www.w3.org/TR/xpath.html#NT-NameTest 250. http://www.w3.org/TR/xpath.html#NT-NodeType 251. http://www.w3.org/TR/xpath.html#NT-Operator 252. http://www.w3.org/TR/xpath.html#NT-FunctionName 253. http://www.w3.org/TR/xpath.html#NT-AxisName 254. http://www.w3.org/TR/xpath.html#NT-Literal 255. http://www.w3.org/TR/xpath.html#NT-Number 256. http://www.w3.org/TR/xpath.html#NT-VariableReference 257. http://www.w3.org/TR/xpath.html#NT-Digits 258. http://www.w3.org/TR/xpath.html#NT-Digits 259. http://www.w3.org/TR/xpath.html#NT-Digits 260. http://www.w3.org/TR/xpath.html#NT-OperatorName 261. http://www.w3.org/TR/xpath.html#NT-MultiplyOperator 262. http://www.w3.org/TR/REC-xml-names#NT-QName 263. http://www.w3.org/TR/xpath.html#NT-NodeType 264. http://www.w3.org/TR/REC-xml-names#NT-QName 265. http://www.w3.org/TR/REC-xml-names#NT-NCName 266. http://www.w3.org/TR/REC-xml-names#NT-QName 267. http://www.w3.org/TR/REC-xml#NT-S 268. http://www.w3.org/TR/xpath.html#function-last 269. http://www.w3.org/TR/xpath.html#dt-context-size 270. http://www.w3.org/TR/xpath.html#function-position 271. http://www.w3.org/TR/xpath.html#dt-context-position 272. http://www.w3.org/TR/xpath.html#function-count 273. http://www.w3.org/TR/xpath.html#function-id 274. http://www.w3.org/TR/xpath.html#unique-id 275. http://www.w3.org/TR/xpath.html#function-id 276. http://www.w3.org/TR/xpath.html#function-id 277. http://www.w3.org/TR/xpath.html#dt-string-value 278. http://www.w3.org/TR/xpath.html#function-id 279. http://www.w3.org/TR/xpath.html#function-string 280. http://www.w3.org/TR/REC-xml#NT-S 281. http://www.w3.org/TR/xpath.html#function-local-name 282. http://www.w3.org/TR/xpath.html#dt-expanded-name 283. http://www.w3.org/TR/xpath.html#dt-document-order 284. http://www.w3.org/TR/xpath.html#dt-expanded-name 285. http://www.w3.org/TR/xpath.html#function-namespace-uri 286. http://www.w3.org/TR/xpath.html#dt-expanded-name 287. http://www.w3.org/TR/xpath.html#dt-document-order 288. http://www.w3.org/TR/xpath.html#dt-expanded-name 289. http://www.w3.org/TR/xpath.html#dt-expanded-name 290. http://www.w3.org/TR/xpath.html#function-namespace-uri 291. http://www.w3.org/TR/xpath.html#function-name 292. http://www.w3.org/TR/REC-xml-names#NT-QName 293. http://www.w3.org/TR/xpath.html#dt-expanded-name 294. http://www.w3.org/TR/xpath.html#dt-document-order 295. http://www.w3.org/TR/REC-xml-names#NT-QName 296. http://www.w3.org/TR/xpath.html#dt-expanded-name 297. http://www.w3.org/TR/xpath.html#dt-expanded-name 298. http://www.w3.org/TR/REC-xml-names#NT-QName 299. http://www.w3.org/TR/REC-xml-names#NT-QName 300. http://www.w3.org/TR/xpath.html#dt-expanded-name 301. http://www.w3.org/TR/xpath.html#function-name 302. http://www.w3.org/TR/xpath.html#function-local-name 303. http://www.w3.org/TR/xpath.html#function-string 304. http://www.w3.org/TR/xpath.html#dt-string-value 305. http://www.w3.org/TR/xpath.html#dt-document-order 306. http://www.w3.org/TR/xpath.html#NT-Number 307. http://www.w3.org/TR/xpath.html#NT-Number 308. http://www.w3.org/TR/xpath.html#XSLT 309. http://www.w3.org/TR/xpath.html#function-concat 310. http://www.w3.org/TR/xpath.html#function-starts-with 311. http://www.w3.org/TR/xpath.html#function-contains 312. http://www.w3.org/TR/xpath.html#function-substring-before 313. http://www.w3.org/TR/xpath.html#function-substring-after 314. http://www.w3.org/TR/xpath.html#function-substring 315. http://www.w3.org/TR/xpath.html#strings 316. http://www.w3.org/TR/xpath.html#function-round 317. http://www.w3.org/TR/xpath.html#function-string-length 318. http://www.w3.org/TR/xpath.html#strings 319. http://www.w3.org/TR/xpath.html#dt-string-value 320. http://www.w3.org/TR/xpath.html#function-normalize-space 321. http://www.w3.org/TR/REC-xml#NT-S 322. http://www.w3.org/TR/xpath.html#dt-string-value 323. http://www.w3.org/TR/xpath.html#function-translate 324. http://www.w3.org/TR/xpath.html#function-translate 325. http://www.w3.org/TR/xpath.html#function-boolean 326. http://www.w3.org/TR/xpath.html#function-not 327. http://www.w3.org/TR/xpath.html#function-true 328. http://www.w3.org/TR/xpath.html#function-false 329. http://www.w3.org/TR/xpath.html#function-lang 330. http://www.w3.org/TR/xpath.html#function-lang 331. http://www.w3.org/TR/xpath.html#function-lang 332. http://www.w3.org/TR/xpath.html#function-number 333. http://www.w3.org/TR/xpath.html#NT-Number 334. http://www.w3.org/TR/xpath.html#function-string 335. http://www.w3.org/TR/xpath.html#function-number 336. http://www.w3.org/TR/xpath.html#function-number 337. http://www.w3.org/TR/xpath.html#NT-Number 338. http://www.w3.org/TR/xpath.html#function-sum 339. http://www.w3.org/TR/xpath.html#dt-string-value 340. http://www.w3.org/TR/xpath.html#function-floor 341. http://www.w3.org/TR/xpath.html#function-ceiling 342. http://www.w3.org/TR/xpath.html#function-round 343. http://www.w3.org/TR/xpath.html#function-round 344. http://www.w3.org/TR/xpath.html#function-floor 345. http://www.w3.org/TR/xpath.html#XINFO 346. http://www.w3.org/TR/xpath.html#infoset 347. http://www.w3.org/TR/xpath.html#XMLNAMES 348. http://www.w3.org/TR/xpath.html#DOM 349. http://www.w3.org/TR/xpath.html#RFC2396 350. http://www.w3.org/TR/xpath.html#dt-expanded-name 351. http://www.w3.org/TR/xpath.html#dt-expanded-name 352. http://www.w3.org/TR/xpath.html#dt-document-order 353. http://www.w3.org/TR/xpath.html#dt-string-value 354. http://www.w3.org/TR/xpath.html#dt-string-value 355. http://www.w3.org/TR/xpath.html#dt-descendants 356. http://www.w3.org/TR/xpath.html#dt-expanded-name 357. http://www.w3.org/TR/xpath.html#dt-expanded-name 358. http://www.w3.org/TR/REC-xml-names#NT-QName 359. http://www.w3.org/TR/xpath.html#XMLNAMES 360. http://www.w3.org/TR/xpath.html#dt-expanded-name 361. http://www.w3.org/TR/REC-xml-names#NT-QName 362. http://www.w3.org/TR/xpath.html#XMLNAMES 363. http://www.w3.org/TR/xpath.html#dt-string-value 364. http://www.w3.org/TR/xpath.html#dt-string-value 365. http://www.w3.org/TR/xpath.html#dt-descendants 366. http://www.w3.org/TR/xpath.html#dt-parent 367. http://www.w3.org/TR/xpath.html#DOM 368. http://www.w3.org/TR/xpath.html#dt-expanded-name 369. http://www.w3.org/TR/xpath.html#dt-string-value 370. http://www.w3.org/TR/xpath.html#dt-expanded-name 371. http://www.w3.org/TR/REC-xml-names#NT-QName 372. http://www.w3.org/TR/xpath.html#XMLNAMES 373. http://www.w3.org/TR/REC-xml-names#NT-QName 374. http://www.w3.org/TR/xpath.html#XMLNAMES 375. http://www.w3.org/TR/xpath.html#dt-string-value 376. http://www.w3.org/TR/xpath.html#dt-string-value 377. http://www.w3.org/TR/xpath.html#XML 378. http://www.w3.org/TR/xpath.html#dt-string-value 379. http://www.w3.org/TR/xpath.html#XMLNAMES 380. http://www.w3.org/TR/xpath.html#XMLNAMES 381. http://www.w3.org/TR/xpath.html#dt-parent 382. http://www.w3.org/TR/xpath.html#XMLNAMES 383. http://www.w3.org/TR/xpath.html#dt-expanded-name 384. http://www.w3.org/TR/xpath.html#dt-string-value 385. http://www.w3.org/TR/xpath.html#dt-expanded-name 386. http://www.w3.org/TR/xpath.html#dt-expanded-name 387. http://www.w3.org/TR/xpath.html#dt-string-value 388. http://www.w3.org/TR/xpath.html#dt-string-value 389. http://www.w3.org/TR/xpath.html#dt-expanded-name 390. http://www.w3.org/TR/xpath.html#dt-string-value 391. http://www.w3.org/TR/xpath.html#XML 392. http://www.w3.org/TR/xpath.html#dt-expanded-name 393. http://www.w3.org/TR/xpath.html#XPTR 394. http://www.w3.org/TR/xpath.html#XSLT 395. http://www.ietf.org/rfc/rfc2396.txt 396. http://www.w3.org/TR/1998/REC-xml-19980210 397. http://www.w3.org/TR/REC-xml-names 398. http://www.w3.org/TR/WD-charmod 399. http://www.w3.org/TR/REC-DOM-Level-1 400. http://java.sun.com/docs/books/jls/index.html 401. http://www.iso.ch/cate/d18741.html 402. http://etext.virginia.edu/TEI.html 403. http://www.unicode.org/unicode/standard/standard.html 404. http://www.w3.org/TR/xml-infoset 405. http://www.w3.org/TR/WD-xptr 406. http://www.w3.org/TandS/QL/QL98/pp/xql.html 407. http://www.w3.org/TR/xslt 408. http://www.w3.org/TR/xpath.html#XINFO 409. http://www.w3.org/XML/Group/1999/09/WD-xml-infoset-19990915.html 410. http://cgi.w3.org/MemberAccess/ 411. http://www.w3.org/TR/xpath.html#dt-expanded-name 412. http://www.w3.org/TR/xpath.html#dt-expanded-name 413. http://www.w3.org/TR/xpath.html#dt-expanded-name 414. http://www.w3.org/TR/xpath.html#dt-expanded-name 415. http://www.w3.org/TR/xpath.html#dt-string-value 416. http://www.w3.org/TR/xpath.html#dt-string-value 417. http://www.w3.org/TR/xpath.html#dt-expanded-name 418. http://www.w3.org/TR/xpath.html#dt-expanded-name 419. http://www.w3.org/TR/xpath.html#dt-string-value 420. http://www.w3.org/TR/xpath.html#dt-string-value 421. http://www.w3.org/TR/xpath.html#dt-expanded-name 422. http://www.w3.org/TR/xpath.html#dt-expanded-name 423. http://www.w3.org/TR/xpath.html#dt-string-value