xfer = CreateObject("roURLTransfer")
xfer.SetURL("http://rokudev.roku.com/rokudev/examples/register/getRegCode")
webService = xfer.GetToString()
xml=CreateObject("roXMLElement")
If xml.Parse(webService) then
print(xml.result.status[0])
End If
<result>
<status>success</status>
<regCode>29AX3</regCode>
<retryInterval>30</retryInterval>
<retryDuration>900</retryDuration>
</result>
"TheEndless" wrote:
result is the root node, so you should use xml.status.GetText() instead.
If xml.Parse(webService) then
Print(xml.status.GetText())
End If
"brocker" wrote:
I changed the code to be the following:If xml.Parse(webService) then
Print(xml.status.GetText())
End If
And I'm still getting "Type Mismatch". Does the code look like what you were meaning?
xfer = CreateObject("roURLTransfer")
xfer.SetURL("http://rokudev.roku.com/rokudev/examples/register/getRegCode")
webService = xfer.GetToString()
xml=CreateObject("roXMLElement")
If xml.Parse(webService) then
print(xml.status.GetText())
End If
print(xml.status[0])
"brocker" wrote:
Can you give me a brief explanation why the code on page 17 of the Brightscript Reference doesn't work in this example? Shouldn't I be able to use the logic there? Specifically, why can't I do the following;
print(xml.status[0])
rsp.photos.photo[0]will return "3131875696"
"jkard" wrote:rsp.photos.photo[0]will return "3131875696"
"BrightScript Reference Manual" wrote:
? rsp.photos.photo[0]
Will return an roXMLElement reference to the first photo (id="3131875696").