Choose Nodes

A Choose node uses XPath expressions to evaluate one or more conditions based on its input to direct the flow of XML pipeline processing. The Choose node uses XPath 2.0 to evaulate the XPath expressions defined for it.

Input Ports

The Choose node can have one or more input ports; by default, it has a single input port, named Input #0. You use the XPath # property to express a "true" condition - that is, a condition that must be met in order for processing to continue. The Choose node in retrieveData.pipeline, for example, uses the XPath expression . castable as xs:double to check whether or not the user ID it is given as its input is numeric.

The initial context node for each XPath # expression is the data input from Input #0. For additional input ports (Input #1, Input #2, and so on), data is available to the XPath expression as $var1, $var2, and so on.

The Choose node evaulates XPath#0. If XPath#0 is true, it sends data from Input #0 to Output #0. If XPath#0 is false, it evaluates XPath#1. If XPath#1 is true, it sends data from Input #0 to Output #1, and so on. If none of the XPath # expressions is true, the data from Input #0 is sent to Output `no match' port.

Adding Input Ports

To add an input port to a Choose node:
1. Display the Properties window if it is not already open (View > Properties).
2. Click the Choose node in the XML pipeline diagram.
3. Change the value for the Number of inputs property.

A new input port is added, named Input #1.

4. Optionally, add an output port for the new input port.

Output Ports

By default, a Choose node has two output ports:

You can add additional output ports, which you might want to do if you have added an input port. The output port that corresponds to the "true" condition always makes the first input available to its connecting pipe.

Each output port must have a value specified for it. You can

Adding Output Ports

To add an output port to a Choose node:
1. Display the Properties window if it is not already open (View > Properties).
2. Click the Choose node in the XML pipeline diagram.
3. Change the value for the Number of choices property.

A new output port is added, named Output #1.

Using OASIS XML Catalogs in Stylus Studio

Learn about Stylus Studio's XML catalog support and how to work with XML catalogs in your Stylus Studio XML projects.

Forest & Paper Products

Many forest & paper product companies realize the best XML suite doesn't have "pay per" features. That's why these top forest & paper product companies choose Stylus Studio 2006 to get the world's best XML features all in one bundle!

Transforming Non-XML Documents with XML Tools

This pages has audio from the Stylus Studio Presentation at Exchange 2005.

XML to PDF

Convert XML to PDF using Stylus Studio's XML publishing tools - the easiest way to design beautiful document layouts for use in XSL:FO based multi-channel publishing and single source publishing applications.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member