PDA

View Full Version : Paring an online XML document - help


Kayvz
06-22-2003, 12:40 AM
Okay, so i have this file:
http://www.teamwarfare.com/xml/viewteam_v2.asp?team=%2D+A+E+T+H+E+R+%2D

What i want to do is get some of this information onto my website. For example, if i wanted to get this pece of information:
" <match status="Attacking"> "
What i'm interested in is getting the "attacking" to show up on my page. What i have a question about is how i should go about doing this.
My idea was to use a data island.
Specific the filename " http://www.teamwarfare.com/xml/viewteam_v2.asp?team=%2D+A+E+T+H+E+R+%2D "

Then my line throughout my page where i want that information to appear:
datasrc="#TWL" datafld="status"
This is assuming i wanted to name the island "TWL".
However i don't know how to name the area either. Would it be "match status", or "match", or "status". Even assuming it is one of these, there are multiple "match" and "status" elements in the file. Basically i have not a clue what to do with this, i'd appreciate any help :)

sicarius
06-22-2003, 12:29 PM
Well, depending on your file you could use XPath to query the file. Just use whatever you use to read in the file, and then use XPath.

This is relatively easy in PHP, not sure about other web languages. Most will have built in XML parsing ability, and also XPath.