D
dmc
Can anyone suggest an elegant solution for this problem? I have a
source document as follows:
<Object Type="Type1">
<Attribute_A>ValueA</Attribute_A>
<Attribute_B>ValueB</Attribute_B>
</Object>
<Object Type="Type2">
<Attribute_A>ValueA</Attribute_A>
<Attribute_B>ValueB</Attribute_B>
</Object>
The schema for my destination document requires the end result to be:
<Object_Type_1>
<Type1AttributeA>ValueA</Type1AttributeA>
<Type1AttributeB>ValueB<Type1AttributeB>
</Object_Type_1>
<Object_Type_2>
<Type2AttributeA>ValueA</Type2AttributeA>
<Type2AttributeB>ValueB<Type2AttributeB>
</Object_Type_2>
The problem is that the element names, and their structure and
children elements
are different depending on the Type of the source elements.
I could use a lookup for the <Object_Type...> elements. This works
very well if only the name
of teh target element changes, but this gets very cumbersome
for managing the child elements and sub-trees. Any help greatly
appreciated.
source document as follows:
<Object Type="Type1">
<Attribute_A>ValueA</Attribute_A>
<Attribute_B>ValueB</Attribute_B>
</Object>
<Object Type="Type2">
<Attribute_A>ValueA</Attribute_A>
<Attribute_B>ValueB</Attribute_B>
</Object>
The schema for my destination document requires the end result to be:
<Object_Type_1>
<Type1AttributeA>ValueA</Type1AttributeA>
<Type1AttributeB>ValueB<Type1AttributeB>
</Object_Type_1>
<Object_Type_2>
<Type2AttributeA>ValueA</Type2AttributeA>
<Type2AttributeB>ValueB<Type2AttributeB>
</Object_Type_2>
The problem is that the element names, and their structure and
children elements
are different depending on the Type of the source elements.
I could use a lookup for the <Object_Type...> elements. This works
very well if only the name
of teh target element changes, but this gets very cumbersome
for managing the child elements and sub-trees. Any help greatly
appreciated.