Re: How to parse an XML document
| From: | Manuel Lemos | Date: | Sun, 23 Dec 2001 18:46:38 +0000 |
| Subject: | Re: How to parse an XML document | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-78618@lists.php.net to get a copy of this message | ||
Hello,
Php Rules wrote:
>
> Hi fellas.
>
> I would like to know the way to parse an XML document.
>
> I come from Java world, and you can handle an XML document,
> and
> then show it as an HTML page.
>
> I suppose that it's also possible by using PHP, isn't it?
>
> I would like also to know if it's available in the 'standard
> installation' of PHP. I mean, I want to develop this on a
> remote
> server. It uses PHP, and I suppose that it's not installated
> any
> extra module, so I wonder if the XML parsing needs any extra
> module
> or not.
PHP comes built in support for parsing XML documents with James Clark
Expat parser and also GNOME DOM XML parser.
I used Expat support for bulding this generic parser class that puts all
tags and data in a single associative array indexed by they path name
encoded in a single string.
http://phpclasses.upperdesign.com/browse.html/package/4
In the same site you may also find many other classes for processing and
generating XML:
http://phpclasses.upperdesign.com/browse.html/class/4
If you came from the Java world, you will appreciate the whole site
because it is a repository from OOP classes of objects written in PHP:
http://phpclasses.upperdesign.com/browse.html
And also this mailing list that is meant for discussing OOP in PHP. It
was started just a few days ago, but it already has almost 200
subscribers. Here you may find answers for you OOP with PHP questions.
http://groups.yahoo.com/group/php-objects/
Regards,
Manuel Lemos