...without knowing their tagnames? I'm trying to build a script that will return the data of a generic XML file. The catch is that the contents will be unknown, all that we know is that it is a valid XML file. So, for example lets say we have a simple xml file like so:
<XML HEADER>
<unknowntagname>
<unknowntagname>some data</unknowntagname>
<unknowntagname>some data</unknowntagname>
<unknowntagname>some data</unknowntagname>
</message>
the JavaScript or PHP will then store the data in an object like this:
unknowntagname[x].content;
normally you would use the getElementsByTagname(sometag) method, but we don't know the tag name.
any suggestions?
The catch is that it must be a web based language, Java is a capable of going on the web, but It would be much better if I could just have it done on a web language.
<XML HEADER>
<unknowntagname>
<unknowntagname>some data</unknowntagname>
<unknowntagname>some data</unknowntagname>
<unknowntagname>some data</unknowntagname>
</message>
the JavaScript or PHP will then store the data in an object like this:
unknowntagname[x].content;
normally you would use the getElementsByTagname(sometag) method, but we don't know the tag name.
any suggestions?
The catch is that it must be a web based language, Java is a capable of going on the web, but It would be much better if I could just have it done on a web language.