7

I have the following xml file in my res/raw folder -

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

and I am using

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

to read the file.

However on the line -

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

i am getting the following error -

The reference to entity "f" must end with the ';' delimiter
Arunabh Das
  • 13,212
  • 21
  • 86
  • 109
  • Possible duplicate of [The reference to entity "w" must end with the ';' delimiter exception](http://stackoverflow.com/questions/6483807/the-reference-to-entity-w-must-end-with-the-delimiter-exception) – BalusC May 09 '16 at 12:18

2 Answers2

38

Since this is in XML, the parser expects the & symbol to precede entities such as &quot;.

Try replacing your & with &amp; and everything should be fine: this will be understood as being a real ampersand by the parser.

Romain
  • 2,318
  • 1
  • 23
  • 31
4

Try to use &amp; instead of & in URL.

duri
  • 14,991
  • 3
  • 44
  • 49