Anonymous user
XML/XPath: Difference between revisions
→{{header|AppleScript}}
Line 72:
Unfortunately, System Events cannot accomplish the first goal, but it can be used to accomplish the final two:''
<lang AppleScript>on
set R to {}
repeat with i in theElement
Line 82:
on error
set theValue to null
end try
end tell
if (count of theElements) > 0 then set R to R & my
if theName = theNameToFind then set R to R & theValue
end repeat
return R
end getElementsByName
set theXMLdata to "<inventory title=\"OmniCorp Store #45x10^3\">
Line 125 ⟶ 120:
set xmlData to make new XML data with properties {name:"xmldata", text:theXMLdata}
return my
--> {"Invisibility Cream", "Levitation Salve", "Blork and Freen Instameal", "Grob winglets"}
return my
--> {"14.50", "23.99", "4.95", "3.56"}
end
|