PHP
  Home arrow PHP arrow Introducing SimpleXML 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? 
PHP

Introducing SimpleXML in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 40
    2006-06-12


    Table of Contents:
  • Introducing SimpleXML in PHP 5
  • Reading XML files with the “simplexml_load_file()” function
  • Accessing file nodes as array elements
  • Creating a basic XML parsing class

  • 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


    Introducing SimpleXML in PHP 5
    ( Page 1 of 4 )

    In the first article of a three-part series, you will learn the basics of using the “simplexml” extension that comes with PHP 5. This library is primarily focused on parsing simple XML files, and can save you a lot of work.

    Introduction

    For those of you who have been using PHP 5 for a while, the numerous improvements introduced into the Zend engine have brought significant advantages that help to accelerate the development of Web applications. Intermediate and experienced developers probably will tell you nice things about the new object model, and the implementation of exceptions, in addition to the set of functions aimed at processing XML data in different ways. And of course, the list of new features goes on and on.

    However, recently I discovered a little jewel hidden behind the tons of big improvements that come with PHP 5: a small and powerful library called “simpleXML.” Indeed, if you’re currently working on a project that requires handling XML data in a basic manner, this extension might eventually suit your needs, without your having to develop a full-featured XML parser.

    Definitely, one of the best things about “simpleXML” is how easily it performs  basic tasks, such as reading XML files, extracting data from XML strings, comparing and replacing nodes, and so forth. Based on this simplicity, you can develop a decent XML parsing application without having to make a huge effort, or even combine all these cool features with the functionality of AJAX, in order to construct a full-fledged application that uses the best of client and server-based scripting languages.

    In response to all the exciting features that I mentioned before, in this three-part series I’ll be taking a close look at the most important functions of the “simpleXML” extension, using numerous code samples and clear explanations to put them in context, so you can understand how they work.

    At the end of the series, you should be equipped with the proper background to start using “simpleXML” in your own PHP 5 applications.

    Having now defined the goals of this series, let’s find out together how to use the “simpleXML” library with PHP 5. Let’s get going!



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

       

    PHP ARTICLES

    - 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
    - The Role of Interfaces in Applying the Depen...
    - Dependency Injection: Using a Setter Method ...
    - Using a Model Class with the Dependency Inje...
    - Injecting Objects Using Setter Methods with ...
    - Injecting Objects by Constructor with the De...
    - The Dependency Injection Design Pattern in P...
    - Performing Inferential Statistical Analysis ...
    - Performing Descriptive Statistical Analysis ...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    Stay green...Green IT