Ramkumar Kalirajan
Ramkumar Kalirajan

Reputation: 311

Read data as it is from the xml using apache digester

I am using Java digester for reading XML. My XML element has some HTML contents like:

<title> Understand the following as special cases:<br/>a. Bundle of ten ones — called a "ten."<br/>b. The numbers from 11 to 19 are composed of a ten and one, two, three, four, five, six, seven, eight, or nine ones.<br/>c. Recording the results of comparisons with the symbols >, =, and <.</title>

After parsing it is changed like below.

Understand the following as special cases: &lt;br/>a. Bundle of ten ones — called a "ten." &lt;br/>b. The numbers from 11 to 19 are composed of a ten and one, two, three, four, five, six, seven, eight, or nine ones.&lt;br/>c. Recording the results of comparisons with the symbols &gt;, =, and &lt;.

I want to read or parse as it is.

Upvotes: 0

Views: 106

Answers (1)

Brian Agnew
Brian Agnew

Reputation: 272347

That's not properly formed XML. For example:

Recording the results of comparisons with the symbols >, =, and <

should use the XML entities &lt; and &gt;

So an XML parser will fail against this.

Upvotes: 1

Related Questions