Given that any type other than a node-set cannot be coerced into a node-set, how do we determine,at runtime, if the result of an XPath expression is a node-set? Although I guess it shouldn't matter, I'm using Sablotron for processing. Thanks in advance.
Asked
Active
Viewed 663 times
3
1 Answers
1
You can ask for the maximum position. If it is greater than 1 the result is a list:
max(some/path/position())

ceving
- 21,900
- 13
- 104
- 178
/books/book/title[contains(.,'ABC')]
) However, if the XPath expression is not a node-set then the language does not support the addition of the predicate at the endsubstring(/books/book/title,1,3)[contains(.,'ABC')]
, and we would have to default tocontains(substring(/books/book/title,1,3), 'ABC').
– macsimus_slackus Oct 19 '09 at 18:05