19 lines
750 B
Plaintext
19 lines
750 B
Plaintext
q = QUOTE
|
|
r = RETURN
|
|
xml = "<Students>"&r&\
|
|
" <Student Name="&q&"April"&q&" Gender="&q&"F"&q&" DateOfBirth="&q&"1989-01-02"&q&" />"&r&\
|
|
" <Student Name="&q&"Bob"&q&" Gender="&q&"M"&q&" DateOfBirth="&q&"1990-03-04"&q&" />"&r&\
|
|
" <Student Name="&q&"Chad"&q&" Gender="&q&"M"&q&" DateOfBirth="&q&"1991-05-06"&q&" />"&r&\
|
|
" <Student Name="&q&"Dave"&q&" Gender="&q&"M"&q&" DateOfBirth="&q&"1992-07-08"&q&">"&r&\
|
|
" <Pet Type="&q&"dog"&q&" Name="&q&"Rover"&q&" />"&r&\
|
|
" </Student>"&r&\
|
|
" <Student DateOfBirth="&q&"1993-09-10"&q&" Gender="&q&"F"&q&" Name="&q&"Émily"&q&" />"&r&\
|
|
"</Students>"
|
|
|
|
parser = xtra("xmlparser").new()
|
|
parser.parseString(xml)
|
|
res = parser.makePropList()
|
|
repeat with c in res.child
|
|
put c.attributes.name
|
|
end repeat
|