Summary


The XML Stylesheet Language for Transformations (XSLT) is used to transform XML documents containing information formatted in a document type other than Hypertext Markup Language (HTML) into Web browser-friendly HTML documents, according to the rules given in an XSLT stylesheet.

Depending on the version of PHP you are using and the set of extensions that has been compiled with your PHP binary, you may have one or several tools available to you to transform XML documents using XSLT stylesheets.

  • The DOM XML extension, the choice of Red Hat and some other vendors, is a PHP4 extension that contains features both for manipulating general-purpose XML object trees and for transforming those trees using XSLT stylesheets. It is flexible, but more complex than the XSLT extension for PHP4.

  • The XSLT extension is a PHP4 extension designed specifically to streamline XSLT transformations of XML documents. Because of this, it is fast and simple, but to use it you may find that you need to recompile PHP and include it yourself.

  • PHP5 users will find that the DOM and XSL extensions provide a flexible, logically consistent paradigm for handling both XML object trees and XSL stylesheets, as well as well-formed XHTML documents.

SimpleXML, also discussed in this chapter, provides a quick and dirtyyet powerfulinterface to XML data. Using SimpleXML, you access elements in XML documents as properties of SimpleXML objects and can manipulate those elements, their values, and their attributes the same as you would other PHP elements or objects.



PHP 5 Unleashed
PHP 5 Unleashed
ISBN: 067232511X
EAN: 2147483647
Year: 2004
Pages: 257

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net