I am currently trying to build a system that parses complex XML. The parser is actually already built, and functions thusly…
The XML is read via DOMDocument->DOMXpath
As the XML is traversed, the parser drills down to the children of the root node. It grabs the text from there using nodeValue.
The parser then checks for the presence of the nodeValue in a numerical array (non-associative) which the parser created from a DB table column using standard SQL and PHP foreach.
If the nodeValue is indeed present in the array, it proceeds to drill down further into that node to parse the required information.
Now, I am in the process of moving this all over into the Yii application I have created, and I need advice on how to do this. So, some quickfire questions: -
Should the parser itself be a Yii application component?
I have modelled the table the numerical array is taken from. How is it best to create an array from this for checking the presence of the nodeValue?
BTW this is going to be run at least in the meantime via WebApplication, not the Console. So I have that thought through in case anyone was going to mention it.
Any help greatly appreciated!