
July 30th, 2003, 03:08 PM
|
|
Junior Member
|
|
Join Date: Jul 2003
Posts: 14
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
ignoring DOCTYPE from xml String
I am trying to ignore the DOCTYPE declaration in the input xmlstring and parse it using a DTD from fixed location .
For ex: Instead of using <xml version='1.0'><DOCTYPE INPUT SYSTEM "file//localhost/../../../ex.dtd">
I want to use <xml version='1.0'><DOCTYPE INPUT SYSTEM "ex.dtd"> and make the parser get the dtd from a fixed location.
How can i do it..?I know theres a work around for this by playing with Strings .I want to know if theres a any way we can configure this in the parser itself . Portion of the code is as below ..
java.io.InputStream input=null;
input=new java.io.ByteArrayInputStream(xmlString.getBytes());
out = new OutputStreamWriter (System.out, "UTF8");
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setValidating(true);
factory.newSAXParser().parse( input, new xmlHandler());
Thx in advance ...
prabhu
|