Re: Handling XML output in a slim way

From: Date: Thu, 02 Sep 2004 01:17:57 +0000
Subject: Re: Handling XML output in a slim way
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-195493@lists.php.net to get a copy of this message
Markus Fischer wrote:
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. If it's not broken don't fix it. If what you are doing right now works stick with it because it consumes very little memory or CPU compared to DOM functions.
-- Raditha Dissanayake. ------------------------------------------------------------------------ http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar.

« previous php.general (#195493) next »