Skip to Content
0
Former Member
Oct 24, 2007 at 09:29 PM

Dynamic duplication of subtree

160 Views

Hi,

I have one scenario where in the source structure I have one field in a node which

has some comma separated values and I need to map it to the target field and

the target node has to be repeated as many times as the comma separated values.

It will be like

Source Structure

<SNode>

<SField>1,2,3,4</SField>

</SNode>

Expected Target Structure

<TNode>

<TField>1</TField>

</TNode>

<TNode>

<TField>2</TField>

</TNode>

<TNode>

<TField>3</TField>

</TNode>

<TNode>

<TField>4</TField>

</TNode>

I can duplicate subtree in the target structure and extract each comma separetd values from the source filed and map it to the target using UDF.

But the problem is In the runtime I dont know how many comma separated values will be coming. So I need to dynamically create subtrees in the mapping?

Do you know what can be done in such cases?

Regards,