xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
Re: [XOM-interest] XML-heading causes IOException[Scanned]
- From: François Beausoleil <fbos AT users.sourceforge.net>
- To: MULS PATRICK <patrick.muls AT datassur.be>
- Cc: Elliotte Rusty Harold <elharo AT metalab.unc.edu>, xom-interest AT lists.ibiblio.org
- Subject: Re: [XOM-interest] XML-heading causes IOException[Scanned]
- Date: Wed, 20 Aug 2003 09:50:05 -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 you case, when the systemID contains "SchadeAttest.dtd", you would build a URL to the file, and return that.
Hope that helps !
François
MULS PATRICK wrote:
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/
------------------------------------------------------------------------
--------------------Configuration: SchadeAttest - JDK version 1.3.1 <Default> -
<Default>--------------------
Command : "C:\jdk1.3.1\bin\java.exe" -classpath
"D:\SchadeAttest\classes\;C:\oracle\ora81\jdbc\lib\classes12.zip;C:\DTS\Batch\classes;D:\XML\XOM\xom-1.0d12.jar;D:\XML\XOM\lib\xercesImpl.jar;D:\XML\XOM\lib\xmlParserAPIs.jar;C:\jdk1.3.1\jre\lib\rt.jar;C:\jdk1.3.1\jre\lib\i18n.jar;C:\jdk1.3.1\lib\dt.jar;C:\jdk1.3.1\lib\tools.jar;C:\jdk1.3.1\jre\lib\ext\cryptix32.jar;C:\jdk1.3.1\jre\lib\ext\OpenBaseJDBC.jar"
be.datassur.schadeattest.Load4XML
Directory : D:\SchadeAttest\classes
Starting Load4XML...
Load4XML filedialog starts
Load4XML file chosen: D:\SchadeAttest\SchadeAttest.xml
lezenXML start
builder
lezenXML() IOException file : D:\SchadeAttest\SchadeAttest.xml
java.net.UnknownHostException: file
at java.net.InetAddress.getAllByName0(InetAddress.java:571)
at java.net.InetAddress.getAllByName0(InetAddress.java:540)
at java.net.InetAddress.getByName(InetAddress.java:449)
at java.net.Socket.<init>(Socket.java:100)
at sun.net.NetworkClient.doConnect(NetworkClient.java:50)
at sun.net.NetworkClient.openServer(NetworkClient.java:38)
at sun.net.ftp.FtpClient.openServer(FtpClient.java:267)
at sun.net.ftp.FtpClient.<init>(FtpClient.java:381)
at
sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:77)
at
sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:96)
at java.net.URL.openStream(URL.java:798)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown
Source)
at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown
Source)
at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at nu.xom.Builder.build(Builder.java:553)
at nu.xom.Builder.build(Builder.java:404)
at nu.xom.Builder.build(Builder.java:441)
at be.datassur.schadeattest.Load4XML.lezenXML(Load4XML.java:151)
at be.datassur.schadeattest.Load4XML.verwerken(Load4XML.java:119)
at be.datassur.schadeattest.Load4XML.starten(Load4XML.java:112)
at be.datassur.schadeattest.Load4XML.access$300(Load4XML.java:22)
at
be.datassur.schadeattest.Load4XML$3.actionPerformed(Load4XML.java:78)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1504)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:378)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:216)
at java.awt.Component.processMouseEvent(Component.java:3715)
at java.awt.Component.processEvent(Component.java:3544)
at java.awt.Container.processEvent(Container.java:1164)
at java.awt.Component.dispatchEventImpl(Component.java:2593)
at java.awt.Container.dispatchEventImpl(Container.java:1213)
at java.awt.Component.dispatchEvent(Component.java:2497)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2451)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2216)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125)
at java.awt.Container.dispatchEventImpl(Container.java:1200)
at java.awt.Window.dispatchEventImpl(Window.java:914)
at java.awt.Component.dispatchEvent(Component.java:2497)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
lezenXML einde
Process completed.
------------------------------------------------------------------------
<?xml version="1.0" standalone="no"?>
<!DOCTYPE Attesten SYSTEM "SchadeAttest.dtd">
<!-- Dit document beschrijft het schadeverleden van een persoon bij een
maatschappij -->
<Attesten xmlns="http://www.datassur.com/">
<Attest>
<Definitief>Voorlopige of definitieve versie attest <!-- XXX (C50:
voorlopig, C51: definitief) --></Definitief>
<PolisNr>Polisnummer<!-- X(25) --></PolisNr>
<PlaatNr>Plaatnummer<!-- X(06) --></PlaatNr>
<VervalDt>Jaarlijkse vervaldatum polis <!-- DDMM
--></VervalDt>
<InwerkingDt>Datum inwerkingtreding BA-waarborg polis <!-- DDMMYYYY
--></InwerkingDt>
<EindDt>Einddatum polis <!-- DDMMYYYY --></EindDt>
<VoertuigCategorie>Voertuig categorie <!-- X(2) -->
</VoertuigCategorie>
<Gebruik>Voertuig gebruik <!-- 9 (1: privé, 2: beroep, 3: gemengd)
--></Gebruik>
<VerzekerdeNAW>
<VerzekerdeNaam>Naam verzekerde <!-- X(30)
--></VerzekerdeNaam>
<VerzekerdeVoornaam>Voornaam verzekerde <!-- X(30)
--></VerzekerdeVoornaam>
<VerzekerdeStraat>Straat, nr verzekerde <!-- X(30)
--></VerzekerdeStraat>
<VerzekerdeZIP>Postcode verzekerde <!-- X(10)?
--></VerzekerdeZIP>
<VerzekerdeLoc>Localiteit verzekerde <!-- X(30)
--></VerzekerdeLoc>
<VerzekerdeLand>ISO Landcode verzekerde <!-- X(2)
--></VerzekerdeLand>
</VerzekerdeNAW>
<Graad>Graad van personalisatie a postiori <!-- X(3)?
--></Graad>
<Cie>
<CieCDV>CDVnummer van de maatschappij die het attest
uitgeeft<!-- 99999-99 --></CieCDV>
<CieNaam>Naam van de verzekeringsonderneming <!-- X(30)
--></CieNaam>
</Cie>
<AttestDt>Datum attest uitgereikt <!-- DDMMYYYY --></AttestDt>
<Handtekening>Naam van de ondertekenaar <!-- X(15)
--></Handtekening>
<Schadegevallen><!-- lijst alle schadegevallen voorgevallen in
de laatste 5 jaar binnen het aangeduide contract (zowel in fout als in recht) -->
<Schadegeval>
<SchadeDt>Datum schadegeval <!-- DDMMYYYY
--></SchadeDt>
<SchadeCat>Categorie schade (facultatief) <!-- X(10)?
--></SchadeCat>
<Bestuurder>
<BestuurderNaam>Naam bestuurder <!-- X(30)
--></BestuurderNaam>
<BestuurderVoornaam>Voornaam bestuurder <!--
X(30) --></BestuurderVoornaam>
<BestuurderGebDt>Geboortedatum bestuurder <!--
DDMMYYYY --></BestuurderGebDt>
</Bestuurder>
<BedragArt29b curr="EUR">Op grond van artikel 29bis
betaalde bedragen <!-- 999.999.999,99 --></BedragArt29b>
<BedragVerg curr="EUR">Werkelijk betaalde bedragen
vergoedingen (incl art29bis) <!-- 999.999.999,99 --></BedragVerg>
<Afgesloten>Dossier afgesloten <!-- 9 (1: ja, 2: nee)
--></Afgesloten>
<Aansprakelijk>Aansprakelijkheid bestuurder <!-- 9 (1:
aangetoond, 2: verdeeld, 3: niet aangetoond, 4: nog niet bepaald) --></Aansprakelijk>
<Beschouwd>Schadegeval reeds in aanmerking genomen voor bepaling
"personalisatiegraad a posteriori" <!-- 9 (1: ja, 2: nee) --></Beschouwd>
</Schadegeval>
</Schadegevallen>
</Attest>
</Attesten>
-
RE: [XOM-interest] XML-heading causes IOException[Scanned],
MULS PATRICK, 08/20/2003
- RE: [XOM-interest] XML-heading causes IOException[Scanned], Elliotte Rusty Harold, 08/20/2003
- RE: [XOM-interest] XML-heading causes IOException[Scanned], Francois Beausoleil, 08/20/2003
-
Re: [XOM-interest] XML-heading causes IOException[Scanned],
François Beausoleil, 08/20/2003
-
Re: [XOM-interest] XML-heading causes IOException[Scanned],
Elliotte Rusty Harold, 08/21/2003
-
Re: [XOM-interest] XML-heading causes IOException[Scanned],
Elliotte Rusty Harold, 08/23/2003
- [XOM-interest] XOM 1.0d20 Cleaning Windows, Elliotte Rusty Harold, 08/24/2003
- Re: [XOM-interest] XML-heading causes IOException[Scanned], Elliotte Rusty Harold, 08/25/2003
-
Re: [XOM-interest] XML-heading causes IOException[Scanned],
Elliotte Rusty Harold, 08/23/2003
-
Re: [XOM-interest] XML-heading causes IOException[Scanned],
Elliotte Rusty Harold, 08/21/2003
- <Possible follow-up(s)>
- RE: [XOM-interest] XML-heading causes IOException[Scanned], MULS PATRICK, 08/20/2003
Archive powered by MHonArc 2.6.24.