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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.