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: "Francois Beausoleil" <fbos AT users.sourceforge.net>
  • To: "MULS PATRICK" <patrick.muls AT datassur.be>, "Elliotte Rusty Harold" <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: RE: [XOM-interest] XML-heading causes IOException[Scanned]
  • Date: Wed, 20 Aug 2003 09:51:31 -0400

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 your case, when the systemID contains
"SchadeAttest.dtd", you would build a URL to the file, and return that.

Hope that helps !
François


On Wed, 20 Aug 2003 08:31:51 +0200, "MULS PATRICK"
<patrick.muls AT datassur.be> said:
> Hello Eliotte and Francois,
>
> Here is the stack-trace and for Francois also the source and xml-file
> used.
> The problem is indeed that the DTD is not found when not completely
> specified.
> The package dbaccess is not yet necessary, as I'm not yet accessing my
> db, so you can leave it out.
>
> Thanks for your assistance,
>
> Patrick Muls
> Datassur ESV
> 00 32 2 547 58 59
>
>
> -----Original Message-----
> From: Francois Beausoleil [mailto:fbos AT users.sourceforge.net]
> Sent: 19 August 2003 20:29
> To: Elliotte Rusty Harold; MULS PATRICK
> Cc: xom-interest AT lists.ibiblio.org
> Subject: Re: [XOM-interest] XML-heading causes IOException[Scanned]
>
> I agree with Eliotte that without seeing the document it is hard to guess
> what's wrong. But I would think that an IOException is possible, if the
> DOCTYPE refers to a DTD that is unavailable somehow.
>
> Hope that helps,
> François
>
> On Tue, 19 Aug 2003 06:52:53 -0400, "Elliotte Rusty Harold"
> <elharo AT metalab.unc.edu> said:
> > >Hello,
> > >
> > >I'm trying out XOM for an upcoming project. I created an XML-file
> > >containing <?xml version ...> and <!DOCTYPE ...> tags and a comment-tag.
> > >When I try to build the document in my application using:
> > > Builder builder = new Builder();
> > > Document doc = builder.build(flXml);
> > >I get an IOException on the file. Removing those 3 tags from the file
> > >solves this problem. But will they not always be present in an XML-file?
> > >And having to remove them first seems a timewaisting operation. Any
> > >suggestions?
> > >
> >
> > You have not provided enough information to diagnose the problem.
> > Seeing the actual XML document and code would be required to tell
> > what's going on here. probably your document is malformed and you're
> > getting an XMLException, not an IOException, but that's just a guess
> > without seeing the code.
> > --
> >
> > 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
> > _______________________________________________
> > XOM-interest mailing list
> > XOM-interest AT lists.ibiblio.org
> > http://lists.ibiblio.org/mailman/listinfo/xom-interest
> Developer of Java Gui Builder
> http://jgb.sourceforge.net/
Developer of Java Gui Builder
http://jgb.sourceforge.net/




Archive powered by MHonArc 2.6.24.

Top of Page