My question is about parsing xml with php. Although I understand some basics of php, please take into account that my understanding is very limited.
This is an example of the XML structure that I’m working with:
<XML_DATA item=“Beatles”>
<People>
<Person Firstname=“George” Lastname=“Harrison” Instrument=“Guitar”>Harrison, George</Person>
<Person Firstname=“John” Lastname=“Lennon” Instrument=“Guitar”>Lennon, John</Person>
<Person Firstname=“Paul” Lastname=“McCartney” Instrument=“Bass”>McCartney, Paul</Person>
<Person Firstname=“Ringo” Lastname=“Starr” Instrument=“Drums”>Starr, Ringo</Person>
</People>
</XML_DATA>
This is what I need to do with this data:
- Populate each Person into a table on an index page, displaying their Firstname and Lastname.
- For each Person, a page would be generated. On that page, Firstname, Lastname, and Instrument would be displayed.
- On the table on the index page, each Person’s Firstname/Lastname would be wrapped in an anchor tag, linking to their corresponding page.
How would I go about doing this?
I appreciate your help, thank-you.