Here's a sample of what I want..
--- the xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http:// www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>keyname</key> <integer>8</integer> <key>creation</key> <string>2007:06:12 20:13:52</string> <key>happy</key> </false> </dict> </plist>
How do I I search for "creation" and return the string value?
How to I search for "happy" and return "false"?
Thanks in advance..
Wayne, If that's all you want, and it's not unusual to want to pull just one or two values from an xml file, here's a quick way to do it.
set text item delimiters to "<key>creation</key>" set creationDate to text item 2 of myText set text item delimiters to "<string>" set creationDate to text item 2 of creationDate set text item delimiters to "</string>" set creationDate to text item 1 of creationDate set text item delimiters to "<key>happy</key>" set happyValue to text item 2 of myText set text item delimiters to "</" set happyValue to text item 2 of happyValue set text item delimiters to ">" set happyValue to text item 1 of happyValue
return {creationDate, happyValue}
HTH
ES =
|