XML Parsing using PHP
Introduction This tutorial is a continuation of the previous XML tutorial I have written. Because I have already written some background information (very little) I will not add that into this tutorial in order to save space and time. The other tutorial can be found at this link. Formatting XML Ok, since I already went over the basics for formatting XML data and the basics of PHP/XML parsing I’m just going to jump right into the XML and PHP without much of an explanation. For this project I decided to create a mock-news headline parser. Basically, we have our XML file that has news headlines and a brief description of the story. Many of the news-tickers that you see on websites use a process similar to this (often called RSS). Now, on to our XML file. Creating our XML Just as with the last tutorial this XML file is quite simple. We have our highest level "news" tags which encase everything. The next level down is our "story" tags which split up each different news headline that we have and contained within that are the "headline" tag and the "description" tag. See? Simple…
































