News Feed
Sections




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

PHPBuilder.com:
Parsing XML with the DOM Extension for PHP 5
October 28, 2010 @ 14:47:56

On PHPBuilder.com there's a new tutorial from Octavia Anghel about using the DOM extension to parse XML in a PHP5 application. The DOM functionality makes it simpler than even the older PHP4 DOM functionality to work with XML messaging and documents.

DOM (Document Object Model) is a W3C standard based on a set of interfaces, which can be used to represent an XML or HTML document as a tree of objects. A DOM tree defines the logical structure of documents and the way a document is accessed and manipulated. Using DOM, developers create and build XML or HTML documents, navigate their structures, and add, modify, or delete elements and content. The DOM can be used with any programming language, but in this article we will use the DOM extension for PHP 5. This extension is part of the PHP core and doesn't need any installation.

They include both a sample XML file to parse and the code you'll need to pull it in and make a basic DOM object out of it. Also included is some code showing how to pull out certain pieces of information, recurse through a set of XML values, add new nodes to the structure, remove a node and more.

0 comments voice your opinion now!
parse xml dom extension tutorial


blog comments powered by Disqus

Similar Posts

Pear-Code-Authors.com: Installation of a local PEAR copy on a shared host

PHPRiot.com: Monitoring File Uploads using Ajax and PHP

SitePoint PHP Blog: Push your Drupal Site’s Events to your Phone with Pushover

Limitless Studios: Determine Number Of Online Users Without A Database

PHPMaster.com: Implementing a Unit of Work - Handling Domain Objects through a Transactional Model


Community Events

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


php7 laravel community voicesoftheelephpant interview unittest wordpress framework release opinion list extension library laravel5 api language podcast version introduction series

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