Editing the Template That Matches the Root Node

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

Begin writing your stylesheet by adding instructions to the template that explicitly matches the root node in your source document:

In the XSLT editor, edit the contents of the root template so that it contains only the following contents. As you type, Stylus Studio displays a pop-up menu that lists possible instructions. You can scroll the list and double-click the entry you want, or you can continue typing. If you want, you can copy the text from here and paste it into the Templates view.

<html>
               
<body>
               
<h3><center>Books in Stock</center></h3>
               
<table align="center" cellpadding="5">
               
  <tr>
               
    <th>Title</th>
               
    <th>Author</th>
               
    <th>Price</th>
               
  </tr>
               
<xsl:apply-templates select="bookstore/book"/>
               
</table>
               
</body>
               
</html>
               

            

Ensure that you do one of the following:

  • Remove the xsl:apply-templates instruction that you inserted earlier.
  • Edit the xsl:apply-templates instruction to include the select attribute as shown above, and place it in the correct location.

XQuery Mapper

Stylus Studio has the industry's only XQuery mapper, enabling you to develop sophisticated XML mappings consisting of queries and data transformation in an intuitive, visual manner.

XSV - The XML Schema Validator

XSV is the official reference implementation for the XML Schema language and Stylus Studio is the only XML IDE to provide seamless integration with XSV - the W3C XML Schema Validator. Download Stylus Studio and XSV today.

XML Schema Validator, DTD Validator

Stylus Studio lets you validate XML documents using integrated XML Schema or DTD validators. Use the Stylus Studio built-in validator, or any number of supported XML parsers and XML validators like MSXML SAX and DOM, Xerces, .NET, and more!

XML Schema Quality Checker

Use IBM's alphaWorks XML Schema Quality Checker to check the quality and style of your XML schema documents. Fully integrated with the Stylus Studio XML Schema Editor and XML validator.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member