Chapter9.XSLT and Other XML Concerns


Chapter 9. XSLT and Other XML Concerns

IN THIS CHAPTER

  • Relating XML to HTML

  • Using XSLT to Describe HTML Output Using XML Input

  • PHP4 and XSLT Using the DOM XML Module

  • PHP4 and XSLT Using the XSLT Module

  • PHP5 and XSLT

  • Accessing XML Data Using SimpleXML

  • Generating XML Documents Using PHP

Extensible Markup Language (XML) is one of the most intriguing new standards to emerge in the world of information technology in the past ten years. XML defines a simple standards-oriented, plain-text structure for exchanging and storing data consistently and accurately, at times between very dissimilar hosts and when using nearly any transmission method or storage medium. Extensible Stylesheet Language (XSL), a subset of XML, is used to transform XML documents of one type into documents of another type while preserving relevant data.

This chapter presents enough introductory information about Extensible Stylesheet Language, its subset XSL Transformations (XSLT), and about PHP's comprehensive set of XML-related features, to help you to accomplish a number of XML-related information processing tasks using PHP. Specifically, in this chapter you will find details and examples showing how to

  • Use the XSL Transformations (XSLT) to accurately describe transformations from well-formatted XML documents into well-formatted and consistent HTML or XHTML code, suitable for rendering in a standards-compliant Web browser.

  • Use the DOM XML or XSLT modules to apply XSLT stylesheets to XML files when using PHP4, or use DOM and XSL module features to apply XSLT stylesheets to XML files when using PHP5.

  • Use SimpleXML for quick-and-dirty access to data in XML documents in PHP5, rather than having to parse them using the more complex methods.

  • Output the XML data from objects you're using in your PHP scripts and store the data to a text-based XML file.

Because space is limited and XSLT is a potentially complex topic, the XSLT details in this chapter will focus entirely on simple examples involving transformations from XML into HTML or XHTML for general World Wide Web use. More detailed information on XSLT files can be found in the World Wide Web Consortium's standards document for XSLT called "XSL Transformations (XSLT)," which can be found at http://www.w3c.org/TR/1999/REC-xslt-19991116

Additional details on using XSLT with PHP can also be found in the official documentation for PHP, available at http://www.php.net/manual.



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