I have been given an assignment where i am given an XML file and i need to parse it. The XML is in the following format:
- Code: Select all
<name>Harry Potter and the Philosopher's Stone</name>
<name>Harry Potter and the Chamber of Secrets</name>
The problem i have is when i try an parse this XML, with SimpleXML, i get the following error
parser error : Extra content at the end of the document
The source of this error is due to there being no root node.
This has left me in a bit of a predicament. Is there anyway of parsing XML in this format without the root node being added?