xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
Re: [XOM-interest] Problem with Xerces/XOMHandler.inInternalSubset reading from File but not FileReader or FileInputStream
- From: Elliotte Rusty Harold <elharo AT ibiblio.org>
- To: XOM API for Processing XML with Java <xom-interest AT lists.ibiblio.org>
- Subject: Re: [XOM-interest] Problem with Xerces/XOMHandler.inInternalSubset reading from File but not FileReader or FileInputStream
- Date: Mon, 14 Sep 2009 15:00:12 -0400
On Mon, Sep 14, 2009 at 2:37 PM, Peter Murray-Rust <pm286 AT cam.ac.uk> wrote:
The second thing that jumps out at me is that the first two of these
do not have a base URL. To XOM they appear to be pure streams:
> Document doc = new Builder().build(new FileReader("b511922g.xml"));
> System.out.println("worked with filereader");
>
> FileInputStream fis= new FileInputStream(new File("b511922g.xml"));
> doc = new Builder().build(fis);
> System.out.println("worked with FileInputStream");
>
> File f = new File("b511922g.xml");
> System.out.println(f.getAbsolutePath());
> doc = new Builder().build(new File("b511922g.xml"));
However from this 3rd one, XOM can call f.toURL() to derive a base URL
for the document. That may have something to do with why this one and
only this one fails.
Since you're using a relative path, that can be very tricky,
especially on Windows. By any chance are the runs that fail on a
different platform than the ones that suceed?
> I am surprised that changing from a FileReader to a File generated the
> error, and also that it appears to come from the Internal Subset. It is not
> easy to generate this error message on demand since it is not thrown on my
> machine. I suspect it is a Xerces problem that may be very difficult to
> track down. We assume we are working with the Xerces packaged in the JRE
> since we have stripped all jars from the classpath.
I'm not ready to blame Xerces yet. I'll need to look at XOM's own code
when I get home.
--
Elliotte Rusty Harold
elharo AT ibiblio.org
-
[XOM-interest] Problem with Xerces/XOMHandler.inInternalSubset reading from File but not FileReader or FileInputStream,
Peter Murray-Rust, 09/14/2009
- Re: [XOM-interest] Problem with Xerces/XOMHandler.inInternalSubset reading from File but not FileReader or FileInputStream, Elliotte Rusty Harold, 09/14/2009
-
Re: [XOM-interest] Problem with Xerces/XOMHandler.inInternalSubset reading from File but not FileReader or FileInputStream,
Elliotte Rusty Harold, 09/14/2009
- Re: [XOM-interest] Problem with Xerces/XOMHandler.inInternalSubset reading from File but not FileReader or FileInputStream, Peter Murray-Rust, 09/14/2009
-
Re: [XOM-interest] Problem with Xerces/XOMHandler.inInternalSubset reading from File but not FileReader or FileInputStream,
Elliotte Rusty Harold, 09/15/2009
-
Re: [XOM-interest] Problem with Xerces/XOMHandler.inInternalSubset reading from File but not FileReader or FileInputStream,
Elliotte Rusty Harold, 09/16/2009
-
Re: [XOM-interest] Problem with Xerces/XOMHandler.inInternalSubset reading from File but not FileReader or FileInputStream,
Peter Murray-Rust, 09/16/2009
-
Re: [XOM-interest] Problem with Xerces/XOMHandler.inInternalSubset reading from File but not FileReader or FileInputStream,
Elliotte Rusty Harold, 09/17/2009
- Re: [XOM-interest] Problem with Xerces/XOMHandler.inInternalSubset reading from File but not FileReader or FileInputStream, Peter Murray-Rust, 09/18/2009
-
Re: [XOM-interest] Problem with Xerces/XOMHandler.inInternalSubset reading from File but not FileReader or FileInputStream,
Elliotte Rusty Harold, 09/17/2009
-
Re: [XOM-interest] Problem with Xerces/XOMHandler.inInternalSubset reading from File but not FileReader or FileInputStream,
Peter Murray-Rust, 09/16/2009
-
Re: [XOM-interest] Problem with Xerces/XOMHandler.inInternalSubset reading from File but not FileReader or FileInputStream,
Elliotte Rusty Harold, 09/16/2009
- Re: [XOM-interest] Problem with Xerces/XOMHandler.inInternalSubset reading from File but not FileReader or FileInputStream, Elliotte Rusty Harold, 09/16/2009
-
Re: [XOM-interest] Problem with Xerces/XOMHandler.inInternalSubset reading from File but not FileReader or FileInputStream,
Elliotte Rusty Harold, 09/24/2009
- Re: [XOM-interest] Problem with Xerces/XOMHandler.inInternalSubset reading from File but not FileReader or FileInputStream, Dave Pawson, 09/24/2009
- Re: [XOM-interest] Problem with Xerces/XOMHandler.inInternalSubset reading from File but not FileReader or FileInputStream, Peter Murray-Rust, 09/24/2009
Archive powered by MHonArc 2.6.24.