Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] mysterious error when parsing OpenOffice document

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • To: Brian Slesinsky <brian AT slesinsky.org>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] mysterious error when parsing OpenOffice document
  • Date: Tue, 14 Dec 2004 16:05:57 -0500

At 8:00 PM -0800 12/6/04, Brian Slesinsky wrote:
Hi, has anyone had any success parsing OpenOffice documents with XOM? I get a mysterious error:

nu.xom.ParsingException: Reference to undefined parameter entry "%{0};". at line 548, column -1.

I have not been able to reproduce the problem. However, now that I look at your code again I may see the problem.

private Document readOfficeDocument(File file)
throws IOException, ParsingException {

ZipFile zip = new ZipFile(file);
InputStream in = zip.getInputStream(zip.getEntry("content.xml"));
Builder builder = new Builder();
URL dtdDir = new File("/usr/lib/openoffice/share/dtd/officedocument/1_0").toURL();
return builder.build(in, dtdDir.toExternalForm());
}


I think there may be something going on with the URL you're using to load the DTD. Try "/usr/lib/openoffice/share/dtd/officedocument/1_0/" instead (note the trailing slash; and, if that doesn't work, try "/usr/lib/openoffice/share/dtd/officedocument/1_0/content.xml".

--

Elliotte Rusty Harold
elharo AT metalab.unc.edu
Effective XML (Addison-Wesley, 2003)
http://www.cafeconleche.org/books/effectivexml
http://www.amazon.com/exec/obidos/ISBN=0321150406/ref=nosim/cafeaulaitA




Archive powered by MHonArc 2.6.24.

Top of Page