[jdom-interest] SAXHandler / CDATA / entities

Jason Hunter jhunter at servlets.com
Thu Nov 21 16:38:11 PST 2002


> If you feed this into jdom, what happens is that the chars are decoded to
> 
> <SomeNode>Here is some embedded HTML with a <br> in it.</SomeNode>

No, not really.  JDOM reads the text correctly and if you call getText()
you'll see <br> in there because that's the text.  But try outputing
that text with XMLOutputter and you'll see the chars escaped correctly
as &lt; and &gt;.  We don't preserve the same escape model because
semantically it doesn't matter and SAX doesn't provide the original
escapes.

-jh-





More information about the jdom-interest mailing list