Skip to Content
0
Former Member
Oct 27, 2005 at 09:27 AM

Mapping descrete values to childs of a complex type array

22 Views

Hi all,

I have the following flat XML file with descrete values as source:

<MaterialRequest_MT>

<number><b>number1</b></number>

<shortdesc><b>shortdesc1</b></shortdesc>

<projectname><b>projectname1</b></projectname>

</MaterialRequest_MT>

My problem is how to map this file to the following destination file where the single values of the source file are values of a child element in a list of complex elements:

<ns0:query xmlns:ns0="http://QueryService">

<ns0:attributes>

<ns0:item>

<ns0:key>

<ns0:system>MP</ns0:system>

<ns0:name>PartNumber</ns0:name>

</ns0:key>

<ns0:value><b>number1</b></ns0:value>

</ns0:item>

<ns0:item>

<ns0:key>

<ns0:system>MP</ns0:system>

<ns0:name>Description</ns0:name>

</ns0:key>

<ns0:value><b>shortdesc1</b></ns0:value>

</ns0:item>

<ns0:item>

<ns0:key>

<ns0:system>MP</ns0:system>

<ns0:name>Project</ns0:name>

</ns0:key>

<ns0:value><b>projectname1</b></ns0:value>

</ns0:item>

</ns0:attributes>

</ns0:query>

As you see I don't have a source array over which to iterate. This makes it impossible to me to map the source values to the destination items.

Any help is very appreciated!

Thanks!

Denis