Hello all

I am looking for a PHP example or tutorial that shows how it is possible to 
return one particular record (is that the correct terminology for an XML 
file?) from an XML file. For example, consider this very simple XML file:

<?xml version="1.0"?>

<library>
        <book>
                <title>Hannibal</title>
                <author>Thomas Harris</author>
                <genre>Suspense</genre>
                <pages>564</pages>
                <price>8.99</price>
                <rating>4</rating>
        </book>
        <book>
                <title>Run</title>
                <author>Douglas E. Winter</author>
                <genre>Thriller</genre>
                <pages>390</pages>
                <price>7.49</price>
                <rating>5</rating>
        </book>
        <book>
                <title>Hannibal - the return</title>
                <author>Thomas Harris</author>
                <genre>Suspense</genre>
                <pages>586</pages>
                <price>21.12</price>
                <rating>10</rating>
        </book>
</library>

I would like to be able to say, give me all the data from books written by 
author 'Thomas Harris'. In this case, I would be returned with the first and 
last 'record' from the above file. It would then be possible to loop through 
the resulting array like one can do with mysql_fetch_array and co.

I know that to perform such a query in MySQL is a piece of cake, but I am 
currently interested in learning a little more about XML handling.

If someone could point me in the correct direction to learn how do this, I 
would be very grateful.

Also, if anyone thinks that using XML for such an application is completely 
wrong, please also say that.

Thank you in advance

/S

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to