Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
saxparser ignore <!doctype> line
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="SnooPac, post: 595947"] Hi. I'm trying to use SAXParser simply to extract some attribute values from an XML file. No validations or anything. So I have it all set up and working....mostly. The problem is that the XML file (which can't be changed) has the line at the start that says: <!DOCTYPE BlaCfg SYSTEM "../../../path/to/dtd/file/BlaCfg.dtd"> And this dtd cannot be found. There are some workarounds I can do (like regenerating this XML file temporarily without this line, or making a dummy dtd file, or...?), but I'd rather just have my SAXParser ignore this line entirely. Is there any property I can set to do this? Here is some of my code, by the way...I think its very standard: DefaultHandler handler = new MyTempXmlParser(); SAXParserFactory factory = SAXParserFactory.newInstance(); // Parse the input SAXParser saxParser = factory.newSAXParser(); saxParser.parse( new File("path/to/xml/file/file.xml"), handler); I was hoping maybe for some sort of factory.setFeature() line that might do this? Or maybe within my handler? Any hints would be appreciated. Thanks, Aiman [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
saxparser ignore <!doctype> line
Top