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.
Converting the main content file to XSLT - PHP Tutorial
From the course: PHP: Exporting Data to Files
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…
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.
Contents
-
-
-
-
-
-
-
-
(Locked)
Creating a .odt file to use as a template4m 29s
-
(Locked)
Inspecting the structure of an OpenDocument text file2m 43s
-
(Locked)
Extracting the main content file from a .odt document5m 2s
-
(Locked)
Converting the main content file to XSLT8m 3s
-
(Locked)
Outputting the database result as a .odt file7m
-
(Locked)
-
-