Creating Text
Returning to Listing 2.2, you’ll notice that following the <xsl:template match="/"> tag, there are several HTML tags. To recap, the template rule from Listing 2.2 is repeated here, in Listing 2.3.
Listing 2.3. The Root Template Rule from Listing 2.2
<!-- Root template rule --> <xsl:template match=”/”> <HTML> <HEAD> <TITLE>First XSLT Example</TITLE> </HEAD> <BODY> <P><B>Company: </B> <xsl:value-of select=”invoice/clientName” /> </P> <P><B>Contact: </B> <xsl:value-of select=”invoice/contact” /> </P> <P><B>Services Rendered: </B> <xsl:value-of select=”invoice/descriptionOfServices” /> </P> <P><B>Total Due: </B> $<xsl:value-of select=”invoice/costOfServices” /> </P> </BODY> </HTML> </xsl:template> |
Anything contained in a template ...
Get Special Edition Using XSLT 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.