Helpful Information
Category: Programming Languages More
Parsing XML

Hi, i'm using the PHP code form melonfire at :

My question is :
So far, my xml code has been in the form like
<title>The Hobbit</title>

and everything seems fine.

But i'm wondering if its also possible to have the xml code like
<title="The Hobbit" Pages="359" />

Would it be possible to parse XML with php when the XML code is like the second example??if so what would I have to change in the PHP code?


<title="The Hobbit" Pages="359" />

wouldn't/shouldn't be valid, but say
<book title="The Hobbit" Pages="359" />
would. As for using this method is php search the docs for whatever xml parser your using for "attributes". Which is what they are.