Applescript XML Help

I can post more detail if necessary for this. I have an xml file with where i am trying to read multiple values out of the file. I am trying to grab only “Tom Novy” at this point



set testValue to XML contents of item 1 of getelements(parse XML item 1 of the_array, "performer")
return testValue


on getelements(theXML, theElementName)
	-- find and return all instatnces of a particular element
	
	local theResult
	
	set theResult to {}
	repeat with anElement in XML contents of theXML
		if class of anElement is XML element and ¬
			XML tag of anElement is theElementName then
			set end of theResult to contents of anElement
		end if
	end repeat
	
	return theResult as list
end getelements


The current return from the script is:

{{class:XML element, XML tag:“name”, XML contents:{“Tom Novy”}}}

Item 1 of the_array is the following:

“<track isSelected="false" time="07:38" url="http://geo-samples.beatport.com/lofi/67331.LOFI.mp3\” id="67331" stream="mp3:lofi_samples/items/volumes/volume5/items/0/0/60000/7000/300/30/67331.LOFI">
Your Body
your-body-andy-van-remix
Andy Van Remix
$1.99
$1.99
€1.56
£1.30

2005-11-15
1
07:38
128


A


minor


3,10,45
<image url="http://geo-media.beatport.com/image/2449666.png\" width="1500" height="250" ref="trackWaveForm"/>
<image url="http://geo-media.beatport.com/image/8179.jpg\" width="60" height="60" ref="release"/>
<image url="http://geo-media.beatport.com/image/23903.jpg\" width="30" height="30" ref="release"/>
<image url="http://geo-media.beatport.com/image/37438.jpg\" width="592" height="96" ref="label"/>
<image url="http://geo-media.beatport.com/image/487322.jpg\" width="592" height="96" ref="label"/>
<image url="http://geo-media.beatport.com/image/3261580.jpg\" width="30" height="30" ref="label"/>
<image url="http://geo-media.beatport.com/image/3261581.jpg\" width="60" height="60" ref="label"/>
<image url="http://geo-media.beatport.com/image/3261582.jpg\" width="500" height="500" ref="label"/>
<image url="http://geo-media.beatport.com/image/491533.jpg\" width="60" height="60" ref="default"/>
<image url="http://geo-media.beatport.com/image/491534.jpg\" width="30" height="30" ref="default"/>
<image url="http://geo-media.beatport.com/image/5245821.jpg\" width="500" height="500" ref="default"/>
<fulfillment type="purchase"/>
<currentStatus id="5">
Classic

<release id="14343" exclusive="false">
Your Body

<label id="907">
Ultra

<genre id="5">
House

<performer ref="Artist" id="4575">
Tom Novy

<performer ref="Remixer" id="7735">
Andy Van

"

Model: iMac
Browser: Safari 534.55.3
Operating System: Mac OS X (10.7)

I solved it :smiley:


return XML contents of getelementvalue(item 1 of getelements(parse XML item 1 of the_array, "performer"), "name")