XML/XPath: Difference between revisions

261 bytes removed ,  12 years ago
Line 75:
set {theName, theAttributes, theElements} to {i's name, {}, i's XML elements}
try
set theValue to i's value -- For some reason this won't error if i's value is "undefined".
set theValue to theValue -- But this will error if i's value is undefined. Go figure.
on error
set theValue to null
Line 87:
end tell
if (count of theElements) > 0 then
--set end of R to my getXMLElementsByName(theElements, theNameToFind)
set R to R & my getXMLElementsByName(theElements, theNameToFind)
else
--if theName = theNameToFind then set end of R to theValue
if theName = theNameToFind then set R to R & theValue
end if
Anonymous user