Home > Online Product Documentation > Table of Contents > Processing Source Nodes
You can use any of the following to combine nodes or process nodes in the source document and map the result to a node in the target document:
Stylus Studio supports standard XPath functions defined by the W3C. This section describes how to work with function blocks in XSLT mapper and covers the following topics:
Function blocks are drawn as a purple block with an italic " f" at its center, and connectors, called ports, placed along the block's border. Input ports (one or more depending on the function) on the left, the flow port at the top, and the output port on the right:
Input ports are on the left side of the function block. The number and definition of input ports varies from function to function. To specify a value for an input port, you can
Flow ports on the top of function blocks are generally used only when a function is used in a direct link between a source and target node.
The output port is on the right side of the function block. You use the output port to map the function result directly to a target structure element or attribute, or to an IF, condition, or another function block.
The XPath functions available in XSLT mapper include the following:
In order to simplify the graphical presentation in the XSLT mapper, the following XPath mathematical functions are not graphically represented:
You can easily express these functions by typing them in the Value dialog box displayed when you double-click an input port.
Select it and press the Delete key.
If the function block is part of a link, deleting the function block also deletes the link.
The Stylus Studio XSLT mapper allows you to graphically define the following types of conditions:
All condition blocks have two input ports and a single output port, as shown in this example of a greater than block.
You can map the return port to a target structure element or attribute, or to the input port on an XSLT instruction, XPath function, or another condition block.
You can set text values for target structure elements and attributes. You might want to do this if you are composing a mapping whose target structure contains an element or attribute that requires a fixed value, instead of using a value gathered from an input XML document.
Here is the XSLT code Stylus Studio generates for the
Title element when a text value is specified for it:
Stylus Studio displays a red letter T for nodes for which you define a text value:
There are two ways to set a text value:
The shortcut menu appears.
The text block appears on the mapper.
Double-click the text block to display the Value dialog box.
|
Tip
|
|
You can also display the Value dialog box by selecting Properties from the text block shortcut menu (right click). |
The shortcut menu appears.
The Value dialog box appears.
You can write your own Java functions and use them when you map nodes.
Now when you select Java Functions from the mapper short-cut menu, the list of functions includes the function you registered.
The class file must be in your
CLASSPATH environment variable or in the Stylus Studio
ClassPath. To add it to the Stylus Studio
ClassPath, select
Tools >
Options from the Stylus Studio menu bar. In the
Options dialog box, expand
Application Settings and click
Java Virtual Machine.