S
SnooPac
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
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