on 10-27-2005 10:27 AM
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
Hi Suneel,
unfortunately I have actually 17 elements to add. I just took three to simplify my problem. My problem is now that the maximum number of input parameters is limited to 9
Any clue how to solve this?
Thanks!
Denis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
<b>Mapping for item node:</b>
Create a user defined function with 3 input parameters for number,shortdesc,projectname. In the user defined function check whether each input value exists or not.if the input value exists add the code 'result.addValue("")'.if the 3 input values exist then 3 item nodes will be created.
<b>Mapping for elements</b>
Create another user defined function with 3 parameter.take the 3 input values same as the above function. Check whether parameter a value exists in the element and write <b>result.addValue(a[0]);</b>Do similarly for b and c parameters. After defining this function add standard node function 'splitbyvalue' and assign to the target.
USedefined function---->splitbyvalue--
>value.
I guess this solution is a bit complex.....hope it works
regards
Suneel
Message was edited by: Suneel
Message was edited by: Suneel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.