You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Brad OHearne <Br...@careerpath.com> on 2000/08/14 20:19:01 UTC

Problem with SAX2 reference to external subset

I am encountering a problem while trying to parse an XML file that
references an external DTD subset.  I am using the Xerces SAX2 parser on JDK
1.2, but the parser is throwing an exception when it tries to locate the
external DTD subset (i.e. DataFeed.dtd).  I have tried this both with an
absolute path to this file and without one, and either way, it throws an
exception.  Does anyone have any ideas on this?

Here is the code that creates and invokes the parser:

	String uri = "file:" + "c:\\data\\dev\\test\\inproc\\data.xml"; 
	
	SAXParserFactoryImpl spf = new SAXParserFactoryImpl();
	spf.setNamespaceAware(true);
	spf.setValidating(true);

	try {	
		SAXParser parser = spf.newSAXParser();
	    parser.parse(uri, new FeedHandler());
	}
	catch (ParserConfigurationException e) {

	}
	catch (SAXException se) {
	    se.printStackTrace();
	}
	catch (IOException ioe) {
		ioe.printStackTrace();
	}


Your help would be greatly appreciated!

Brad


RE: Problem with SAX2 reference to external subset

Posted by Lawrence Fry <lw...@bbnow.net>.
Brad,

try

String uri = "file:///c:/data/dev/test/inproc/data.xml" ...works for me.

regards,

Lawrence




-----Original Message-----
From: Brad OHearne [mailto:Brad.OHearne@careerpath.com]
Sent: Monday, August 14, 2000 11:19 AM
To: xerces-j-dev@xml.apache.org
Subject: Problem with SAX2 reference to external subset


I am encountering a problem while trying to parse an XML file that
references an external DTD subset.  I am using the Xerces SAX2 parser on JDK
1.2, but the parser is throwing an exception when it tries to locate the
external DTD subset (i.e. DataFeed.dtd).  I have tried this both with an
absolute path to this file and without one, and either way, it throws an
exception.  Does anyone have any ideas on this?

Here is the code that creates and invokes the parser:

	String uri = "file:" + "c:\\data\\dev\\test\\inproc\\data.xml";

	SAXParserFactoryImpl spf = new SAXParserFactoryImpl();
	spf.setNamespaceAware(true);
	spf.setValidating(true);

	try {
		SAXParser parser = spf.newSAXParser();
	    parser.parse(uri, new FeedHandler());
	}
	catch (ParserConfigurationException e) {

	}
	catch (SAXException se) {
	    se.printStackTrace();
	}
	catch (IOException ioe) {
		ioe.printStackTrace();
	}


Your help would be greatly appreciated!

Brad


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org