[jdom-interest] Question about turning off escaping & charact ers..

Pugh, Eric EPugh at MuseumCompany.com
Thu Dec 6 12:51:27 PST 2001

Thanks for the response!  Unfortuanantly, the raw data already has the
escaped data in it.  I guess then, based on this, that what I should do is
run the data through a "de-escaper" and convert everything back.  Then build
my document, and that way it would only escape onece...?


-----Original Message-----
From: Jason Hunter [mailto:jhunter at acm.org]
Sent: Thursday, December 06, 2001 3:46 PM
To: Pugh, Eric
Cc: 'jdom-interest at jdom.org'
Subject: Re: [jdom-interest] Question about turning off escaping &

The best way to solve this is to set the text in the document as the
exact string you want without the escaping.  Here for example just set
\u0151 in the string when it's set.  Then when someone calls getText()
they'll get the right string, and the outputter will handle it correctly
too.  Do not set the text in an escaped form.

You can control the outputter escaping behavior through subclassing. 
You'll only need to do that here if you want the char written as —
instead of the default UTF-8 encoded char.


"Pugh, Eric" wrote:
> Hi,
> In my application, some of my test descriptions have & characters in them,
> for instance, "Set the tempo and call the tune—you control every.."
> The — is to product a long dash (an em dash?).   However, when it use
> the XMLOutputter to create my XML document, it see's the & character and
> changes it to —.  Out partner who reads in the XML can't parse
> properly.
> How can I turn off this escaping behavior?  The encoding type is
> Eric Pugh
> _______________________________________________
> To control your jdom-interest membership:

More information about the jdom-interest mailing list