Re: modify an XML file
| From: | Raditha Dissanayake | Date: | Sun, 01 Feb 2004 16:12:47 +0000 |
| Subject: | Re: modify an XML file | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-176507@lists.php.net to get a copy of this message | ||
Decapode Azur wrote:
hello! Hi there.
What is the best solution to modify an XML file? depends
(Modification such as change the content of a tag or of an attribute) I think there would be several methods. you said it.
What is the best one for small files? (something about 20Ko) DOM (if you don't mind the API)
What is the best one for large files? (something about 8Mo) Parse with SAX, use printf to produce output. If you are not worried about scalability you can still use DOM.
What should be the weight limit of an XML file which have to be parsed through PHP? If you use SAX there wouldn't be an upper limit (at least theorectically) i have parsed the odp dump using the sax parser functions available in PHP and that's several hundred megabytes.
-- 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 150 KB | with progress bar.