Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XML-heading causes IOException[Scanned]

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: François Beausoleil <fbos AT users.sourceforge.net>, MULS PATRICK <patrick.muls AT datassur.be>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] XML-heading causes IOException[Scanned]
  • Date: Thu, 21 Aug 2003 06:56:37 -0400

At 9:50 AM -0400 8/20/03, François Beausoleil wrote:
Hello Patrick,

The problem is that your document references a relative resource,
but the resource is not accessible. You have three ways in which
you can solve that:

1. Put the SchadeAttest.dtd file at the root of your classpath, or
in the same package where the Load4XML.java file is. I don't know
how the default EntityResolver works, but it might be able to
resolve the reference.

2. Use an absolute URL to the SchadeAttest.dtd file. Something
like file:///path/to/file/SchadeAttest.dtd. Or use the http
protocol, as appropriate.

3. Implement an EntityResolver and pass that to XOM. Implementors
of EntityResolver are responsible for resolving resources and
returning them to the caller. In you case, when the systemID
contains "SchadeAttest.dtd", you would build a URL to the file, and
return that.

These should all work. However, they shouldn't be necessary. I'm
still looking at this, but I think it might be classified as a bug in
XOM and/or the Windows JDK. Interestingly the code Mr. Muls supplied
does work on Linux. I have to move it all over to my Windows laptop
and test it there.
--

Elliotte Rusty Harold
elharo AT metalab.unc.edu
Processing XML with Java (Addison-Wesley, 2002)
http://www.cafeconleche.org/books/xmljava
http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA




Archive powered by MHonArc 2.6.24.

Top of Page