From the course: PHP: Exporting Data to Files
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Merging XML documents with XSLT - PHP Tutorial
From the course: PHP: Exporting Data to Files
Merging XML documents with XSLT
The technique we're going to use to export data to an ODT or DOCX file involves converting an XML file to an XSLT style sheet. XSLT stands for Exstinsible Stylesheet Language Transformations, which became a recommendation of the World Wide Web Consortium in 1999. So, it's an official web standard, albeit one that's not very widely used. The stylesheet part of the name is rather misleading. XSLT doesn't style pages in the same sense as CSS. The keyword is transformations, because XSLT transforms one XML document into another. One use for XSLT is to filter an XML document to extract specific elements. It can also be used to merge two XML documents which is how we're going to use it. PHP supports XSLT through the XSL extension. Which is a default part of PHP 5, although it isn't always enabled, because it relies on an external library. XSLT is a tag-based language, just like HTML and XML. In fact, an XSLT document must be valid XML. And XSLT document is wrapped in a pair of XSL style…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.