>I'm wondering if anyone has might be able to tell me where to get info on
>how to use XML in director?

Here is a good place.

I see Christopher has pointed you at the XML parser Xtra. It's not well 
documented, though, and using it is not intuitive at all.

For example, if you know XML (or HTML), you know what an attribute is. The 
XML parser has a different idea of an attribute, though.

Essentially, the XML parser brings your data into a property list--probably 
a list of lists. It's confusing, though, to see every entry in the list 
prefaced with !ATTRIBUTES: [:] as the first property, all the way through 
the node tree.

For example, this xml:

<crosswords>
         <puzzle level="beginning">
                 <title>Business Across Cultures</title>
                 <entry>
                         <answer>Breed</answer>
                         <clue>A particular kind of person</clue>
                 </entry>
                 <entry>
                         <answer>Discriminate</answer>
                         <clue>Show perceptive judgment</clue>
                 </entry>
         </puzzle>
         <puzzle level="Intermediate">
                 <title>Hot Ideas</title>
                 <entry>
                         <answer>per</answer>
                         <clue>for each</clue>
                 </entry>
         </puzzle>
</crosswords>

produces this property list:

-- ["ROOT OF XML DOCUMENT": ["!ATTRIBUTES": [:], "crosswords": 
["!ATTRIBUTES": [:], "puzzle": ["!ATTRIBUTES": ["level": "beginning"], 
"title": ["!ATTRIBUTES": [:], "!CHARDATA": "Business Across Cultures"], 
"entry": ["!ATTRIBUTES": [:], "answer": ["!ATTRIBUTES": [:], "!CHARDATA": 
"Breed"], "clue": ["!ATTRIBUTES": [:], "!CHARDATA": "A particular kind of 
person"]], "entry": ["!ATTRIBUTES": [:], "answer": ["!ATTRIBUTES": [:], 
"!CHARDATA": "Discriminate"], "clue": ["!ATTRIBUTES": [:], "!CHARDATA": 
"Show perceptive judgment"]]], "puzzle": ["!ATTRIBUTES": ["level": 
"Intermediate"], "title": ["!ATTRIBUTES": [:], "!CHARDATA": "Hot Ideas"], 
"entry": ["!ATTRIBUTES": [:], "answer": ["!ATTRIBUTES": [:], "!CHARDATA": 
"per"], "clue": ["!ATTRIBUTES": [:], "!CHARDATA": "for each"]]]]]]

Needless to say, parsing it can be a challenge. I'll post some code 
tomorrow that I'm working on so you can see one way of traversing the tree 
(and so others like Jakob can suggest better ways :-)

Cordially,
Kerry Thompson
Learning Network


[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