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

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

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…

Contents