[jdom-interest] Entities

Alex Chaffee guru at stinky.com
Wed Jul 11 12:08:28 PDT 2001


Todd O'Bryan wrote:

>
> The problem is that when I output the parsed document (using 
> XMLOutputter), I still have &s where I want just & characters. Is 
> there any way to turn off XMLOutputter's desire to replace the three 
> special characters (&, >, and <) with their entity values?
> 


Yes, there's a way to make it output illegal XML (XML declares "no raw 
ampersands").

Make a subclass and override the protected method 
escapeElementEntities(String).  You may also want to override 
escapeAttributeEntities(String).

  - Alex


-- 
Alex Chaffee                       mailto:alex at jguru.com
jGuru - Java News and FAQs         http://www.jguru.com/alex/
Creator of Gamelan                 http://www.gamelan.com/
Founder of Purple Technology       http://www.purpletech.com/
Curator of Stinky Art Collective   http://www.stinky.com/




More information about the jdom-interest mailing list