Lists Home |
Date Index |
> as everything is a node, one can match a node like this :
I assume we're talking about XPath path expressions here, not XSLT match
patterns: so it might be better to use the verb "select" rather than
Yes, node() is short for child::node(), it selects any node on the child
> which works well in the axis that are walking through the tree
> what about other axis ?
> which would give the same as (respectively) :
> and above all what about :
> which are all empty if they are legal
> but are they legal ?
Yes, they are legal in XPath 1.0. They all select an empty set of nodes. In
XPath 2.0, with static typing, they have a static type of empty-sequence(),
which is a type error that can be reported at compile time if the processor
chooses to do static type checking.
> here are the last ones :
Again these are legal, and select nothing. The same applies to, for example,
> Will you be hurted if someone (like me) was writting
> something like this :
If your data conforms to the XPath data model, then this will select
nothing. If you want to design a language similar to XPath that works on a
different data model, for example one in which attributes can have
attributes, then you are free to do so (but please don't call it XPath).