Xpath keeps simple treating sin-gle nodes and sets node the same
|
|
---|
XPath is a simple language, the key, omnipresent component of which is the expression. An XPath expression is simply some combination of the XPath language elements—operators, paths, variables, predicates, function calls, names, and/or literals. Basically, any time that you write XPath you write an XPath expression.
An XPath expression is evaluated to a data type. XPath has four data types: node sets, Booleans, numbers, and strings. They are collectively known as objects. Generally, these types can interchange with one another—for instance, it’s not an error to pass a node set to a string function. It just interprets the string value of the first node as a string. Let’s look at each of these data types in detail.
■■ Subtraction (()
XSLT In-Depth | 345 |
---|
■■ Multiplication (*)
An XPath boolean value is either true or false, and boolean expressions, covered earlier when you learned about conditional processing, evaluate to either true or false.
Location Paths
This form probably looks unfamiliar to you, and you may be unconvinced that this was the same language that you were using earlier. A couple of explanations are in order. First, the predicate isn’t required. Second, the child axis is the default axis, which means that a statement such as:
ROWSET/ROW