Problem:
I am to build a web-based tool in PHP to help users access information scattered across a collection of XML files that I plan to store data from into tables in MySQL. A lot of examples I see online seem to be based on importing data from a bunch of XML files that all use the same formatting. I do not have that luxury.
How would I be able to parse through XML files that have the following factors?
- There are multiple categories of XML files in this collection, each having separate formats and types of information that differentiate each category. Ideally, I would create a separate table for each category. However...
- Additional new categories of XML files could be added to this collection without my knowledge ahead of time.
- Any existing category could have its format restructured and/or the types of information within could be increased or decreased, also without my knowledge ahead of time.
- Even among the same category of XML files, there can be older files that have an outdated formatting version.
Expected Results:
Using an example where the collection of XML is about a group of people, if you search for "brown eyes", you get search results listing pages for everyone listed with brown eyes. One of the pages is "Robert". If you click this result, you'll go to a page where all the information from Robert's XML file is displayed (readable formatting to be handled later).