Using a Literal to Populate Target Elements

You can add a Literal node, enter the literal value, and link the Literal node to one or more targets. This hard codes the literal value into the target.

Alternately, you can use a constant to populate a target inside a transformation expression by creating a map link, clicking the map link, adding a constant to the Transformation Rule Expression canvas, and then wiring the constant to the target.

  1. To add a literal, double-click to expand a target schema node.
  2. Right-click in the Map canvas and select Add Literal.
  3. Click the Literal (literal_ n ) node to edit the Literal Properties in the Properties Panel view.
    Table 1. Literal properties
    Field Description
    Name Automatically named literal_ n. Edit as necessary.
    Literal Value Enter any string or constant to be assigned to the target, for example, -256.125.
  4. To link the Literal to a target, click the Literal node's connection point, which is either a yellow or green dot, then click directly on the target name, for example, Month12 [xsd:integer]. Repeat for each target that receives the literal value.

    A map link, which is a blue arrow, is created and connects the Literal to the target.

  5. Click the Literal map link to edit the Link properties in the Properties Panel view:
    Table 2. Link properties
    Field Description
    Source literal Displays the name of the literal node, for example, literal_4 as defined earlier in Literal properties.
    Target full path Displays a string identifying the target schema, element, and attribute (optional), for example, /sy2:OrderSummary/sy2:OrderRef.
    • sy2 - An arbitrary namespace identifier.
    • OrderSummary - The name of the schema's root node.
    • OrderRef - The target, in this case, an element.
    Target relative path Displays a string identifying the target without the schema qualifier, for example, ../ ParallelAttributeInSameElement .
    Output as CDATA Character Data (CDATA) defeats the standard XML encoding rules for & (ampersand), > (greater than), and ... (ellipsis), allowing the literal data to bypass the XML parser.

    Select Yes to encode the literal inside a CDATA section. That is, the literal is wrapped between the delimiters <![CDATA[ and ]]>.

    Test Enter the test condition that defines the condition on which the target is created.

    For example, /sy2:OrderSummary/Sy2:OrderRef!=" checks the presence of input values during runtime and omits the target in the resulting XML document if Sy2:OrderRef is empty (null).

Related concepts
Transformation Services

Send your feedback on this help topic to Sybase Technical Publications: pubs@sybase.com

Your comments will be sent to the technical publications staff at Sybase, Inc. For product-related issues or technical support, contact Sybase Technical Support at 1-800-8SYBASE.