Applying a Stylesheet to Multiple Documents

You can apply the same stylesheet to multiple documents

Applying the Same Stylesheet in Separate Operations

Scenarios make it easy to view results and apply the same stylesheet to multiple XML documents. A stylesheet can have any number of scenarios. Each scenario is associated with only one stylesheet. In addition to the stylesheet, a scenario is associated with a source XML file. The same XML file can be associated with any number of scenarios.

You create an initial scenario when you create a stylesheet. You can create additional scenarios at any time. See Creating a Scenario.

To view results for a particular scenario:
1. Click the down arrow in the scenario field at the top of the stylesheet window.
2. Click the scenario you want to view.
3. Click Preview Result , which is directly to the left of the scenario field. This applies the stylesheet to the XML document specified in the selected scenario.

Each time you generate a different scenario, Stylus Studio displays a tab at the bottom of the Preview window for that scenario. Click the tab for the scenario you want to view. This allows you to compare results.

Applying a Stylesheet to Multiple Documents in One Operation

To apply a stylesheet to multiple documents in one operation, call the document() function in the XPath expression of a template. This function allows you to access another XML document and select nodes from that document for processing as source nodes. See Accessing Other Documents During Query Execution.

For example, you can specify the following:

<xsl:apply-templates select="document('bookstore.xml')/bookstore"
       

    

This selects the bookstore root element of the bookstore.xml document.

Stylus Studio looks for the document in the directory that contains the stylesheet.

The document() function has a lot of overhead. You should call it once and assign the result to a variable with the xsl:variable instruction.

WSDL Editor

WSDL Editor featuring a graphical WSDL viewer, syntax help, Java Web Service code generation and more. Simplify Web Services development with Stylus Studio's Web Service Description Language (WSDL) Editor today!

Validating X12 Documents with XML Schemas

Either before or after transforming X12 EDI content, generated XML Schemas will make sure that we have all of the necessary components, our codes are all according to the standard codelists, and every little delimiter is in the right place.

Airlines, Aerospace and Defense

Want to know what airlines, aerospace and defense companies are soaring high with Stylus Studio 2006? Well now you can! Come check out these leading companies and soar with Stylus Studio 2006 yourself.

HTML Tidy

HTML Tidy is a program for turning HTML into something that can be parsed as XML, unlocking their data for use in XSLT and XQuery programs. Learn how to use HTML Tidy in Stylus Studio now.

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.