|
|
|
|
|
|
| |
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... |
|
| |
| 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 | | | Data, its presentation and user interface forms Categories : PHP, XML, User Interface | | | Converting XML Into a PHP Data Structure Categories : PHP, XML | | | More PHP, XML and XSL for Wireless Content Categories : PHP, XML, XSL, Wireless | | | PHP 101 Part 11 of 15 : Sinfully Simple Categories : PHP, SimpleXML, XML | | | Building XML Trees with PEAR's XML_Tree Class Categories : PHP, Pear, XML | | | Building a Generic RSS Class With PHP Categories : PHP, XML, Rich Site Summary (RSS), PHP Classes | | | Serializing XML With PHP Categories : PHP, XML, Serialize | | | Building XML Web Services with PHP NuSOAP Categories : PHP, NuSOAP, XML | | | Web database Information Flow Categories : PHP, MySQL | | | An Introduction to Pear Categories : Pear, PHP | | | Using PEAR HTML_Template_IT For Modular Interface Design Categories : PHP, PEAR, Templates | | | Using If Else Statements Categories : PHP, Beginner Guides | | | Setup and Install Apache and PHP4 on Windows Categories : PHP, PHP Configuration, Apache, Windows 2000 | |
| |
|
|