100% found this document useful (2 votes)
5K views

Node Functions

The document describes several functions for transforming XML document structure and values: - removeContext deletes all hierarchy levels and generates a list - replaceValue replaces an element's value with a defined value - splitByValue inserts context changes after values, value changes, or empty tags - collapseContext groups contexts under a single target context - useOneAsMany replicates a node for each occurrence of another node - formatByExample groups values of one tag according to the contexts of another tag

Uploaded by

RAMESH
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
5K views

Node Functions

The document describes several functions for transforming XML document structure and values: - removeContext deletes all hierarchy levels and generates a list - replaceValue replaces an element's value with a defined value - splitByValue inserts context changes after values, value changes, or empty tags - collapseContext groups contexts under a single target context - useOneAsMany replicates a node for each occurrence of another node - formatByExample groups values of one tag according to the contexts of another tag

Uploaded by

RAMESH
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 22

removeContext

Description: Removes all immediate level contexts of a source field. In this way, you can delete all
hierarchy levels and generate a list.
replaceValue

Description: Replaces the value of element with a value that you can define in the dialog for the function
properties.
Fig.7

Figure depicts replaceValue functionality.


Fig.8

replaceValue will replace the value of Cust_NAME element with the value defined i.e.20Name.

splitByValue
Description: splitByValue() is the counterpart to removeContexts(): Instead of deleting a context, you can
insert a context change in the source value queue.

You can insert a context change in the queue after each value or after each change to the value, or after
each tag without a value.

splitByValue can be achieved in following three ways:

1. EACH VALUE
Fig.12

Figure depicts the splitByValue(Each Value) functionality.


Fig.13

Figure depicts the splitByValue (Each Value) mapping result.

2. VALUE CHANGE
Fig.14

Figure depicts the splitByValue (Value Change) functionality.


Fig.15

Figure depicts the splitByValue (Value Change) mapping result.

3. EMPTY VALUE
Fig.16

Figure depicts the splitByValue (Empty Value) functionality.


Fig.17

Figure depicts the splitByValue (Empty Value) mapping result.

collapseContext

Description: It takes the first value from all the contexts and put them into a context on the target side, So
that all values come under one context.
Empty contexts are replaced by empty strings.
Fig.18

Figure depicts the collapseContexts functionality.


Fig.19

Figure depicts the collapseContexts mapping result.

useOneAsMany

Description: As shown in the figure below the maximum occurrence of the header node in the source is
1 and the target is unbounded. So we have only one occurrence of MatNo & MatDesc, which has to be
replicated for every line Item.
Fig.20

Above figure depicts, both source & target structures.


Fig.21

Above fig depicts, mapping of usOneAsMany function

In the above figure, useOneAsMany takes three arguments.

1. First argument “what should be repeated”.


2. Second argument “how many times, first argument should repeat”.
3. Third argument “Should have same context of Item (Second argument)”.It maintains the context.

MatDesc field will also be mapped in similar way like MatNo.


Fig.22

Number of time Item node appears (repeats), same number of time Header node will appear in target side.
So, source Item node is mapped to Target Header node.
Fig.23

In above fig, Item node is duplicated.


Fig.24

In above fig, Item node is duplicated twice in the source structure. Accordingly, Header is repeating twice
in the target side i.e. MatNo & MatDesc.

formatByExample

Description: This function has two arguments, which must both have the same number of values. To
generate the target, the function takes the values from the first argument and combines them with the
context changes from the second argument.
This function allows grouping of values of a tag (Cust_NAME) according to values of another tag (Cust_ID).
Fig.30

In the Example, Cust_ID is repeated 5 times having 5 different contexts. By using removeContexts
function, remove all the 5 contexts. Then split the Cust_ID in different context whenever value change
occurs, that is achieved using splitByValue (Value Change).From each context, take first Cust_ID and put
it in one context using collapseContexts. So, Creating number of Customers nodes based on result
of collapseContexts.
Fig.31

In the Example, Cust_ID is repeated 5 times having 5 different contexts. By using removeContexts
function, remove all the 5 contexts. Then split the Cust_ID in different context whenever value change
occurs, that is achieved using splitByValue (Value Change).From each context, take first Cust_ID and put
it in one context using collapseContexts. Again split into different context based on each value by
using splitByValue (Each Value) .So, Creating number of Cust_ID fields based on result of splitByValue.
Fig.32

The figure above depicts formatByExample functionality.

formatByExample takes two arguments:

1. First argument: Field that is to be grouped.

2. Second argument: Base for grouping of first argument.


Fig.33

In the fig above, Cust_NAME is grouped in 2 context based on Cust_ID in the target structure.

You might also like