> I won't post the property list the xml parser returns, because it is
> horrendous and confusing. Here's what it boils down to, though:
> pList=\
> [\
> [#puzzle: \
> [\
> [#title: "Business Across Cultures"], \
> [#entry: [[#answer: "Breed"], [#clue: "yada yada"]]], \
> [#entry: [[#answer: "yada"], [#clue: "yada yada"]]]\
> ]\
> ],\
> [#puzzle: \
> [\
> [#title: "Hot Ideas"], \
> [#entry: [[#answer: "Breed"], [#clue: "yada yada"]]] \
> ]\
> ]\
> ]
Ok, and what exactly do you want to do with it now?
And did you think about converting The entries to objects? It seems to me
that this list is crying for you:
"Kerry! Please make me into an object!"
Puzzle script:
property pTitle
property plEntries
on new me, puzzleList
plEntries = []
iMax = puzzleList.count
repeat with i = 1 to iMax
myProp = puzzleList.getPropAt(i)
myValue = puzzleList[i]
case myProp of
#Title: pTitle = myValue
#Entry: plEntries.add[myValue]
otherwise nothing
end case
end repeat
return me
on getTitle me
return pTitle
end
on getEntry me, whichEntryNum
return plEntries[whichEntryNum]
end
on getAnswer me, whichEntryNum
return plEntries[whichEntryNum][#answer]
end
--And so on...
Then in a movie script (or wherever you parsed the xml into)
glPuzzles = []
repeat with lst in pList --that's your original list
puzzleList = lst.puzzle
obj = script("Puzzle").new (puzzleList)
end repeat
Then you can use the object's own methods to retrieve the title and entries,
either in a linear or random order.
That's what I would advise you to do, if I knew what you want to do with the
list...
But since I don't know, guess I won't ;)
BTW: I don't know how much you know about OOP, but have you checked out
Irv's OOP book yet? It explains all you need to know about objects, why
objects etc., and is SO much more understandable then "Lingo Sorcery"...
http://www.furrypants.com/loope/
Karina
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]