>foo<

Prevent JSOUP from unencoding attribute values

I have some code like this

String str = "<element data=\"some &lt;data&gt;\"> &gt;foo&lt; </element>"; Document doc = Jsoup.parse(str, "", Parser.xmlParser()); 

But JSOUP decrypts the meaning of the data , creating something like this

 <element value="some <data>"> &gt;foo&lt; </element> 

How to prevent JSOUP from unencoding attribute values?

+6
source share
1 answer

You are facing the well-known Jsoup problem (1.8.3 at the time of this writing).

See here for more details: https://github.com/jhy/jsoup/issues/55

The question was published on December 27, 2010 ... almost 5 years before your question. I hope this helps draw attention to this.

UPDATE
The author of Jsoup closed the problem, as it DOES NOT CORRECT.

+1
source

All Articles