Here is the xml parsing code I have used from another post on this website:
set seriesResults to {}
tell application "System Events"
tell XML element "Data" of contents of XML file seriesSearchFile
repeat with thisElement from 1 to (count of XML elements)
set seriesID to (value of (XML elements whose name is "seriesid") of XML element thisElement) as string
set seriesName to (value of (XML elements whose name is "SeriesName") of XML element thisElement) as string
set overview to (value of (XML elements whose name is "Overview") of XML element thisElement) as string
set firstAired to (value of (XML elements whose name is "FirstAired") of XML element thisElement) as string
set end of seriesResults to {seriesID, seriesName, overview, firstAired}
end repeat
end tell
end tell
The first bracketed thing is Data, and then there are several bracketed each with the same tags but different info. I am trying to get all of this into a list, pulling the 4 things I need from each series. So the final list of lists would be {{seriesID_1, seriesName_1, overview_1, firstAired_1}, {seriesID_2… and so on. But every time I run it is points to the line that says
set end of seriesResults to {seriesID, seriesName, overview, firstAired}
and depending on how I play around with the code says that seriesResults is not defined or seriesID or one of the others. But like this it says that seriesResults is not defined. What’s going on here? Is there a better way to parse the xml file with this format WITHOUT using 3rd part add-ons? (I want to be able to move the application between computers without downloading anything else). Thanks.