Page 1 of 1

XML woes

Posted: Thu Jan 23, 2014 8:20 pm
by wgilliam
Aloha all
I am fairly new to livecode, about a year. I love it.
Im working on processing XML data pulled from a website and having a heck of a time. Ive read all the posts on xml, Ive followed the RSS and XML tutorials with success, but with my data I keep getting a "cant find element" error. I have scoured the dictionary trying several of the XML functions.
Heres a sample of the XML data:

<?xml version="1.0"?>
<Entries>
<Entry>
<EntryId>1</EntryId>
<Field1>Wil</Field1>
<Field2>Gilliam</Field2>
<Field3>PO 781</Field3>
<Field4/>
<Field5>honokaa</Field5>
<Field6>hi</Field6>
<Field7>96727</Field7>
<Field8>United States</Field8>
<UpdatedBy>public</UpdatedBy>
</Entry>
</Entries>

And heres the code Ive been trying:

local tWebPage = "curl -u XXX-XXXX-XXXX-XXXX:psswrd (valid xml link that I cant post because of forum permissions)

on mouseup
put revCreateXMLTree(tWebPage,false,true,false) into sData

put revXMLChildNames(sData, "Entries","Entry","EntryId", true) into tData


put tData into field "Information"
end mouseup



I have tried every possible variation as well:
put revXMLChildNames(sData, "Entries","Entry" true) into tData
put revXMLChildNames(sData, "Entries", true) into tData
etc


and other functions get the same error:
revXMLNodeContents(sData, "Entry")
etc.

Does it have to do with the curl authentication?
I get a positive integer from building the tree so I think I have that down ok.
Any help or guidance will be greatly appreciated. This is the first time Ive been stuck on something while learning livecode, which is a good sign, Im brand new to software development.
Mahalo and Aloha
Wil

Re: XML woes

Posted: Fri Jan 24, 2014 4:51 am
by Nakia
Have a gander at this.
Should give you the contents.........

Edit: if there is more that 1 Entry back the start node down an element to "Entries" in place of "Entries/Entry"