Further comment on XPointer 1.0 CR

16. I didn't see anything in the XPointer spec that says the XPath
expression has to evaluate to a node-set. Since 2+2 is a valid XPath
expression, it seems that XPointer(2+2) is a syntactically valid XPointer,
though presumably it will always fail as "a scheme that does not locate any
subresource present in the resource". However, the rule that the expression
must return a node-set could be stated more explicitly; and in particular,
the syntax of an XPointer could refer to an XPath UnionExpr rather than an
XPath Expr, since an Expr that is not a UnionExpr will never return a
node-set. 

In fact the rules could be more restrictive than this. As a precedent, the
XSLT syntax for Patterns describes a subset of XPath syntax that will always
return a node-set. This subset is probably more restrictive than the subset
that would be appropriate for XPointer, for example because it only allows
use of the child and attribute axes, but the same idea could be applied.

Michael Kay

Received on Friday, 9 June 2000 06:09:06 UTC