The reference to the object "f" must end with ";" limiter

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

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

 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 get the following error:

 The reference to entity "f" must end with the ';' delimiter 
+4
source share
2 answers

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

Try replacing & with &amp; , and everything should be fine: it will be understood as a real ampersand using a parser.

+31
source

Try using &amp; instead of & in the url.

+4
source

Source: https://habr.com/ru/post/1341501/


All Articles