0

How do i parse this Description node? i need img link and description , and do you think its a correct XML for parsing because for me its not making any sense,

 <description><![CDATA[<img width="680" height="538"
    src="https://tctechcrunch2011.files.wordpress.com/2017/09/team1.png?w=680" class="attachment-large size-large wp-post-image" alt="" 
    srcset="https://tctechcrunch2011.files.wordpress.com/2017/09/team1.png?w=680 680w,
         https://tctechcrunch2011.files.wordpress.com/2017/09/team1.png?w=1360 1360w, 
        https://tctechcrunch2011.files.wordpress.com/2017/09/team1.png?w=150 150w, 
        https://tctechcrunch2011.files.wordpress.com/2017/09/team1.png?w=300 300w, 
        https://tctechcrunch2011.files.wordpress.com/2017/09/team1.png?w=768 768w"
         sizes="(max-width: 680px) 100vw, 680px" />&nbsp;
        DogBuddy, a pan-European online marketplace for dog sitting, has closed €5 million in Series A funding, money it plans for further expansion. Backing the London-headquartered startup in this round is existing investor Sweet Capital, the investment fund started by the founders of King.com, and a number of new unnamed private investors. It brings total raised by DogBuddy to €10 million. 
        <a href="https://techcrunch.com/2017/09/21/dogbuddy-2/?ncid=rss">Read More</a>]]></description>

I'm using DOM

Zoe
  • 27,060
  • 21
  • 118
  • 148
Habib Qureshi
  • 31
  • 1
  • 5

1 Answers1

0

First of all.

and do you think its a correct XML for parsing because for me its not making any sense,

of course it is. you can test here. https://codebeautify.org/xmlviewer

Second

if this is the final response, then you have the choice of using.

android.text.Html; // for html tags
android.text.Html.ImageGetter; // for html image tags parsing

classes and Regex. hopefully it will be work.

SRB Bans
  • 3,096
  • 1
  • 10
  • 21
  • hey thanks for your answer i'm getting complete xml from https://techcrunch.com/feed/ and i have parsed every thing except the tag so i'm getting this tag as a Node how should i change it according to your answer thanks – Habib Qureshi Sep 21 '17 at 09:22
  • dude... there r many examples.. see.. https://stackoverflow.com/questions/15617210/android-html-fromhtml-with-images – SRB Bans Sep 21 '17 at 09:41
  • or for regex.. https://stackoverflow.com/questions/25545370/extract-image-src-from-imgtag-in-android – SRB Bans Sep 21 '17 at 09:42