WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Submit Site
Forex Trading Online forex trading platform

Go Back Add a Comment Send this Article to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES SUBMIT AN ARTICLE PRINT
Title : Parsing XML With DOMXML And PHP
Categories : XML, PHP
devarticles
devarticles
Date : 2002-01-11
Grade : 0 of 5 (graded 0 times)
Viewed : 5490
Search : More Articles by devarticles
Action : Grade This Article
Tools : My Favotite Articles


  Submit your own code examples 
 


Introduction

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.

Read More...









Data, its presentation and user interface forms
Categories : PHP, XML, User Interface
Building XML Web Services with PHP NuSOAP
Categories : PHP, NuSOAP, XML
PHP 101 Part 11 of 15 : Sinfully Simple
Categories : PHP, SimpleXML, XML
Serializing XML With PHP
Categories : PHP, XML, Serialize
More PHP, XML and XSL for Wireless Content
Categories : PHP, XML, XSL, Wireless
Building a Generic RSS Class With PHP
Categories : PHP, XML, Rich Site Summary (RSS), PHP Classes
Injecting XML Content Into Page Templates With patXMLRenderer (part 1)
Categories : PHP, XML, Templates
Build Your Own KlipFolio Klip With PHP
Categories : XML, Content Management, PHP
Building XML Trees with PEAR's XML_Tree Class
Categories : PHP, Pear, XML
Converting XML Into a PHP Data Structure
Categories : PHP, XML
Generating One-Time URLs with PHP
Categories : PHP, URLs
PHP CLI and Cron
Categories : PHP, CLI, Cron
PHP 101 Part 8 of 15 : Databases and Other Animals
Categories : PHP, Beginner Guides, Databases
Saving Images in MySQL
Categories : MySQL, PHP, Graphics, Databases
Introduction to WAP using WML, ASP and PHP
Categories : PHP, WAP, WML