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 ne...@ca.ibm.com on 2001/01/02 19:50:18 UTC

Re: Parsing XML: How do I get the URL of the DTD??


Hi,

Even though you're using the DOM parser, you still have access to the
setEntityResolver method from the SAX.  If you implement your own
org.xml.sax.EntityResolver and register it with the above-mentioned method,
you'll have access to the systemId and be able to do whatever you need to
with it.

Hope that helps,
Neil

Neil Graham
XML Parser Development
IBM Toronto Lab
Phone:  416-448-3519, T/L 778-3519
E-mail:  neilg@ca.ibm.com



djacobson@javtech.com on 12/29/2000 02:45:15 PM

Please respond to xerces-j-dev@xml.apache.org

To:   xerces-j-dev@xml.apache.org
cc:
Subject:  Parsing XML: How do I get the URL of the DTD??


I am using the DOM parser to parse XML:
org.apache.xerces.parsers.DOMParser parser = new
org.apache.xerces.parsers.DOMParser();
parser.parse(source);

The XML has an external DTD in URL form:
<?xml version="1.0"?>
<!DOCTYPE FIXML SYSTEM "file:///d:/Documents/DTD/blah/blah.dtd" >

How do I get at the URL string?  I believe this is called the SystemID??  I
have tried everything, including:
parser.getLocator().getSystemId();
But parser.getLocater()  returns null.

Any ideas?


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