From the course: PHP: Exporting Data to Files

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Converting the main content file to XSLT

Converting the main content file to XSLT - PHP Tutorial

From the course: PHP: Exporting Data to Files

Start my 1-month free trial

Converting the main content file to XSLT

We've extracted the main content file from the Open Document template, and saved it with an XSLT file name extension. We now need to convert that file, into an XSLT style sheet. So open flowers_odt.xslt. And when you open that file, it looks as though there's virtually nothing in it. That's because all white space has been removed, so you need to use an editor that's capable of formatting XML, or use an online XML formatting tool, such as the one at freeformatter.com. Now let's just quickly format that. That's a lot easier to read. The root element of the file, is office document content. It begins on line two, and inside the opening tag is a large number of XML name space declarations. To convert this file into a XSLT style sheet, we need to wrap the root element in a couple of tags. So let's add a new line above that root element. The first tag, declares that it's an XSLT style sheet. And it defines, the xsl name space. It's important to get the namespace correct. So, I suggest that…

Contents