【问题标题】:The reference to entity "f" must end with the ';' delimiter对实体“f”的引用必须以“;”结尾分隔符
【发布时间】:2011-07-05 04:10:15
【问题描述】:

我的 res/raw 文件夹中有以下 xml 文件 -

RSS 的标题 http://urlofthething.com

    <item>
        <title>Title</title>
        <description>The description goes here</description>
        <link>http://someurl.someurl.com/data/Content/1771370477</link>
        <guid>15626277</guid>
        <pubDate>28 Jan 2011 19:07:00 +0000</pubDate>
        <media:group>
            <media:content medium="video" duration="273"
                url="http://something.someurl.com/access/choice/u/0/1/15626277?rtspdirect=true&f=001110786488&stylesheet=mobile">

            </media:content>
        </media:group>
    </item>

    <item>
        <title>Title</title>
        <description>The description goes here</description>
        <link>http://someurl.someurl.com/data/Content/1771370477</link>
        <guid>15626277</guid>
        <pubDate>28 Jan 2011 19:07:00 +0000</pubDate>
        <media:group>
            <media:content medium="video" duration="273"
                url="http://something.someurl.com/access/choice/u/0/1/15626277?rtspdirect=true&f=001110786488&stylesheet=mobile">

            </media:content>
        </media:group>
    </item>
</channel>

我正在使用

InputStream ins = getResources().openRawResource(R.raw.myxmlfile);

读取文件。

不过就行了——

url="http://something.someurl.com/access/choice/u/0/1/15626277?rtspdirect=true&f=001110786488&stylesheet=mobile">

我收到以下错误 -

The reference to entity "f" must end with the ';' delimiter

【问题讨论】:

标签: android


【解决方案1】:

由于这是在 XML 中,因此解析器希望 &amp;amp; 符号位于 &amp;quot; 等实体之前。

尝试用&amp;amp; 替换您的&amp;amp;,一切都会好起来的:这将被解析器理解为真正的&。

【讨论】:

  • 你就是那个人!!感谢帮助! :D
【解决方案2】:

尝试在 URL 中使用&amp;amp; 而不是&amp;

【讨论】:

    猜你喜欢
    • 2011-09-22
    • 2014-05-26
    • 2010-12-29
    • 2020-07-14
    • 1970-01-01
    • 2012-12-16
    • 2019-10-04
    • 1970-01-01
    相关资源
    最近更新 更多