RE: Inability of location steps to support multiple axes

> -----Original Message-----
> From: Emerson [mailto:emerson@harvestman.net] 
> Sent: 10 September 2003 12:52
> To: public-qt-comments@w3.org; Michael.Kay@softwareag.com
> Subject: RE: Inability of location steps to support multiple axes
> 
> 
> 
> Michael, could you point me to the grammar where this is 
> allowable in Xpath 2.0
> 
> I can see no such derivation:
> http://www.w3.org/TR/xpath20/#doc-StepExpr


A StepExpr can be a FilterStep, a FilterStep can be a PrimaryExpr, and a
PrimaryExpr can be a ParenthesizedExpr, which can have anything inside it.

In effect, you can now use any expression (subject to operator precedence
rules) as an operand of "/", though the type rules require the expression to
deliver node()*.

Michael Kay





>> So the above example would become:
>> 
>> "parent::a/(following-sibling::* | preceding-sibling::*)//text()"
>> 
>> Which in my opinion is logically much more concise...
>> 
>> It could be that I am missing something, but I believe your
>> proposal is possible in XPath 2.0. 
>
>Correct, this expression is valid in XPath 2.0.
>Michael Kay

Received on Wednesday, 10 September 2003 10:11:45 UTC