xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank.Schoenfel...@e-pro.de
Subject Re: Getting Doctype Declaration under Xerxes-j
Date Fri, 17 Nov 2000 08:18:59 GMT

Though i used the Sax Parser but i think it could be work with Dom
as well. I used an EntityResolver implemented in a class e.g.
My EntityResolver.
After you set the features and properties for the parser, you set the
EntityResolver for the parser e.g. like this.

DOMParser parser = new DOMParser();
parser.setFeature("see Apache Docu")

The EntityResolver is used while parsing, but just at the begin.
If a <DOCTYPE....> declaration occured it is called.
You know get all specified DTD´s, i mean also intern linked
Than you can also set a new Input Source for your (new) DTD name:

public class MyEntityResolver implements EntityResolver

     public InputSource resolveEntity(java.lang.String publicId,
                         java.lang.String systemId) throws SAXException
               InputSource isource = new InputSource(systemId);

                    isource=new InputSource("NewDTDname.dtd");

So, I hope I could help you, and it will be work with DOMParser.
Nice try, bye!

View raw message