tags:

views:

396

answers:

1

Hi,

I need to unescape a xml string containing escaped XML tags:

<
>
&
etc...

I did find some libs that can perform this task, but i'd rather use a single method that can perform this task.

Can someone help?

cheers, Bas Hendriks

+3  A: 
StringEscapeUtils.unescapeXml(xml)

(commons-lang, download)

Bozho
"but i'd rather use a single method that can perform this task."
Bas Hendriks
That is a single method.
David Dorward
Bas, read commons-lang's source code and see if it's worth to reinvent the wheel in your case instead of justing using it.
Felipe Cypriano
@Bas - there's nothing in the standard Java library to do this, so either you use a third-party library that can do this for you, or you have to write it yourself (not recommended).
Jesper