Join the Stack Overflow Community
Stack Overflow is a community of 6.4 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

I am getting a Response in XML format

<item>
<title>
<![CDATA[
28. Februar 2013, FY/Q4 2012 Investoren-Telefonkonferenz
]]>
</title>
<author>
<![CDATA[ BAYER AG - Investorveranstaltungen ]]>
</author>
<pubDate>Thu, 28 Feb 2013 12:00:00 +0100</pubDate>
<description>
<![CDATA[
Rede von Dr. Marijn Dekkers, Vorsitzender des Vorstands der Bayer AG, Investoren-Telefonkonferenz zu den Ergebnissen des Geschaeftsjahres und des 4. Quartals 2012. (Auf...
]]>
</description>
<link>
http://www.webvideo.bayer.com/downloads/9208/9212/12312/file.mp3
</link>
<content:encoded>
<![CDATA[
<p>Rede von Dr. Marijn Dekkers, Vorsitzender des Vorstands der Bayer AG, Investoren-Telefonkonferenz zu den Ergebnissen des Geschaeftsjahres und des 4. Quartals 2012. (Auf Englisch)</p>
]]>
</content:encoded>
<category>ISIN_DE000BAY0017</category>
<category>ISIN_DE000BAY0017</category>
<category>podcast</category>
</item>
<item>
<title>
<![CDATA[
2013-01-30 - Analyst &amp; Investor Conference - Welcome Marc Spieker, Head of Investor Relations
]]>
</title>
<author>
<![CDATA[ E.ON Podcast ]]>
</author>
<pubDate>Wed, 30 Jan 2013 15:00:00 +0100</pubDate>
<description>
<![CDATA[ Analyst &amp; Investor... ]]>
</description>
<link>
http://www.thomson-webcast.net/de/portals/download.mp3?portal_id=315d3fce100b408b41a2c66bb982a367&presentation_id=d43466300a1a8ced8324011b593fb05a&video_id=24ae8f409449411695c0729760646bf7
</link>
<content:encoded>
<![CDATA[ <p>Analyst & Investor Conference</p> ]]>
</content:encoded>
<category>ISIN_DE000ENAG999</category>
<category>ISIN_DE000ENAG999</category>
<category>podcast</category>
</item>

I write a Parser to retrieve data from response .

But the Problem is .When i test this in 2.1 device , It works as follows, I tested with Android 2.2 ,android 2.2.1 it works fine . Can any body tell me whats the problem

    <link>
      http://www.webvideo.bayer.com/downloads/9208/9212/12312/file.mp3
   </link>

I am able retrieve the link correctly But when in another case , I failed

    <link>
     http://www.thomson-webcast.net/de/portals/download.mp3?portal_id=315d3fce100b408b41a2c66bb982a367&presentation_id=d43466300a1a8ced8324011b593fb05a&video_id=24ae8f409449411695c0729760646bf7
    </link>

When i parse the result is

 http://www.thomson-webcast.net/de/portals/download.mp3?portal_id=315d3fce100b408b41a2c66bb982a367

Data after & is missing . I saw this only in android 2.1 .Can anybody Suggest me what could be wrong??

share|improve this question
up vote 1 down vote accepted

Probably the link text should be also in CDATA section, or have the & marks converted to &amp;

The &presentation_id... is considered as an (unresolved) XML entity.

Solution 1 (with CDATA):

<link>
    <![CDATA[http://www.thomson-webcast.net/de/portals/download.mp3?portal_id=315d3fce100b408b41a2c66bb982a367&presentation_id=d43466300a1a8ced8324011b593fb05a&video_id=24ae8f409449411695c0729760646bf7]]>
</link>

Solution 2 with &amp;:

<link>
    http://www.thomson-webcast.net/de/portals/download.mp3?portal_id=315d3fce100b408b41a2c66bb982a367&amp;presentation_id=d43466300a1a8ced8324011b593fb05a&amp;video_id=24ae8f409449411695c0729760646bf7
</link>
share|improve this answer
    
is there any way to get the link correctly?? – edwin Mar 5 '13 at 11:42
    
Try to change the server output. I put examples in the answer. – GaborSch Mar 5 '13 at 11:43
    
OK thank u i will try – edwin Mar 5 '13 at 12:20
    
But my parser works correctly in other android Version . Only problem with Android 2.1 – edwin Mar 5 '13 at 12:26
1  
You can try a different parser, there may be differences between them. Actually, the 2.1 parser is correct: it its not a valid XML. It seems that later the parser was extended to be more lean, that's why this example is working on 2.2+ versions. So, the correct way is to change the server output. – GaborSch Mar 5 '13 at 12:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.