Re: Returning a specific 'record' from an XML file
| From: | Emile Bosch | Date: | Wed, 19 Sep 2001 13:06:33 +0000 |
| Subject: | Re: Returning a specific 'record' from an XML file | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-67836@lists.php.net to get a copy of this message | ||
uhm i think XMLSLT sabletron thingie is the solution, it makes it possible
to get records as u so call it from an XML file. It works pretty good as far
as i know..!
Good luck!
Emile Bosch
Stefen Lars <stefenlars@hotmail.com> schreef in berichtnieuws
LAW2-F58iFf7eAhWFFG000096ff@hotmail.com...
> 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
>