Portlet Factory, Version 6.1.2
Using parent node mappings
This Transform builder input is useful when working with documents that are nested deeply, and particularly when the source and target have different levels of nesting. For example, suppose you have a source variable that looks like the following:
<PERSONALDATA> <BAPIP0002L> .... </BAPIP0002L > <BAPIP0002L> .... </BAPIP0002L > </PERSONALDATA>and the target looked like
<FUNCTION> <IMPORTS > .... </IMPORTS > <IMPORTS> .... </IMPORTS > </PERSONALDATA>Your parent mappings could specify that you wanted to map PERSONALDATA to FUNCTION and BAPIP0002L to IMPORTS. For each BAPIP0002L element, the Transform builder needs to decide if it should create a new IMPORTS element and add it as a new child of FUNCTION, or if it should merge it into an existing IMPORTS element.
That is where the Match Nodes By input comes into play. if you specify Parent Node Text, the builder compares the text value of BAPIP0002L and all of the IMPORTS elements to look for a match. (You can specify whether or not to consider empty text as a match with the check box).
If you specify Child Node Text and specify some child elements of BAPIP0002L and IMPORTS, the builder compares the values of the specified sub-elements to decide if it can match the BAPIP0002L element to any existing IMPORTS elements. In the case of a custom method, the builder wants a method that takes two IXml objects and returns boolean. For each BAPIP0002L element, it will pass in that BAPIP0002L and each IMPORTS element until it gets a true result (which means the elements should be merged) or until it runs out of IMPORTS elements, which means there was no match, so a new element is created.
Parent topic: Transform builder
Library | Support |