News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Builder.com:
Dynamic XML document construction with the PHP DOM
December 11, 2006 @ 11:05:00

Builder.com as posted a quick tutorial on working with the DOM functionality in PHP to create a dynamic XML document (Doctype and all).

Over the course of this article, I'll be introducing you to the main functions in this API, showing you how to programmatically generate a complete well-formed XML document from scratch and save it to disk.

They start off with creating the Doctype declaration before actually adding the content into the file (elements and text nodes), adding some attributes to the nodes, putting CDATA blocks inside them, and pushing out the results on the other side to be saved to a local "order.xml" file.

You can also download this article if you'd like to work with it (and its included PHP files) on your own.

0 comments voice your opinion now!
xml dom dynamic document create attribute node doctype cdata xml dom dynamic document create attribute node doctype cdata


blog comments powered by Disqus

Similar Posts

Greg Beaver's Blog: PhpDocumentor 1.3.0 stable is released

Christopher Jones' Blog: New PDO_OCI Attributes

PHPBuilder.com: Using XML - A PHP Developer\'s Primer, Part 4 (Subpart 2)

Enrico Zimuel's Blog: XML to JSON in PHP: an odyssey

Michelangelo van Dam's Blog: Mapping Seven Things


Community Events





Don't see your event here?
Let us know!


bugfix symfony list zendserver framework series threedevsandamaybe code conference language podcast tips deployment laravel voicesoftheelephpant release interview community introduction api

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework