javaxmlsharepointxom

Anyway to get XOM to allow non-absolute namespaces?


I have some XML which is from a Microsoft sharepoint site. The opening lines are:

<xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
 xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
 xmlns:rs='urn:schemas-microsoft-com:rowset'
 xmlns:z='#RowsetSchema'>

When I try to use XOM to open this .xml file to extract the information I want, it complains with:

 nu.xom.ParsingException: Missing scheme in absolute URI reference

I assume this is referring to #RowsetSchema namespace binding, which seems to cause problems. I've tried adding

  xmlreader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
  xmlreader.setFeature("http://apache.org/xml/features/validation/schema", false);

to the XMLReader I pass to the XOM Builder, but it hasn't helped.

Is there a way to get XOM to just load the XML and let me extract the data I want, or do I have to write my own XML parser??

Thanks :)


Solution

  • I have found xom-lite, which is an Apache2 licensed Java library which seems to replicate the basic XML handling tasks of XOM without the validation overhead. This seems to solve the issue!

    If you know a way to solve the issue in XOM itself, then still answer and I'll accept.