Re: Handling XML output in a slim way
| From: | Torsten Roehr | Date: | Wed, 01 Sep 2004 16:00:44 +0000 |
| Subject: | Re: Handling XML output in a slim way | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-195414@lists.php.net to get a copy of this message | ||
"Markus Fischer" <markus@fischer.name> wrote in message
news:20040901143628.41572.qmail@pb1.pair.com...
> Hi,
>
> up until now, when outputing XML I've been constructing the output as a
continous string-soup in such ways like
>
> [...]
> $xml .= printf('<item name="%s">%s</item>', makeXmlSave($name),
makexmlSave($contentOfItem));
> [...]
>
> makeXmlSave() makes sure that quotes, ampersand, < and > are properly
escaped with their entity reference. However I was thinking if it wasn't
possible to e.g. generated a a complete DOM tree first and then just having
this tree being dumped as XML.
>
> I'm using PHP4 right now.
>
> thanks,
> - Markus
>
Hi Markus,
take a look at this package:
http://pear.php.net/package/XML_Tree
Regards, Torsten Roehr