Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] XIncluder entity resolution

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Paul Duffin <pduffin AT volantis.com>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] XIncluder entity resolution
  • Date: Mon, 18 Aug 2008 15:32:39 +0100

XOM is very cool, and having a Document that guarantees correctness is
very nice, as I find errors when creating documents, not when parsing
them later.

I found XOM while searching for an xinclude processor. I tried Xerces
but while that says it does support it it doesn't seem to work properly.
I am using the XIncluder class and while it works well when it can find
the included documents it does not have any way to resolve a URI to a
source, in a similar way to how the SAX EntityResolver and TraX
URIResolver can.

Basically, I have a number of documents that include boilerplate and
common fragments. These fragments are stored in an Ivy / Maven
repository and extracted automatically as part of the build. At the
moment the xi:include href attribute has to point directly to the
fragments and that makes the document dependent on the build and
repository structure. What I would like to do is use some well known
pseudo URLs, e.g. template:/copyright.xml and have the build use an
XMLCatalog to map that to the actual artifact extracted from ivy.

I have had a look at the XIncluder source and can see that there is no
way to do that, as it constructs and accesses the URL directly. So the
questions I have are:
1) Is this something that other people would find useful ?
2) Is this something you (ERH) would like to see in the XIncluder ?
3) If so how do you think it should be done ?

If yes then I may be able to do this work in a nice clean way, if no
then I will probably just hack it in for my own use.






Archive powered by MHonArc 2.6.24.

Top of Page