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
Now that we've formatted the XSLT file without hard line breaks in the middle of tags, we can add the XSLT code. The document route needs to be wrapped in XSL style sheet tags. The document route in Microsoft Word is WDocument, so we need to insert a new line above that, new line on line two. The first tag is the style sheet tag, which also defines the XSL namespace. It's important to get the namespace correct, so I suggest that you copy and paste the opening tag from the text file that you can find in the exercise files for this video. Then, on the next line, it's the template tag so xsl:template and the match attribute. We want to process all of the the input xml so the value should be a foward slash, between quotes and then we have the closing angle bracket. My editing program has inserted the closing tag there. That needs to go right at the very end. So let's scroll down, and find the closing root tag, which is W document. Insert a new line after that, then the closing template…
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 .docx file to use as a template3m 37s
-
(Locked)
Extracting the main content file from a Word document5m 28s
-
(Locked)
Formatting the main content file3m 38s
-
(Locked)
Converting the main content file to XSLT6m 18s
-
(Locked)
Outputting the database result as a .docx file6m 4s
-
(Locked)
Offering a choice of download formats3m 55s
-
(Locked)
-