[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
RE: [xml-dev] the Canonical path of a node
- From: "Michael Kay" <mike@saxonica.com>
- To: "'Philippe Poulard'" <Philippe.Poulard@sophia.inria.fr>,"'David Carlisle'" <davidc@nag.co.uk>
- Date: Mon, 8 Jan 2007 13:08:17 -0000
> http://lists.xml.org/archives/xml-dev/200403/msg00045.html
> I retained "*the canonical path*" for the name of such a
> path, and the predicates must be present for child nodes even
> if it is [1] : being also an XPath pattern, they are easier
> to apply to a SAX stream :)
Of course different users have different requirements. One disadvantage of
this "canonical path" is that it depends on the bindings of namespace
prefixes. It's a shame that XPath doesn't define a mechanism for binding
prefixes within the expression itself. I think it would be a good idea if we
could establish a conventional notation for an "augmented XPath expression":
a string containing a set of namespace bindings and an XPath expression, and
we could then encourage people to implement APIs that accept an "augmented
XPath expression". One candidate is the XPointer syntax:
xmlns(p1=http://p1.uri/) xmlns(p2=http://p2.uri/) xmlns(p=http://p.uri)
xpath2(/p1:a[1]/p2:b[1]/p:c[1])
This has a few drawbacks like not allowing the default namespace to be
declared, and requiring ")" and "^" to be escaped as "^)" and "^^"; but at
least it's defined in an existing standard.
>
> but I'm not sure if the mappings are fixed as well by Saxon
> (perhaps M.
> Kay could confirm ?) ; they are in RefleX
>
saxon:path uses the prefixes as they appear in the original source. This
means that the path is useful for diagnostics and documentation, but it's
not ideal for use cases where you want to use the path to re-select the
node.
Michael Kay
http://www.saxonica.com/
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]