Re: CoreDocumentImpl.setXmlVersion bug?

Dustin Schultz <[email protected]>
Newsgroups gmane.text.xml.xerces-j.user
Message-ID <CDE4AEBC.C7F1%[email protected]>
Hi Michael,

Thanks for your reply. Sorry about that, I assumed that the JDK version
was just a copy of the Apache version with a package naming change.

I've filed a bug with Oracle, bug-id: 9004112

Thanks again!

Dustin

On 6/17/13 12:12 PM, "Michael Glavassevich" <[email protected]> wrote:

>Hello Dustin,
>
>That might be a bug but you are not using Apache Xerces or Xalan.
>
>com.sun.org.apache.* is Oracle's fork of the codebase. We have no
>influence over it.
>
>If you have an issue with that implementation which you would like
>addressed you would need to pursue it with Oracle.
>
>Thanks.
>
>Michael Glavassevich
>XML Technologies and WAS Development
>IBM Toronto Lab
>E-mail: [email protected]
>E-mail: [email protected]
>
>Dustin Schultz <[email protected]> wrote on 06/14/2013 07:49:51 PM:
>
>> Hi,
>> 
>> I don't know if this is a bug or expected behavior?
>> 
>> Through various calls, Xalan ends up calling
>> CoreDocumentImpl.setXmlVersion with null if the processed XML
>> document doesn't contain an XML declaration. I'm inclined to say
>> that it's a bug since the XML declaration is optional and the method
>> should protect against NPEs.
>> 
>> java version "1.7.0_21"
>> OS: Mac OS X 10.8.4
>> 
>> This simple test code: https://gist.github.com/dustinschultz/5786101
>> With this XML: https://gist.github.com/dustinschultz/5786108
>> 
>> Results in
>> 
>> java.lang.NullPointerException
>> at 
>> com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.setXmlVersion
>> (CoreDocumentImpl.java:860)
>> at 
>> com.sun.org.apache.xalan.internal.xsltc.trax.SAX2DOM.setDocumentInfo
>> (SAX2DOM.java:144)
>> at com.sun.org.apache.xalan.internal.xsltc.trax.SAX2DOM.startElement
>> (SAX2DOM.java:154)
>> at 
>> com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.closeStartTag
>> (ToXMLSAXHandler.java:208)
>> at 
>> com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.characters
>> (ToXMLSAXHandler.java:528)
>> at 
>> 
>com.sun.org.apache.xalan.internal.xsltc.trax.StAXStream2SAX.handleCharacte
>rs
>> (StAXStream2SAX.java:262)
>> at 
>> com.sun.org.apache.xalan.internal.xsltc.trax.StAXStream2SAX.bridge
>> (StAXStream2SAX.java:169)
>> at com.sun.org.apache.xalan.internal.xsltc.trax.StAXStream2SAX.parse
>> (StAXStream2SAX.java:118)
>> at 
>> 
>com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIden
>tity
>> (TransformerImpl.java:678)
>> at 
>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform
>> (TransformerImpl.java:727)
>> at 
>> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform
>> (TransformerImpl.java:340)
>> 
>> This same code completes without Exception on 1.6.0_45 (likely
>> doesn't call setVersion but I haven't confirmed)
>> 
>> Thanks,
>> Dustin Schultz
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [email protected]
>For additional commands, e-mail: [email protected]
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.