使用apache digester从xml读取数据

时间:2012-08-01 13:04:13

标签: java xml

我正在使用Java digester来读取XML。我的XML元素有一些HTML内容,如:

<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>

解析后,如下所示进行了更改。

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;.

我想按原样阅读或解析。

1 个答案:

答案 0 :(得分:1)

这不是正确形成的XML。例如:

  

使用符号&gt;,=和&lt;

记录比较结果

应使用XML实体&lt;&gt;

因此XML解析器将失败。