Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Android使用RSS提要的DOM解析器解析HTML实体_Java_Android_Html Parsing_Rss_Domparser - Fatal编程技术网

Java Android使用RSS提要的DOM解析器解析HTML实体

Java Android使用RSS提要的DOM解析器解析HTML实体,java,android,html-parsing,rss,domparser,Java,Android,Html Parsing,Rss,Domparser,我正在为我正在构建的Android应用程序使用google books api。这是XML文件的一个示例 <dc:description>This trilogy includes &amp;quot; The Hitchhiker&amp;#39;s Guide to the Galaxy&amp;quot; , &amp;quot; TheRestaurant at the End of the Universe&amp;quot; , &

我正在为我正在构建的Android应用程序使用google books api。这是XML文件的一个示例

<dc:description>This trilogy includes &amp;quot; The Hitchhiker&amp;#39;s Guide to the Galaxy&amp;quot; , &amp;quot; TheRestaurant at the End of the Universe&amp;quot; , &amp;quot; Life, Universe and Everything&amp;quot; and &amp;quot; So Long ...</dc:description>
<dc:format>590 pages</dc:format>
<dc:format>book</dc:format>
问题是,当使用HTML.fromHtml(Str)函数时,它会在第一个HTML实体处截断文本(因此在本例中,它只表示

这部三部曲包括

当我在Android之外运行相同的代码时,它工作正常,并且至少显示带有转义字符的字符串,即

This trilogy includes &quot; The Hitchhiker&#39;s Guide to the Galaxy&quot; , &quot; TheRestaurant at the End of the Universe&quot; , &quot; Life, Universe and Everything&quot; and &quot; So Long ...
如果我随后手动将其添加到应用程序中,HTML.fromHtml()工作正常,因此我猜问题在于Android对解析器的实现


类似的问题是。我已经尝试将工厂的验证设置为false,由于它是一个RSS提要,我无法声明HTML根元素(如本文所建议的)。

我最终没有从Google获得描述数据,但我认为运行normalise()可以解决这个问题关于document元素,我在另一个API上遇到了类似的问题,并且解决了它。

我也遇到了同样的问题,您能解释一下“normalise()”是什么意思吗?
This trilogy includes &quot; The Hitchhiker&#39;s Guide to the Galaxy&quot; , &quot; TheRestaurant at the End of the Universe&quot; , &quot; Life, Universe and Everything&quot; and &quot; So Long ...