Jump to content

XML/XPath: Difference between revisions

11 bytes removed ,  12 years ago
Line 70:
''AppleScript has no-built in support for XPath, but it could be used via a 'do shell script' command. Here's a solution using Apple System Events.
 
Unfortunately, System Events cannot accomplish the first goal, but it's canXML beSuite can usedhelp to accomplish the final two:''
 
<lang AppleScript>on getElementsByName(theElement, theNameToFind)
Line 76:
repeat with i in theElement
tell application "System Events"
set {theName, theAttributes, theElements} to {i's name, {}, i's XML elements}
try
set theValue to i's value
Line 125:
return my getElementsByName(xmlData's contents, "price")
--> {"14.50", "23.99", "4.95", "3.56"}
end</lang>
</lang>
 
=={{header|C sharp}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.