Re: What's implementable in XPath expressions?

Howard Katz wrote:
> 
> I've just been having some conceptual difficulty grokking the
> marriage of an angle-bracket representation of XML with XPath
> relative location syntax. Unaccustomed to the mixed notation, I've been
> finding the idea of "/<aRoot></aRoot>/someRelPath" difficult to grasp.

Ah, well, *that* example is another matter. According to the Appendix B
grammar, the only thing that can come after a '/' is a Step, which is fairly
restricted and does not include ElementConstructor. So 
    /<aRoot></aRoot>
in your example is syntactically invalid. However, an ElementContructor can
occur *before* the first '/' of a PathExpr, so
    <aRoot></aRoot>/someRelPath
is syntactically okay. (Although because the constructed aRoot element has
neither children, attributes, or parent, there's not much you could
substitute for "someRelPath" that would actually yield anything. Perhaps
just dot.)

> Once I translate that into "/aRoot/someRelPath," I'm fine.

Nope, not the same thing. Or rather, if we transpose to the land of
syntactically valid expressions,
    <aRoot></aRoot>/someRelPath
is not equivalent to
    aRoot/someRelPath

-Michael

Received on Friday, 27 April 2001 03:15:48 UTC