> That would do it with the list I suggested. I probably should
> have posted
> the actual list--I'm reading it from an XML file, and I can't
> count on all
> the child nodes at the same level having the same property. A better
> example would be something like[[#puzzle: [#title: "One"], [#level:
> "Moderate"], [#word: "Lingo"], [#word: "Director"]],
> [#puzzle: [#title:
> "Two"], [level: "Beginner"], [#word: "Action"], [#word: "Flash"]]]
>
> I think I counted my brackets right.

Hi Kerry,
Your list makes absolutely no sense to me, but then I've never had to deal
with Xml, so I don't know how the parser works :/

Correct me if I'm wrong, but if the list looks like that, what you get is
#puzzle: [#title: "One"]
That's it. All the other items will NOT be part of the #puzzle property -
they will be seperate items. Are you sure your brackets are in the right
place?
[#puzzle: [ [#title: "One"], [#level: "Moderate"], [#word: "Lingo"], [#word:
"Director"] ] ]
- would make all the sub lists into values of the #puzzle property (rather
then just the first sub list)

But still, none of the properties in this list HAVE ANY FUNCTION
WHATSOEVER... pardon my caps ;)

The way this list SHOULD have looked like, ideally is:
[#puzzle: [#title: "One", #level: "Moderate"] etc.
but even if it did, there are two things: there would be two property names
#word, conficting with eachother, and the property name #puzzle wouldn't
have any function (which it still doesn't...)

If you can't change the structure of the list, here's a way to do what you
wanted (with the brackets re-aligned):

on propLst
  mainList = [ [#puzzle: [ [#title: "One"], [#level: "Moderate"], [#word:
"Lingo"], [#word: "Director"] ] ],  [#puzzle: [ [#title: "Two"], [level:
"Beginner"], [#word: "Action"], [#word: "Flash"] ] ] ]

  repeat with subList1 in mainList
    repeat with subList2 in subList1
      repeat with subList3 in subList2
        repeat with myValue in subList3
          put myValue
        end repeat
      end repeat
    end repeat
  end repeat
end

This is what I get in the message window:

propLst
-- "One"
-- "Moderate"
-- "Lingo"
-- "Director"
-- "Two"
-- "Beginner"
-- "Action"
-- "Flash"

If you need ALSO to know the property names, you can also add in the middle
level
  put subList3.getOne(myValue)
(above/below the line: put myValue)

and then you get in the message window:

propLst
-- #title
-- "One"
-- #level
-- "Moderate"
-- #word
-- "Lingo"
-- #word
-- "Director"
-- #title
-- "Two"
-- #level
-- "Beginner"
-- #word
-- "Action"
-- #word
-- "Flash"


Does that help at all?

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!]

Reply via email to