Devv Active Member Licensed User Longtime User Jul 13, 2016 #1 Hi I'm trying to get the image from an xml site i'm using xmlsax this is the site im trying to get the images from http://feeds.bbci.co.uk/arabic/rss.xml i tried this B4X: Sub Parser_EndElement (Uri As String, Name As String, Text As StringBuilder) If Name="url" Then Log(Text.ToString) End If End Sub but no success any ideas ?
Hi I'm trying to get the image from an xml site i'm using xmlsax this is the site im trying to get the images from http://feeds.bbci.co.uk/arabic/rss.xml i tried this B4X: Sub Parser_EndElement (Uri As String, Name As String, Text As StringBuilder) If Name="url" Then Log(Text.ToString) End If End Sub but no success any ideas ?
Erel B4X founder Staff member Licensed User Longtime User Jul 13, 2016 #2 The url is an attribute. You should get it in StartElement from the Attributes map. Upvote 0
Devv Active Member Licensed User Longtime User Jul 14, 2016 #3 Erel said: The url is an attribute. You should get it in StartElement from the Attributes map. Click to expand... Thanks for replay Erel so this way m code is right ? B4X: Sub Parser_StartElement(Uri As String, Name As String, Attributes As Attributes) If Attributes.Size > 1 Then ' Log(Attributes.GetValue(2)) image = Attributes.GetValue(2) End If End Sub Upvote 0
Erel said: The url is an attribute. You should get it in StartElement from the Attributes map. Click to expand... Thanks for replay Erel so this way m code is right ? B4X: Sub Parser_StartElement(Uri As String, Name As String, Attributes As Attributes) If Attributes.Size > 1 Then ' Log(Attributes.GetValue(2)) image = Attributes.GetValue(2) End If End Sub
Erel B4X founder Staff member Licensed User Longtime User Jul 14, 2016 #4 It is better to use GetValue2 with the name but if it returns the correct result then it is ok. Upvote 0