[Yanel-dev] Problem with XMLHelper.documentToString

Guillaume Déflache guillaume.deflache at wyona.com
Wed Mar 4 09:33:23 CET 2009


Michael Wechner schrieb:
> Michael Wechner schrieb:
>> Hi
>>
>> I receive the following error when using
>>
>> ERROR org.wyona.commons.xml.XMLHelper.documentToString():66  - 
>> java.lang.NullPointerException
>> java.lang.NullPointerException
>>        at 
>> org.apache.xml.serializer.TreeWalker.dispatachChars(TreeWalker.java:244)
>>        at 
>> org.apache.xml.serializer.TreeWalker.startNode(TreeWalker.java:414)
>>        at 
>> org.apache.xml.serializer.TreeWalker.traverse(TreeWalker.java:143)
>>        at 
>> org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:389) 
>>
>>        at 
>> org.wyona.commons.xml.XMLHelper.documentToString(XMLHelper.java:64)
>>
>> which is similar
>>
>> https://jira.jboss.org/jira/browse/JSFUNIT-70
>>
>> I have not observed this before. Is it possible that this because of 
>> the recent XML lib changes?
> 
> It seems that this method fails in case of empty nodes/tags, for example 
> <my-tag/>
> 
> Using the Apache XMLSerializer it works, but I am afraid that something 
> else might break and also I actually
> do not want to introduce an explicit Apache XMLSerializer dependecy.
> 
> WDYT?

I guess this particular case needs fixing then, as this should work the 
same whatever we use as JAXP implementations.
And of course relying on a particular implementation, even indirectly 
(i.e. at runtime) is probably not a good idea.


More information about the Yanel-development mailing list