Slides des Vortrags von Sebastian Bergmann auf der internationalen PHP-Conference 2003 in Frankfurt/Main.
Been playing around with an alternative API for parsing XML which may appeal if you hate SAX and DOM.
This tutorial is intended for developers who wish to extract data from a database and insert it into XML files so that it can be processed in some way, usually by transforming it into HTML using an XSL file.
In this article, Jason will demonstrate how to use PHP with XSL to manage your XML data in numerous wireless technologies.
This article describes an alternative way of converting XML to HTML using the SAX parser. For each tag you want to convert, you write a conversion function. This function is called with two arguments: contents and attributes. The return value of the function will replace the tag and its contents in the finished document.
For anyone who has been puzzling over the PHP DOMXML extension the UML diagram here may help.
While there is no official implementation of the Simple API for XML (SAX) in PHP, PHP does provide a SAX-like method for working with both local and remote XML files. In this article, author Nicholas Chase shows you how to work with XML files in PHP by building and setting handler functions and creating a parser. He demonstrates SAX in PHP with a page-building exercise in which he crafts a page based on the result of an Amazon Web Services query.
With HTML, developers knew where they stood: design, content, and styling were all in one place. However, the new (and superior) trend is towards keeping various parts of data separate: XML stores content, CSS stores styling, and XHTML stores layout.
Using the new system, with content and layout clearly split, it is suddenly much easier to manipulate content without affecting layout. This is where XSLT comes in: it provides a way to process and output the data stored in an XML document based upon your processing instructions.
This tutorial is for developers who have been looking for ways to use XML to manage web content, and XSL to style and format that content. You should be familiar with XML, and having some experience with XSL would be helpful.
In this tutorial you will learn:
- An introduction to XML, XSL's technologies and the Simplified DocBook DTD.
- How to use PHP and XSL to transform a XML document into HTML
Over the next few pages, I'm going to be introducing you to a free PHP class named XMLTree, which allows you to manipulate XML document trees in a manner similar (though *not* completely identical) to that available in the standard PHP DOM extension...without requiring you to first recompile your PHP build.