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 17:28:38 -0500

Andrew Thompson wrote:


Actually, I think you can detect my case. Here's what I'm thinking...

You know the base URI of the document doing the including. eg, let's say it is currently:
file:///foo/bar/baz/index.xml
When you see xi:include, you get the relative URL of the fragment:
<xi:include href="fragment.xml">
Thus the absolute URI of the fragment is:
file:///foo/bar/baz/fragment.xml

Well, then you can detect that these are the same except for the last component: ie, they're both at "file:///foo/bar/baz/" and in this case it would be OK to skip emitting the xml:base attribute.

That would be nonconformant to the XInclude spec. At a minimum XOM has to write out xml:base="fragment.xml", except in a few rare cases where it's including a piece of a document into itself, or xml:base attributes in the included document make it look that way.


If on the other hand I write:

<xi:include href="someOtherDir/SomeOtherFragment.xml">

Then the 2 URIs don't match up to their last component ("file:///foo/bar/baz/" != "file:///foo/bar/baz/someOtherDir") and you need to add an xml:base to the included fragment. I think that would work recursively for documents included in the fragment too?

What do you think?

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


--
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