[Home] [By Thread] [By Date] [Recent Entries]

  • From: Jonathan Borden <jborden@m...>
  • To: Tom Bradford <bradford@d...>
  • Date: Sun, 05 Aug 2001 17:00:49 -0400

Tom Bradford wrote:

>
> I truly appreciate your snide criticism.

:-)) i honestly wasn't intending to be snide, rather to point out that XPath
has been a done deal for some time now, and that it is what it is. Along the
lines of "be strict in what you provide, and liberal in what you accept" I
think we should strongly promote best practices for document design, yet
expect that parsers dbs etc., will liberally accept data that conforms to
the spec.

>
> The reason it wasn't there is because in order to support namespaces,
> most XPath implementations require a context node for prefix
> resolution.  The context node is usually an element in the document that
> is being queried, and it's usually an element that has been sufficiently
> drilled down to so that the prefix you use in the XPath actually matches
> the namespace you're looking for.

Right, this is a real issue.

A reasonable solution is what XPointer has come up with namely:

"xmlns(prefix=http://example.com/namespace) xpointer(//prefix:example)"

not that it is pretty, but does the job. i'd prefer if xpointer had provided
for an xpath(//this:is/an:xpath) syntax, but that's another story.

Another solution would be for the API to accept a namespace context map ...


-Jonathan


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member