RE: [PEAR] Re: Converting XML into something PHP like....
| From: | Nunners | Date: | Tue, 20 Apr 2004 10:45:17 +0000 |
| Subject: | RE: [PEAR] Re: Converting XML into something PHP like.... | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-11967@lists.php.net to get a copy of this message | ||
Thanks for the info Tobias... I've finally got somewhere!!!
I've now got an echo of the array dump of the XML file - which I hadn't up
to now! However, that's of a static file, saved on the server. How do I do
it so that I can get an external source.... again I'm guessing a PEAR
package is useful here, and I've tried using HTTP_REQUEST.... is that
correct...
Oh... and the next step will be it needs to be cached, to save on download
time - any help with that would be great :) :) :) :)
Here's the code so far...:
require_once 'XML/Unserializer.php';
$options = array(
"parseAttributes" => true,
"attributesArray" => false
);
$unserializer = &new XML_Unserializer($options);
$status = $unserializer->unserialize('test.xml', true);
if (PEAR::isError($status)) {
echo "Error: " . $status->getMessage();
} else {
$data = $unserializer->getUnserializedData();
echo "<pre>";
print_r( $data );
echo "</pre>";
}
Cheers
Nunners
> -----Original Message-----
> From: news [mailto:news@sea.gmane.org] On Behalf Of Tobias Nix
> Sent: 20 April 2004 11:33
> To: pear-general@lists.php.net
> Subject: [PEAR] Re: Converting XML into something PHP like....
>
> Hello,
>
> > Looking around, and from previous experience, I'm trying to use PEAR....
> Can
> > someone give me an idea which package I need to use, as most of them
> seem
> > only to deal with XML outwards, not inwards - if that makes sense?!?!?!
>
> You can use http://pear.php.net/package/XML_Serializer
> Here are some nice examples
> http://cvs.php.net/cvs.php/pear/XML_Serializer/examples
> And the docs
> http://pear.php.net/manual/en/package.xml.xml-serializer.php
>
> regards, tobias.
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>