Table of Contents: User and Administrator Guide : Mashup Center 188.8.131.52
Use the Transform operator to restructure an incoming feed. You can create new elements, remove elements, add attributes to elements, apply a mathematical or text function to an element, and manipulate the values of the elements.
The text to display on the Transform operator image on the canvas.Input
A template entry that represents the input structure found across the entire set of input entries. This template is displayed in a tree format. For every node in every input entry that is passed to the Transform operator, the template entry contains one node having the same type, name, and relative location. The node type can be an element, attribute, or text.
The order of the sibling nodes represented in the template tree might not be the same order as for those siblings in the input entries. Also, no two siblings in the template tree will ever have the same name. If at least one of the input entries contain sibling nodes with identical names, then the corresponding single node in the template tree will be marked as a "locally repeating" element
The new structure for the feed that will be output from the Transform operator. The entry is displayed in a tree format. Initially, the Output tree contains one empty entry with two attributes. You add elements to the Output tree by copying elements from the Input tree or by adding a New Element with the Output tree menu option.
Copying elements from the Input tree to the Output tree
You can specify the elements to use from the Input tree by copying the elements to the Output tree. To copy an element, right-click the element in the Input tree and choose Copy to the output tree
. The element is added as a child element nested under the selected element in the Output tree. By default, the root element is the selected element. If you want to copy an element from the Input tree to an element other than the root entry element, first select that element in the Output tree.
You cannot copy an element from the Input tree to an element that you have already copied
from the Input tree. You can only copy elements from the Input tree to the root element or to a New Element.
You can also drag elements from the Input tree to the Output tree.
Copying attributes from the Input tree to the Output tree
You specify the attributes to use from the Input tree by copying the attributes to the Output tree. To copy an attribute, first select a target element or attribute in the Output tree where you want to copy the attribute to. If you do not select an element in the Output tree, the default is the root element of the Output tree. Next right-click the attribute in the Input tree.
If you are copying to an element
in the Output tree, you have two options:
- Copy to the output tree as attribute
Select this option to the copy the attribute as an attribute of the Output tree element.
- Copy to the output tree as text
Select this option to create a text node containing the value of the attribute under the Output tree element. If a text node already exists, its value will be replaced by the copied attribute value.
If you are copying to an attribute
in the Output tree, you have one option:
You cannot copy an attribute from the Input tree to an element or attribute that you already copied from the Input tree. You can only copy attributes from the Input tree to the root element, or to a New Element or an attribute.
You can also drag attributes from the Input tree to the Output tree.
Output tree menu options
To access the Output tree menu, right-click an element, attribute, or value in the Output tree. Available options depend on the item that you select.
Select one of the following:
- the entry element at the top of the Output tree.
- another new element. The new element will be a child element of the selected element.
Right-click and choose New Element
A new attribute can only be added to a new element. Select the element, right-click and choose New Attribute.New Text
New text can only be added to a new element. Select the element, right-click and choose New Text.Specify a function value
Apply a function to a new element. Edit
Edit the name of a new element or a text value under a new element. (Text nodes do not have names.)Edit Name
Change the name of a New Attribute that you added to the Output tree.Edit Value
Change the value of a New Attribute that you added to the Output tree.Delete
Delete the element, attribute, or text from the Output tree. You cannot delete the entry element. You cannot delete child elements of an element copied from the Input tree. Only the top-level element can be deleted, which can include child elements.Move Up
Move an element up one position in the Output tree.Move Down
Move an element down one position in the Output tree.Specify Filter Condition
After copying a template element to the Output tree, you can specify a filter condition on the copied element. Input nodes that correspond to the copied template element will only be displayed in the output if those input nodes satisfy the filter condition. Input nodes can be filtered based on their ordinal position in relation to their siblings, or based on their attribute node values.Remove Filter Condition
This option can be useful when an element in the Input tree is marked as "locally repeating" and you only want a subset of the repeating elements to appear in the output. Locally repeating elements are sibling elements that have the same node type, node name, and relative node path.
The Specify Filter Condition option is only available on an output element node that has been copied from the input template tree; it is not available on an output node that was created in the Output tree using the New Element option.
This option clears any filter condition that has been specified for the selected output element.Set Repeating Behavior
By default, the Transform operator examines all locally repeating elements in the input template tree and uses that information to infer which elements in the Output tree should repeat within an output entry. Use the Set Repeating Behavior option to override the default repeating behavior for the selected output element. Setting the repeating behavior for an output element also affects how that element's descendants repeat.Use Default Repeating Behavior
You can specify that the target element be created and evaluated "once for each occurrence of \\$in", where \\$in is any element node from within the input template tree.
If you only want a target output element to appear once per output entry, select the top-level <mhub:entry> template node as the "\\$in".
If you want to disable automatic (inferred) element repetition for the entire Output tree, so that every New Element occurs only once within each output entry, use the Disable automatic repetition of output elements option in the Advanced tab of the Transform operator.
The Set Repeating Behavior option is only available on output nodes that were created with the New Element option; it is not available for output nodes that have been copied from the template tree.
This option clears any repeating behavior that has been defined for the selected output element with the Set Repeating Behavior option. Using the default repeating behavior means that repetition of the output element will occur automatically based on the locally repeating elements that exist within the input template tree.Restriction:
You cannot add a new element, attribute, or text value, or apply a function on an element that was copied from the Input tree. To modify an element from the Input tree, you must add a new element to the Output tree
with the same name as the original input element, and then specify the element from the Input Tree in a function on the new element. This process enables you to modify the value of that element.
You can disable automatic (inferred) repetition of output elements for the entire
Transform operator. Selecting the Disable automatic repetition of output elements
option means that every element created with the New Element
option will, by default, occur only once per output entry.
This option will not prevent repetition of output nodes for which you have specified explicit repeating behavior.
This option only applies to output elements that were created using the New Element
option; output elements that were copied from the template tree will still repeat in the output entries the same as they repeated within the input entries.
Summary of actions available for output elements
The following table summarizes the characteristics and the available options for output elements based on whether the elements are copied from the Input tree or created with the New Element
Output tree menu option.
|Elements copied from the Input tree||Elements created with the New Element option|
|You can only copy elements from the Input tree to the root element or to a New Element in the Output tree.||You can only add a new element to the root element or as a child element nested under another new element in the Output tree.|
|You can only copy attributes from the Input tree to the root element, or to a new element or attribute.|
|New Attribute, New Text, Specify a function value, Edit Name, Edit Value options are available.|
|The Specify Filter Condition is available.||The Set Repeating Behavior option is available.|
|The Disable automatic repetition of output elements option (Advanced tab) is available.|
The Transform operator is used in the following data mashup examples:
- Aggregate Policies
- Expiring Policies
- National Park Forecast
You can access these examples from the Getting Started actions on the Home:Catalog
Parent topic: Operators : Mashup Center 184.108.40.206
Operators : Mashup Center 220.127.116.11
Tips for better performance in the data mashup builder : Mashup Center 18.104.22.168
Filtering by node position or by element attribute value : Mashup Center 22.214.171.124
Functions : Mashup Center 126.96.36.199
Casting data type values : Mashup Center 188.8.131.52
Variables : Mashup Center 184.108.40.206