Hi Jochen,
Indeed, the parser should be invoking skippedEntity when the external-general-entities feature is set to false. This has been fixed in CVS and will show up in the next release. If you need this fix sooner, you can download the latest build here [1].
Thanks.
[1] http://gump.covalent.net/jars/2004-05-24/xml-xerces2/
Jochen Wiedmann <[EMAIL PROTECTED]> wrote on 05/24/2004 04:32:29 PM:
>
> 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]
>
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]
- How to report external entities? Jochen Wiedmann
- Re: How to report external entities? Michael Glavassevich
- Re: How to report external entities? Jochen Wiedmann