Skip to Content.
Sympa Menu

xom-interest - [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: Andrew Thompson <lordpixel AT mac.com>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] XInclusion produdes invalid document
  • Date: Sun, 6 Mar 2005 15:30:26 -0500

Hi again,

I'm starting to get a little disillusioned with this XInclude stuff.
This next question may well have nothing to do with XOM, so please feel free to tell me to shut up, but, once I resolve the includes in a document, the top level elements in the included document look like this:

<!--sidebar is secondary information, so if the user's browser can't see the stylesheets
this should render second, after the body content--><div xmlns="" class="bluebackground column1" title="Navigation Sidebar" xml:base="file:///path/on/my/local/harddisk/website%20bits/ sidebar.xml">

* cosmetically, we've lost the newlines after the comment

* the div has picked up an xmlns="" which makes it fail w3 validation. This is a Xerces bug, I think... because I've seen it when using XSLT before

* The killer is this xml:base="file:///path/on/my/local/harddisk/website%20bits/sidebar.xml"

EHR, I notice you didn't mention this in your article @ http://cafe.elharo.com/xml/xinclude/ but from a quick read of the XInclude spec this seems to be expected (XInclude spec, section 4.5.5).

This is horrible from a workflow perspective though... Quite apart from it also failing w3 validation, I want to resolve XIncludes on my local system before uploading these files to my web server. So I really don't want references to my local filesystem littered all over these documents. Even if today's tools ignore xml:base, I don't want my local disk names published!

I don't see why this is being included anyway - the including file and the included file are both in the same directory, so why is it adding base attributes?

In an attempt to bring thing back on topic, is there anything I can do in XOM to try to suppress this stuff? (the base and the xmlns?). Is there a better XML parser to use for this than the Xerces that's bundled with JDK 1.4.2?


AndyT (lordpixel - the cat who walks through walls)
A little bigger on the inside

(see you later space cowboy ...)





Archive powered by MHonArc 2.6.24.

Top of Page