PHP
  Home arrow PHP arrow Parsing XML With DOMXML And PHP
IBM developerWorks
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Actuate Whitepapers 
VeriSign Whitepapers 
IBM® developerWorks 
Sun Developer Network 
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

Parsing XML With DOMXML And PHP
By: Mitchell Harper
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 16
    2002-01-10

    Table of Contents:
  • Parsing XML With DOMXML And PHP
  • What is the DOMXML parsing method?
  • Parsing a simple XML document
  • Parsing Example 2
  • Putting our DOMXML knowledge to good use
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb 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
     
    Iron Speed
     
    ADVERTISEMENT

    At the virtual BlackBerry Technical Seminar 2008, you can ask your development questions directly of Research In Motion® (RIM) experts, and take advantage of learning opportunities designed uniquely for BlackBerry solution developers. Register Today!

    Parsing XML With DOMXML And PHP


    (Page 1 of 6 )

    Extensible Mark-up Language (XML) has just about made its impression everywhere: B2B, B2C, as a replacement for .INI files, to aid with data abstraction and transportation, etc. In this article Mitchell shows us how to use the DOMXML library to parse and extract data from both local and remote XML files with PHP.Extensible Mark-up Language (XML) has just about made its impression everywhere: B2B, B2C, as a replacement for .INI files, to aid with data abstraction and transportation, etc. There are a huge number of companies that offer some sort of content over the web in the form of XML, such as news headlines, weather conditions, traffic reports, etc.

    When we're talking about data manipulation and implementation with a reference to PHP, most people will automatically assume some sort of interaction with a MySQL database. MySQL has become synonymous with PHP, just like Oracle has become synonymous with Java. MySQL is great, but we can make our data more readily available over the web in the form of XML.

    Two benefits of transporting data across the web in the format of XML spring into mind: its cross-platform availability, and its language-neutral syntax: as long as an XML document is available for download from a web site or FTP server, we can parse that document through PHP and then do whatever we like (subject to copyright laws) with that data.

    In this article I'm going to give you the 101 on how to parse XML documents using the DOMXML library in PHP. I will discuss setting up the XML parser, loading and parsing documents. Once we've covered enough solid ground, I will show you how to implement a real-time XML feed from devArticles.com, which you can then use on your site.

    To get the most out of this article and its coding samples, you should be running a Windows/Linux/Unix web server with the latest version of Apache installed. You can download Apache for Windows, Linux and Unix for free from http://apache.org.

    Because this article describes how to actually parse XML documents and not what XML is, you should have a fairly substantial knowledge of the XML language syntax already (If you don’t, then refer to some of the books at the end of this article). You should also be proficient with PHP.

    More PHP Articles
    More By Mitchell Harper


     

    PHP ARTICLES

    - Making Usage Statistics in PHP
    - Installing PHP under Windows: Further Config...
    - File Version Management in PHP
    - Statistical View of Data in a Clustered Bar ...
    - Creating a Multi-File Upload Script in PHP
    - Executing Microsoft SQL Server Stored Proced...
    - Code 10x More Efficiently Using Data Access ...
    - A Few Tips for Speeding Up PHP Code
    - The Modular Web Page
    - Quick E-Commerce with PHP and PayPal
    - Regression Testing With JMeter
    - Building an Iterator with PHP
    - PHP Frontend to ImageMagick
    - Using PEAR's mimeDecode Module
    - Incoming Mail and PHP


    Iron Speed





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway