简体   繁体   English

使用apache摘要从XML读取数据

[英]Read data as it is from the xml using apache digester

I am using Java digester for reading XML. 我正在使用Java摘要读取XML。 My XML element has some HTML contents like: 我的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>

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. 我想按原样阅读或解析。

That's not properly formed XML. 格式不正确的XML。 For example: 例如:

Recording the results of comparisons with the symbols >, =, and < 用符号>,=和<记录比较结果

should use the XML entities &lt; 应该使用XML实体&lt; and &gt; &gt;

So an XML parser will fail against this. 因此,XML解析器将对此失败。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM