Hi,

I am writing a small tool for comparing XML documents. In general, I am
reading documents using the Xerces SAX parser and forward the events to an
instance of XMLSerializer. In other words, I have a class implementing
ContentHandler, which looks roughly like the following:

    public class MyHandler implements ContentHandler, DeclHandler {
        XMLSerializer xs;
        public void startDocument() throws SAXException {
            xs.startDocument();
        }
        ...
    }

My desire is, that

    * external entities are not resolved and
    * the created document contains a reference for the external
      entity

My idea is, that Xerces would invoke the skippedEntity(String) method and I
generate the reference by forwarding the event to the XMLSerializer.
However, the parser doesn't invoke my method. Here's how I initialize the
parser:

                SAXParserFactory spf = SAXParserFactory.newInstance();
                spf.setNamespaceAware(false);
                spf.setValidating(false);
                
spf.setFeature("http://xml.org/sax/features/external-general-entities";,
false);
                SAXParser sp = spf.newSAXParser();
                return sp.getXMLReader();


Regards,

Jochen




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to