对实体"f"的引用必须以";"结尾 分隔符

Aru*_*Das 4 android

我的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>
Run Code Online (Sandbox Code Playgroud)

我正在使用

InputStream ins = getResources().openRawResource(R.raw.myxmlfile);
Run Code Online (Sandbox Code Playgroud)

阅读文件.

但是就行了 -

url="http://something.someurl.com/access/choice/u/0/1/15626277?rtspdirect=true&f=001110786488&stylesheet=mobile">
Run Code Online (Sandbox Code Playgroud)

我收到以下错误 -

The reference to entity "f" must end with the ';' delimiter
Run Code Online (Sandbox Code Playgroud)

Rom*_*ain 32

由于这是XML格式,因此解析器期望&符号位于诸如的实体之前&quot;.

尝试替换你&&amp;,一切都应该没问题:这将被解析器理解为真正的&符号.