Forum Moderators: open
How do I get started learning how XML is received from a data source (another website), displayed on our site, etc?
Its the sending and receiving of the info between the supplier's site and mine that is my main enquiry.
(I'm using apache, php, mysql...).
For parsing, you can use PHP's implementation of the expat parser ([us2.php.net ]).
The basic model that you will follow is:
1 - Fetch the XML data
2 - Parse it
3 - Store it in your database
4 - Act on the stored data
<html>
<body>
<xml id="cdcat" src="http://www.w3schools.com/xml/cd_catalog.xml"></xml>
<table border="1" datasrc="#cdcat">
<tr>
<td><span datafld="ARTIST"></span></td>
<td><span datafld="TITLE"></span></td>
<td><span datafld="COUNTRY"></span></td>
<td><span datafld="COMPANY"></span></td>
<td>£<span datafld="PRICE"></span></td>
<td>year: <span datafld="YEAR"></span></td>
</tr>
</table>
</body>
</html>
Change the 'xml id' to whatever is the absolute url for the xml file (and change the datafld accordingly). Easy, but no go in Mozilla.
Easy, but no go in Mozilla.
Or Opera for that matter - in other words it's IE only.
To really the most "bang for your buck" out of an XML or RSS feed for web-based applications you need to be parsing it at the server-side and outputting it to the page.
At a push you could use XML+XSL, but even then you can't always rely on the older browsers to render it.
- Tony