I don't usually have to do any backend stuff, but for this one project I have to parse XML using PHP so it's all kind of new and very complicated to me. I need to display the fourth tag on a page and I figured I would use getElementsByTagName but the trouble is the three previous tags are the same, so it looks something like this:
<Person fname="John" lname="Smith"/>
<Person fname="Frank" lname="Jones"/>
<Person fname="Mike" lname="Jackson"/>
<Person fname="Jack" lname="Williams"/>
<value no="50"/>
<value no="60"/>
<value no="70"/>
Here is what I would like to output in my HTML page using the first attribute in the fourth tag and the attribute in the second tag:
Mike: 60
Basically, is there any way I can request the value of the attribute in the fourth tag regardless of what the tag is or what comes before or after it?
Any help would be appreciated -- thanks!
Edit - I didn't write the XML, I request from a remote server.