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

RE: XPointer crisis


RE:  XPointer crisis
Joe English wrote:
> Or it could use the target document's namespace context.
> That is, the QNames in the XPointer must be lexically identical
> to the QNames in the target document.

In the XPath 1.0 data model, these two aren't the same thing. Specifically,
the actual prefix used in an element name is not preserved, which is to say
it can't be determined when more than one prefix is available in the
namespace context.

For example, given the following context node:

<a:foo xmlns:a="http://example.com" xmlns:b="http://example.com"/>

The XPath name() function may return either "a:foo" or "b:foo". The actual
QName "may" be preserved but is not a part of the data model, so this isn't
possible in general. For XPointer to match QNames, it would have to change
not only the semantics of path expressions but the underlying data model as
well (specifically, exposing the element or attribute's [prefix] property).

That said, you could still use the document's namespace context as you said
originally without changing the data model. That means that either "/a:foo"
or "/b:foo" would work in this case. But writing applications that depend on
an unknown source document to use certain prefixes is probably not a good
thing, especially if that document uses multiple namespaces. XPath 1.0 could
have worked this way, because the data model provides the necessary
information. While the in-scope namespace declarations are significant in
the data model, the language is not biased toward treating them as
significant. Name tests always test for expanded-names, not QNames. The
name() function is the only place where prefixes are exposed apart from the
namespace nodes themselves.

Evan


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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.