Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XInclusion produdes invalid document

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: Andrew Thompson <lordpixel AT mac.com>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] XInclusion produdes invalid document
  • Date: Sun, 06 Mar 2005 18:25:25 -0500

Andrew Thompson wrote:

I'll add this to the TODO list. I may or may not get to this in 1.1.

A tentative fix is now in CVS. Surprisingly little broke when I added it. I am not yet convinced there aren't as yet undiscovered bugs, especially since I don't actually parse the URL to try and deduce an appropriate relative URL; just use string manipulation.

Hey, thanks! Not sure what you mean though. It's non-conformant but you're going to make it an option anyway?
Or do you mean you'll detect this case and just strip it down to xml:base="fragment.xml"?


The latter. xml:base="fragment.xml" conforms to the spec. No xml:base attribute does not.

I guess that more or less solves my problem.
Actually, what would this mean if I didn't deploy fragment.xml to the web server?
If an element has xml:base="fragment.xml" what does it imply for relative URIs inside that element if "fragment.xml" does not exist in the deployment filesystem?

Not much. They'd still be resolvable against the parent directory.

Conceptually to me it's much more useful for relative URIs to end up relative to the final resolved document that to mess around with xml:base trying to make them relative to the original document fragment, which may not even exist! What I mean is, if I merge index.xml and fragment.xml into index.html, then upload only index.html to my webserver, then why would I want URIs relative to fragment.xml or index.xml? To me merging these documents conceptually makes the relative URIs relative to the resulting document.

Au contraire. They really do need to be relative to the original document. For instance, let's suppose I have this element:

<xi:include href="http://www.cafeaulait.org/"; />

That document includes a lot of relative URLs that point at other documents on http://www.cafeaulait.org/. Including it on http://www.example.org/ where those documents do not exist should not break the links. The goal is that a relative URL not change what it points to just because an element is included.


--
Elliotte Rusty Harold elharo AT metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim




Archive powered by MHonArc 2.6.24.

Top of Page