XML Parsing, starting out.
| From: | sinai at simnet dot is | Date: | Sat, 29 Apr 2006 16:19:10 +0000 |
| Subject: | XML Parsing, starting out. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-235100@lists.php.net to get a copy of this message | ||
Hello, 1st msg here so im excited what results i will get :)
Im a novice with php parsing and have been able to help myself quite well with what ive needed with
xml_parse_into_struct and then echoing the fixed variable names but now im dealing with an xml
document that is 1st quite large and 2nd changing gradually over time with either added data or
changed information. (But not in large numbers)
http://www.camelotherald.com/xml/spells-si.xml
It is a spell listing for an online mmorpg. It has a "spell_list" that captures all other
tags and a "spell_line" for each spell line. Within each spell line is a "spell"
which has the detailed info for each spell with in the "spell_line"
I could parse this by echoing the fixed variables but due to its size and the changes done over time
its just to much work. This is why i come to a stop. Ive read some guides and tried some example
code that should help me through this.
What i hoped to get is an example with the xml i provided so i could work with it to complete the
project.
The example could look something like this:
Header with the selected "spell_line" name ie. "Calefaction" and below that the
spell info in some dummy table format. Then the next "spell_line" which is "Path of
Earth" then with the spell info in some dummy table setup.
Thanks for reading and i hope someone can show me the light of a real xml parse.