On the IBM developerWorks site today, there's a new tutorial by Vikram Vaswani walking through the use of the XML_Query2XML PEAR package to pull data from your SQL database and push it into an XML structure.
Ever wished for an easy way to transform SQL result sets into XML? It's a PEAR package named XML_Query2XML, and it provides a comprehensive framework to efficiently turn the results of a database query into a customizable XML document. This article introduces the package, and demonstrates useful real-world applications, including using it with XSL and XPath, combining it with data from external Web services, and creating database dump files.
They go through the installation and the steps to create the XML:
- Convert SQL to XML
- Transform XML output with XSL
- Customize XML output
- Work with SQL joins
- Filter SQL records with XPath
- Merge data from multiple sources
- Create database backups
Check out the full tutorial for an excellent guide to using this powerful PEAR package.