Following are the guidelines or rules that a user must follow while enabling streaming for both existing and new mappings.
Mapping Rules
Given below is a mapping example that would simplify and explain the rules to be followed for streaming.
To map leaf nodes from source to target, you should map their parent nodes first. For example, in the above scenario, to map Address1 in source to Address1 in target, you should first map their parent nodes, that is the branch node ‘AddressDetails’ of source to the branch node ‘Address’ of target.
You can map the leaf nodes from source to target whose parents are mapped together. For example, in the above scenario, you can map a leaf node of ‘AddressDetails’ branch (Address1, Address2, City or Country) to any leaf node of ‘Address’ branch only (Address1, Address2, City or Country) given the fact that you have mapped AddressDetails to Address branch. You cannot map any node of AddressDetails to a node of ‘Personal’ or ‘Item’ branches.
You can map a branch node from source to only one branch node at target. For example, Since AddressDetails is already mapped with Address branch, you cannot map ‘AddressDetails’ to ‘Personal’
You cannot use For-each rule to map multiple branch nodes of a Root node. For example, it is not possible to apply For-each rule on ‘Person’ in target of ‘Person’ in source and apply For-each rule on ‘Order’ in target of ‘OrderDetails’ in source at the same time.
You can apply For-each rule on a branch node whose parent branch is mapped to the branch in target but is NOT recommended since the mapping might falter in a complex hierarchy. For example, it is possible to apply a For-each rule on Address of AddressDetails and map Address1 but is not recommended.
Remember while using For-each rule, check the output of mapping in debugger and make sure it is correct.
To duplicate a source branch node at the target, simply map the branch nodes to each other. For example, if you want ‘Item’ to occur the same number of times as ‘ItemDetails’ then,simply map ‘ItemDetails’ node of source to ‘Item’ node in target.
Note that the parent branches of ‘ItemDetails’ node, namely, ‘OrderDetails’ and ‘BillDetails’ nodes are mapped to ‘Order’ and ‘Bill’ nodes respectively at the target following the Rule #1.
You can formulate the textual rules only within those branches that are mapped to each other. For example, in ‘Item’ branch, you can formulate the textual rules using leaf nodes of ‘ItemDetails’ of source following Rule #1.
You cannot create a global variable and initialize it with a source value. For example,You cannot create a global variable in mapping and store the value of ‘ItemColor’ from source in it.
Once a leaf node is mapped from source to target, the parent is loaded into memory. Remember, if the parent contains huge data, streaming may not work. This limitation applies only to schemas with a complex hierarchy. For example, in the above scenario,‘BillingAddress’ and ‘ItemDetails’ node will be loaded into memory as their leaf nodes are mapped. Also note-‘BillDetails’ Node (Parent Node of ‘BillingAddress’ and ‘ItemDetaIls’) will not be loaded in memory.
Notes to success
If the mapping created is not in sync with the above rules, the output will not be generated. You can manage the errors (if any) from the debugger.
To enable streaming in an existing or a new mapping, follow Enabling Streaming.
XSL Limitations
Due to limitations of XSL, the following functions are not supported in streaming mode: