Without more accurate information for your script, it will be difficult to get you the answer you are looking for. My guess…
If you are parsing the xml with a loop, most likely your event.images.small.gettext() is looking at the wrong key as “event” probably doesn’t exist within the item tags.
If you are typing “image = event.images.small.gettext()” from outside the loop, in the main entry for the xml then it is pulling the data you want.
When the image fails with your prefere/original way of accessing the image, what shows up when you try printing the sdposterurl value?
Here is the function that I am using to retrieve the XML via HTTP, parsing the XML, and creating a list of objects. The XML parsing is NOT the issue here, as I am printing out all the correct values.
The issue has something to do with setting SDPosterUrl to the image path parsed from the XML. If I print out the image values, and set SDPosterUrl to one of those values, then the image displays, which does not make sense to me. The parsed image path is a String type, just like when I set SDPosterUrl to a literal string value.
I do not receive any bad path errors or anything, the screen just displays loading for the image. It just doesn’t make any sense to me.
Function getShowsForCategoryItem(category As Object) As Object
print "getting shows for category "; category
url = "http://somePath?channel=" + category + "&type=live&format=xml"
http = CreateObject("roUrlTransfer")
http.SetUrl(url)
data = http.GetToString()
xml=CreateObject("roXMLElement")
xml.Parse(data)
events = xml.events.event
Dim list[20]
for each event in events
eventObj = CreateObject("roAssociativeArray")
eventObj.ShortDescriptionLine1 = event.startTime.gettext()
eventObj.ShortDescriptionLine2 = event.showName.gettext()
stream = CreateObject("roAssociativeArray")
stream.url = event.videoURL.gettext()
stream.quality = "SD"
image = event.images.small.gettext()
print(image)
eventObj.SDPosterUrl = image
eventObj.Stream = stream
list.Push(eventObj)
end for
return list
End Function
to see what the differences are between the value of the variable image and the value you think you are getting.
clearly the value of image isn’t the correct value for the path, so take a look at the actual value, compare it to the path that you are expecting, then figure out why it is different.
Also, the assumption that has been made so far in this thread is that by path, you mean servername. If by path you mean actual path to a local image resource, the syntax is different:
image=“pkg:/images/something.jpg” would be a good local path or image=“tmp:/something.jpg”
http paths are only for connecting to an external server via http protocol.