Thomas DeWeese:
> > - TranscoderInput fails with an NPE
> > java.lang.NullPointerException at org.apache.batik.dom.util.
> > SAXDocumentFactory.startElement(SAXDocumentFactory.java:562) at 
> org.apache.
> > xerces.parsers.AbstractSAXParser.startElement(Unknown Source) at 
> org.apache.
> > xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source) at
> 
>    This might be a bug in Batik (but probably not your stuff).
> The failure is in the code:
>             try {
>                 isStandalone = parser.getFeature
>                     ("http://xml.org/sax/features/is-standalone";);
>             } catch (SAXNotRecognizedException ex) {
>             }
>             try {
>                 xmlVersion = (String) parser.getProperty
>  ("http://xml.org/sax/properties/document-xml-version";);
>             } catch (SAXNotRecognizedException ex) {
>             }
> 
>    Cameron what is the purpose of this code?  Can we check if parser
> is null and provide some default? Can you guess why parser would be
> null?  This isn't the first time the code has failed here.

That code gets the 'version' and 'standalone' attributes from the XML
declaration, so that they can be exposed in some DOM attributes on the
DOM 3 Document object.

It is strange that parser would become null in startElement, since that
should only be called from within the parser’s parse method, and the
only time parser is set back to null is at the end of createDocument.
When I get some time(!) I’ll investigate.

-- 
Cameron McCormack, http://mcc.id.au/
        xmpp:[EMAIL PROTECTED]  ▪  ICQ 26955922  ▪  MSN [EMAIL PROTECTED]

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

Reply via email to