cancel
Showing results for 
Search instead for 
Did you mean: 

DataType creation

Former Member
0 Kudos

Hi Experts,

kindly explain how to create the data type using the below xml.

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

<gesmes:Envelope xmlns:gesmes="http://www.gesmes.org/xml/2002-08-01" xmlns="http://www.ecb.int/vocabulary/2002-08-01/eurofxref">

<gesmes:subject>Reference rates</gesmes:subject>

<gesmes:Sender>

  <gesmes:name>European Central Bank</gesmes:name>

</gesmes:Sender>

<Cube>

  <Cube time='2014-04-08'>

   <Cube currency='USD' rate='1.3774'/>

   <Cube currency='JPY' rate='140.90'/>

   <Cube currency='BGN' rate='1.9558'/>

   <Cube currency='CZK' rate='27.415'/>

   <Cube currency='DKK' rate='7.4659'/>

   <Cube currency='GBP' rate='0.82420'/>

   <Cube currency='HUF' rate='305.26'/>

   <Cube currency='LTL' rate='3.4528'/>

   <Cube currency='PLN' rate='4.1704'/>

   <Cube currency='RON' rate='4.4555'/>

   <Cube currency='SEK' rate='8.9653'/>

   <Cube currency='CHF' rate='1.2200'/>

   <Cube currency='NOK' rate='8.2360'/>

   <Cube currency='HRK' rate='7.6380'/>

   <Cube currency='RUB' rate='48.9420'/>

   <Cube currency='TRY' rate='2.8855'/>

   <Cube currency='AUD' rate='1.4760'/>

   <Cube currency='BRL' rate='3.0304'/>

   <Cube currency='CAD' rate='1.5055'/>

   <Cube currency='CNY' rate='8.5353'/>

   <Cube currency='HKD' rate='10.6809'/>

   <Cube currency='IDR' rate='15547.28'/>

   <Cube currency='ILS' rate='4.7950'/>

   <Cube currency='INR' rate='82.8162'/>

   <Cube currency='KRW' rate='1445.29'/>

   <Cube currency='MXN' rate='17.8587'/>

   <Cube currency='MYR' rate='4.4628'/>

   <Cube currency='NZD' rate='1.5885'/>

   <Cube currency='PHP' rate='61.604'/>

   <Cube currency='SGD' rate='1.7263'/>

   <Cube currency='THB' rate='44.527'/>

   <Cube currency='ZAR' rate='14.4149'/>

  </Cube>

</Cube>

</gesmes:Envelope>

Regards

Kiran

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Kiran,

I hope your question is about adding prefix 'gesmes' in datatype

If the above xml is coming form source then you can normally create datatype by removing prefix 'gesmes' as below.

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

<Envelope>

<subject>Reference rates</subject>

<Sender>

  <name>European Central Bank</name>

</Sender>

<Cube>

  <Cube time='2014-04-08'>

   <Cube currency='USD' rate='1.3774'/>

   <Cube currency='JPY' rate='140.90'/>

   <Cube currency='BGN' rate='1.9558'/>

   <Cube currency='CZK' rate='27.415'/>

   <Cube currency='DKK' rate='7.4659'/>

   <Cube currency='GBP' rate='0.82420'/>

   <Cube currency='HUF' rate='305.26'/>

   <Cube currency='LTL' rate='3.4528'/>

   <Cube currency='PLN' rate='4.1704'/>

   <Cube currency='RON' rate='4.4555'/>

   <Cube currency='SEK' rate='8.9653'/>

   <Cube currency='CHF' rate='1.2200'/>

   <Cube currency='NOK' rate='8.2360'/>

   <Cube currency='HRK' rate='7.6380'/>

   <Cube currency='RUB' rate='48.9420'/>

   <Cube currency='TRY' rate='2.8855'/>

   <Cube currency='AUD' rate='1.4760'/>

   <Cube currency='BRL' rate='3.0304'/>

   <Cube currency='CAD' rate='1.5055'/>

   <Cube currency='CNY' rate='8.5353'/>

   <Cube currency='HKD' rate='10.6809'/>

   <Cube currency='IDR' rate='15547.28'/>

   <Cube currency='ILS' rate='4.7950'/>

   <Cube currency='INR' rate='82.8162'/>

   <Cube currency='KRW' rate='1445.29'/>

   <Cube currency='MXN' rate='17.8587'/>

   <Cube currency='MYR' rate='4.4628'/>

   <Cube currency='NZD' rate='1.5885'/>

   <Cube currency='PHP' rate='61.604'/>

   <Cube currency='SGD' rate='1.7263'/>

   <Cube currency='THB' rate='44.527'/>

   <Cube currency='ZAR' rate='14.4149'/>

  </Cube>

</Cube>

</Envelope>

If the above xml is for targte side then after mapping you need add a java mapping to modify the payload by adding namespace 'gesmes'.

Regards,

Sudhasree

Former Member
0 Kudos

Hi sudha,

i Have created ths same structure, when i have placed the xml in the test tab we are getting the xlm not valid.

Regards

kiran


0 Kudos

Hi Kiran,

Is it throwing an error or the nodes are shown in red without throwing error.

If the nodes are shown in red - you can ignore it and test the mapping.

If it showing an error - post the screen shot of error

regards,

Sudhasree

Former Member
0 Kudos

Hi Sudha,

The nodes are shown error and i have created the structure below

Regards

kiran

0 Kudos

Hi Kiran,

If the nodes are shown in red then that will be not a issue. Try to test the mapping it will give output.

Regards,

Sudhasree

Former Member
0 Kudos

Hi Kiran

Use any xml manipulation tool like Altova XML SPY or Stylus studio and convert the xml to XSD schema.

Use that XSD and create external definition in PI and use the same in mapping.

That will be the easiest way.

Answers (0)