XSLT—Document Transformation

XSLT, or eXtensible Stylesheet Language Transformations, is a W3C-defined mechanism for taking an XML document and transforming it into another structured document. The resulting document could be XML, HTML, PDF, and so on. As we have mentioned in the previous chapter, XML is an extensible language that is used to structure information inside of a document. XSLT documents are actually written with XML syntax; if you understand XML, XSLT documents should look familiar to you. Let's look at one right now:

<xsl:template match="product">
       <p>
              <xsl:apply-templates />
       </p>
</xsl:template>

You can see that we are still dealing with nodes, elements, and the like. Some syntax may look foreign (such as <xsl:template match="product"> ...

Get Visual Basic® Programmer's Guide to the .NET Framework Class Library now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.