Setting a Text Value

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.

Example

Here is the XSLT code Stylus Studio generates for the Title element when a text value is specified for it:

<Book>
               
	<Title>Confederacy of Dunces</Title>
               
</Book>
               

            

Stylus Studio displays a red letter T for nodes for which you define a text value:

Figure 201. Symbols for Nodes With Text Values

There are two ways to set a text value:

  • On the mapper canvas
  • On the target node

How to Set a Text Value on the Mapper Canvas

To set a text value on the mapper canvas:
1. Right-click on the mapper canvas.

The shortcut menu appears.

2. Select Text Block from the shortcut menu.

The text block appears on the mapper.

Figure 202. Text Block

Double-click the text block to display the Value dialog box.

Figure 203. Value Dialog Box

Tip

 

You can also display the Value dialog box by selecting Properties from the text block shortcut menu (right click).

3. Type a value and click OK.
4. Drag a link from the text block's output port to the target node to which you want to assign the text value.

Note

 

Unless the text block is linked to another block (such as a logical operator or an XPath function), Stylus Studio removes it from the mapper canvas if you leave and then return to the Mapper tab. In this case, a red T is displayed next to the target node's name.

How to Set a Text Value on the Target Node

To set a text value on a target node:
1. Right-click the node for which you want to set the text value.

The shortcut menu appears.

2. Select Set Text Value from the shortcut menu.

The Value dialog box appears.

Figure 204. Value Dialog Box

3. Type the string you want to use as the text value and click OK.

X12 Standards Available Across All Releases

The complete X12 Standards Grid, listing all X12 EDI releases across the top, and the corresponding transaction sets down the left side.

XPath Generator

Stylus Studio includes an XPath generator that helps you easily create XPath expressions. This page illustrates how you can accomplish this.

XQuery Debugger

The Stylus Studio XQuery Debugger allows you to set breakpoints and step through the evaluation of any XQuery expression in a way that gives you complete control and visibility into the XQuery expression evaluation process.

XML Code Folding

Stylus Studio's XML Editor features XML code folding, a powerful and intuitive way to maximize limited screen real-estate and help make sense of large XML files.

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.