[jdom-interest] Question about turning off escaping & characters..
jhunter at acm.org
Thu Dec 6 14:05:25 PST 2001
Yep, good plan.
Write back if you need help making the output escape like you want. We
basically punt on the issue for performance reasons because when you
write UTF-8 you don't need to escape anything but a few special chars.
Some might want more escaping for human readability, and for that you
subclass and can add whatever escape rules you want. There's been some
talk about how to make this part of the core offering.
"Pugh, Eric" wrote:
> 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 &#151;. 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