[jdom-interest] Attribute vs text

Bjorn Roche bjorn at xowave.com
Fri Sep 1 11:29:18 PDT 2006

On Fri, 1 Sep 2006, Jason Hunter wrote:

> Hi Bjorn,
> 0x0 is a null character.  Somehow that snuck into your file, and it's illegal 
> XML.  You could strip null characters wherever they appear in a file using a 
> FilterInputStream during the read.  Or you could figure out how to keep nulls 
> from getting into XML files.

Thanks Jason. From what you're saying, it sounds like JDOM will never 
return a 0x0 as part of a string from Element.getAttribute() or 
Element.getText(), in which case I must have added that value somewhere in 
my code, so I'll have to look for that.

I see that I can use the verifier class, which I had not noticed before 
(d'oh!), to check the validity of strings. Am I right to assume that both 
attributes and content may have the same data? In other words, if a string 
is valid content is it also valid attribute value, nd vise versa?

thanks for your help!


Bjorn Roche

XO Wave
Audio Production and Post-Production Software for Mac OS X

More information about the jdom-interest mailing list