cancel
Showing results for 
Search instead for 
Did you mean: 

Name Value pairs

Former Member
0 Kudos

Hi All,

I am trying to achieve the following using the graphical mapping tool.

Source:

rows..................0-unbounded

.....indicator1......1-1

.....indicator2......1-1

.....indicator3......1-1

Target:

Attributes...........0-unbounded

.....constant............1-1

.....field...................1-1

Sample Source xml:

<rows>

....<indicator1>Blue</indicator1>

....<indicator2>Large</indicator2>

....<indicator3>Hot</indicator3>

</rows>

In the target structure, I want to create name value pairs where constant1 is assigned constant 'Colour' and field1 is assigned indicator1.

My issue is that in the target structure, I also want to create new name value pairs for each of the values in the source. This is illustrated in the target document example below:

<Attributes>

......<constant>"Constant"</constant>

......<field>indicator1</field>

</Attributes>

<Attributes>

......<constant>"Constant"</constant>

......<field>indicator2</field>

</Attributes>

<Attributes>

......<constant>"Constant"</constant>

......<field>indicator3</field>

</Attributes>

An example would be (using the sample values above):

<Attributes>

......<constant>Color</constant>

......<field>Blue</field>

</Attributes>

<Attributes>

......<constant>Size</constant>

......<field>Large</field>

</Attributes>

<Attributes>

......<constant>Wash</constant>

......<field>Hot</field>

</Attributes>

Can this be achieved in the graphical mapping tool before I turn to xslt?

Please help!

Regards,

JS

Accepted Solutions (0)

Answers (1)

Answers (1)

dharamveer_gaur2
Active Contributor
0 Kudos

You can achive this using Value Mapping.

Former Member
0 Kudos

Hi - I have marked as helpful answer but I fear that I did not make it clear in my original question...

The JDBC fragment below needs to be converted to the XML fragment... I am having difficulty doing this in the graphical interface.

Thank you for your helpful answer up to now.

<?xml version="1.0" encoding="UTF-8"?>

<ns0:Debtor_JDBC xmlns:ns0="urn:finance">

<row>

<NO_BUNDLE>1</NO_BUNDLE>

<PROMPT_SHIP_TO>0</PROMPT_SHIP_TO>

</row>

</ns0:Debtor_JDBC>

<?xml version="1.0" encoding="UTF-8"?>

<MASTER>

<Debtors>

<Attributes>

<attributetype IsValueSet="1">1</attributetype>

<name IsValueSet="1">No Bundle</name>

<value IsValueSet="1">1</value>

</Attributes>

<Attributes>

<attributetype IsValueSet="1">1</attributetype>

<name IsValueSet="1">PromptForAddress</name>

<value IsValueSet="1">0</value>

</Attributes></Debtors>

</MASTER>