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.
To add a literal:
Double-click to expand a target schema node.
Right-click in the Map canvas and choose Add Literal.
Click the Literal (literal_n) node to edit the Literal Properties in the Properties Panel view.
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.
Click the Literal map link to edit the Link properties in the Properties Panel view:
Link properties
Field | Explanation and options | |
---|---|---|
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. | |
Path field | Explanation | |
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). |
Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com