Creating a Template That Matches the book Element

This topic is part of a sequence that starts with Creating a New Sample Stylesheet.

The template that matches the root node includes an xsl:apply-templates instruction that selects book nodes for processing.

To define the template that matches the book element:
1. In the XSLT editor source document tree pane, expand the bookstore element.
2. Double-click the book element.

Stylus Studio creates a template that matches the book element. The new template is near the end of the stylesheet and has the form <xsl:template match="book">. In the tree pane, the yellow check next to the book element indicates that there is a template that matches this element.

3. In the XSLT editor pane, add the following instructions to the new template's body:
<tr> 
  <td><xsl:apply-templates select="title"/></td> 
  <td><xsl:apply-templates select="author"/></td> 
  <td align="right">  
  <xsl:apply-templates select="price"/> 
  </td> 
</tr> 

W3C XML Specifications

Learn about the official W3C XML specifications for XML, XSLT, XQuery, XPath, DOM, XML Namespaces, XInclude, XML Base, XPointer, WSDL and more.

Text File to XML

Stylus Studio provides several easy-to-use document wizards that allow you to quickly convert text files to XML. Create XML from text and EDI, create XML Schema from EDIFACT, and more!

Stylus Studio User Guides (PDF Download)

Download Stylus Studio User Guides in printer-friendly PDF format, including documentation of past (older) versions of Stylus Studio.

XML Document Wizards

Stylus Studio XML Document Wizards help you easily convert EDI, flat files, and other document formats to industry-standard XML.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member