PHP
  Home arrow PHP arrow Inserting Comments and Accessing Nodes with the DOM XML Extension in PHP 5
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
PHP

Inserting Comments and Accessing Nodes with the DOM XML Extension in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 3
    2008-03-11


    Table of Contents:
  • Inserting Comments and Accessing Nodes with the DOM XML Extension in PHP 5
  • Reviewing how to insert attributes and CDATA nodes with the DOM XML library
  • Appending comment nodes to a given XML document
  • Accessing XML nodes by their ID attribute

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Inserting Comments and Accessing Nodes with the DOM XML Extension in PHP 5
    ( Page 1 of 4 )

    Welcome to the third chapter of the series “A quick overview of the DOM XML extension in PHP 5.” As the article’s title suggests, this series walks you through using the most relevant methods that come packaged with this powerful XML-related PHP extension to perform specific operations on XML documents by using the API of the Document Object Model.

    When it comes to working with XML documents, PHP really shines. It provides web developers with a bunch of thorough extensions aimed at facilitating the manipulation of XML data in all sorts of clever ways. This includes the always popular “simpleXML” library and one that actually is the primary subject of this series of articles. In this case, I’m talking about the DOM XML extension, which allows you to handle XML documents by using the DOM API. Thus, if you’re interested in learning how to put this extension to work for you quickly, look no further, because you’ve come to the right place.

    Now that I've introduced you to the main subject of this series, I think it’s time to rehash some of the most relevant topics that were treated in the preceding article of the series. Well, as you’ll possibly recall, in the last tutorial I explained how to utilize the “createAttribute()” and “createCDATASection()” methods, which are bundled with the DOM XML extension, to insert attributes and CDATA nodes into an existing XML document.

    Since these methods offer an easy learning curve, I assume that you shouldn’t have major difficulties understanding how they can be used to aggregate certain attributes and create CDATA sections within a string of XML data.

    The DOM XML library has many other useful methods, aside from the ones I've already mentioned, which can be utilized to insert different types of nodes into a given XML document. What’s more, the extension allows you to access specific elements within the document tree by using their corresponding ID attributes. Therefore, in this third installment of the series, I’ll be teaching you specifically how to append comment nodes to a given XML string and how to extract certain elements via their IDs.

    Having already outlined the subject of this tutorial, let’s learn how to perform the aforementioned tasks with the API provided by the DOM XML extension. Let’s get going!



     
     
    >>> More PHP Articles          >>> More By Alejandro Gervasio
     

       

    PHP ARTICLES

    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL
    - Method Chaining: Adding More Methods to the ...
    - Method Chaining in PHP 5





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek