[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Proposed syntax for namespace binding in XPath

Subject: Re: Proposed syntax for namespace binding in XPath
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Mon, 2 Apr 2007 11:05:24 +0100
Re:  Proposed syntax for namespace binding in XPath
On 4/2/07, Michael Kay <mike@xxxxxxxxxxxx> wrote:
> > Is it possible to just match on prefix, regardless of binding?  eg,
> >
> > "foo:bar"
> >
> > ...will match any bar node prefixed with foo - the calling
> app doesn't
> > care what "foo" is bound to in the XML, as long that's the prefix.
> >
> > If that's possible, that would be a really useful option.
>
> Useful maybe, but that one would definitely be a
> non-conformance with the spec....

What you can already do of course in some APIs (including
saxon:evaluate-node()) is to take the namespace bindings for the XPath
expression from the in-scope namespaces of a given element node. That has
almost the same effect as matching on prefix, except when the source
document maps multiple prefixes to the same namespace (or the same prefix to
multiple namespaces). It's also open to abuse, but it works well in a
situation where the XPath expression is actually held within the document to
be searched.

I started replying to your previous post, but this one highlights it perfectly - given an xml document that you are applying xpaths to, why do you need to enforce the expanded qname - you effectively already have the mappings defined in the source XML - its down to user to ensure they apply the correct xpath to the correct XML - how likely is it to ever give the wrong results?

Where's that rope....

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.