I am trying to parse out an XML file, but the file itself is not well formed. Here is an example snippet.
<root> <book id="foo"> <chapter id="1"> <sentence id="1" />This is the 'CDATA' that I need.. <sentence id="2" />Another sentence example... </chapter> </book> </root>
I need to pull out the data from the sentence, but it isn't wrapped in <sentence>data</sentence> format. The sentence element is closed immediately.
I know this is a bit of an XML question, but I can't change the XML, I have to parse it as it is, and I'm using PHP to do it.
Any help is greatly appreciated. I don't have the code I've got in front of me, but it isn't much anyway, and I'm really just looking for direction.