I have encountered something with the parse I am not really sure how to fix.
The suggestion by Endless works great but with one exception. The format of xml is like below, you will notice the number of "display-name" elements can vary from video id to video id.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE my SYSTEM "xmlmy.dtd">
<video id="I4.28458309">
<display-name>4 XXXX</display-name>
<display-name>4</display-name>
<display-name>XXXX</display-name>
<display-name>MY VIDEO</display-name>
</video>
<video id="I4.3254785">
<display-name>5 UUUU</display-name>
<display-name>5</display-name>
<display-name>UUUU</display-name>
<display-name>5U5U5U</display-name>
<display-name>ANOTHER VIDEO</display-name>
</video>
I am using something like the following to extract the values.
nameElements = xml.getNamedElements("display-name")
for i = 0 to xml.video.count()-1
videoinfo={
name: nameElements[i].gettext()
End for
This works but it gathers all the values for all the nameElements. I am only interested in the first value for the first "display-name". Because the number of "display-name" elements vary I have been unable to exact only this value. I have tried numerous ways to narrow the parse but have not been successful because the first instance of "display-name" in video id does not occur in any specific location. Any ideas? A second parse maybe?