You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by jason harrop <jh...@bigpond.net.au> on 2000/03/02 00:29:33 UTC
SAX entity resolution in servlets
Hi
In an application, I can use Xerces to do something like:
xmlFile = "file:///home/harry/fastcar/Jaguar.xml"
DOMParser parser = new DOMParser();
parser.parse(xmlFile);
But in a servlet, I can't.. Instead of file i have to stick it where
apache can see it and use http, thus:
xmlFile = "http://127.0.0.1/xml/jaguar.xml
:
Similarly, the path to the DTD must be specified with http, not file.
Can anyone explain why please? i've attached the exception below
i'm running JServ 1.1 and xerces 1.0.2 under Linux
cheers,
jason harrop
=============
org.xml.sax.SAXParseException: File
"file:///home/harry/fastcar/Jaguar.xml" not found.
at org.apache.xerces.framework.XMLParser.reportError(Compiled
Code)
at
org.apache.xerces.framework.XMLParser.startReadingFromDocument(Compiled
Code)
at org.apache.xerces.framework.XMLParser.parseSomeSetup(Compiled
Code)
at org.apache.xerces.framework.XMLParser.parse(Compiled Code)
at org.apache.xerces.framework.XMLParser.parse(Compiled Code)
at ParseXMLServlet.doGet(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at org.apache.jserv.JServConnection.processRequest(Compiled
Code)
at org.apache.jserv.JServConnection.run(Compiled Code)
at java.lang.Thread.run(Compiled Code)