Re: What's implementable in XPath expressions?

Howard Katz wrote:
> 
> What's actually implementable at the head of an XPath expression? I'm trying
> to figure out what's allowed by the following snippet from the JavaCup
> grammar:
> ...
> Certainly $VarName/somePath and DOT/somePath are going to be commonly seen,
> but what about the others? What's the meaning of
> [ElementConstructor]/somePath, for example? Or even [Literal]/somePath? How
> should I interpret these constructs?

<http://www.w3.org/TR/xpath#node-sets>, the corresponding point in the XPath
spec, says

    The / and // operators compose an expression and a relative
    location path. It is an error if the expression does not
    evaluate to a node-set.

If XQuery has similar semantics, I think [ElementConstructor]/somePath could
be valid (if perhaps pointless), e.g.
    <foo><bar/></foo> / bar
but [Literal]/somePath would never be valid.

-Michael Dyck

Received on Thursday, 26 April 2001 02:23:57 UTC