Creating and Working with Templates

A stylesheet can contain more than one template. This section describes Stylus Studio's features for creating and working with named and matched templates in XSLT mapper.

What Happens When You Create a Template

When you create a template, Stylus Studio switches the XSLT mapper to the new template. The attributes identifying the template you are currently viewing are displayed in the template drop-down list at the top of the mapper canvas.

Figure 234. Drop-down List Shows Current Template

You can change the template view at any time, by selecting the template from the drop-down list, as shown in Figure 235.

Figure 235. Display Different Templates Using the Drop-down List

Tip

 

At any time, the mapper shows only the links that have been defined for the current template.

How to Create a Named or Matched Template

To create a named or matched template:
1. Right-click the XSLT mapper canvas.
2. Select Create Template > Named Template or > Matched Template from the shortcut menu.

Stylus Studio displays the Named Template (or Matched Template) dialog box. (The Named Template dialog box is shown in Figure 236.)

Figure 236. Named Template Dialog Box

3. Enter a name and, optionally, a mode.
Tip

 

You can use a mode to define the conditions under which a template will be applied by a stylesheet.

4. Optionally, create one or more parameters:
a. Click the Add button.

The Name column becomes editable.

b. Type a parameter name and press Enter.

The Default Value field becomes editable.

c. Type a default value.
d. If you want to define another parameter, click ADD; otherwise, go to step 5.
5. Click OK to finish creating the template.

Translating EDIFACT Documents to XML

The EDIFACT to XML Converter is a primary component of the adapter library. The XML that is generated is well commented and indented, and can be used anywhere XML is normally used — with XML Schemas, XQuery, XSLT, and so on.

DOM - The Document Object Model

The Document Object Model (DOM) is a cross-platform interface for parsing and manipulating XML. Learn how Stylus Studio supports DOM in our XML Pipeline and other XML parsing tools.

XHTML Tools

Powerful XHTML Tools for converting HTML to XHTML, validating XHTML, transforming XML to XHTML, editing JSP, creating XML driven Websites and more.

Building DataDirect XQuery Applications

Stylus Studio further simplifies relational and XML data integration by providing advanced XQuery tools support for building XQuery applications which use DataDirect XQuery.

Stylus Most Wanted

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.