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

Re: XPointer crisis


Re:  XPointer crisis
At 02:41 PM 2/1/2002 -0500, Daniel Veillard wrote:

>Let's have a look of the alternatives in XML:
>
>   #foo
>
>Hard to rely on it with XML, well last time I suggested on this forum xml:id
>I got a lot of flack back, I won't try again.

I don't think I was in on that debate. At first blush, xml:id seems like 
just what the doctor ordered - why did people object? It meets the 
following useful criteria:

1. It works with or without DTDs or Schemas.
2. References remain stable in the face of changes to the document.
3. It is very simple.

Of course, people may have additional schemes by which they wish to address 
into documents, but would these need to own the fragment identifier?

>   So either you accept to force validation of document (and hence
>possibly have to fetch and trust remote DTD in your framework) or you
>need other pointing schemes.
>
>   #/root/foo[1]/bar[2]
>
>   Just doesn't work as is because it doesn't allow for namespace support
>and hence out of scope (or you put schemes in to allow binding namespace
>prefixes to URI, possible but I don't remember anybody suggesting it).

I think that XPointer already has a way of declaring namespaces:

#xmlns(x=http://example.com/foo) xpointer(/x:root/x:foo[1]/x:bar[2])

>   #1/2/3
>
>breaks as soon as an ancestor or any predecessor of those is modified
>would work for really static content, but the maintainance cost looks ...
>interesting

Ah, but that's what you get for trying to create stable references into 
documents that change. If you want to guarantee that you can actually do 
that, you need identifiers in the referenced document, and these 
identifiers serve as a contract on behalf of the referenced document which 
has agreed to provide these addresses.

If you don't have that guarantee from the referenced document, then there 
is no way to ever guarantee references will not break. XPointer has worked 
really hard to get as close as possible to being robust in the face of 
change, but it can still fall on its face when a document changes.

>   If you think that
>      #foo
>is simple and fast, yes in a very well defined context, in general it's
>an horrible solution, you have to rely on something outside the document
>itself to simply make that request. //*[@id=foo] at least can work directly
>on the document.

I'm not sure what semantics you intend for the above syntax. Suppose the 
meaning of #foo is identical to the following XPath expression:

         //*[@xml:id="foo"]

That seems cheap and effective. At any rate, I have not studied this 
particular problem extensively, but at first blush, any one of the three 
solutions you consider unworkable seems reasonable. The middle one seems 
more complex, because it requires namespace processing, so I would be 
inclined to rule this out of the minimum conformance level for whatever 
language owns the fragment identifier.

Let me be clear though, I think that full-fledged hypertext along the lines 
of the original XPointer vision is a good thing, and I am not at all saying 
it should not exist. I am, however, saying I do not believe it should own 
the fragment identifier for XML. That should be reserved for a very simple 
and efficient kind of pointer.

Jonathan



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.