cancel
Showing results for 
Search instead for 
Did you mean: 

Put entire input payload into a single output node

Former Member
0 Kudos

Hi experts,

is possible to put the entire input payload in a single output node manteining the xml tag structure?

My need is to put this input payload:

<InitialVehicleInformation>

   <Header>

         <Reference/>

         <Version/>

         ......

   </Header>

    <Body>

          <Field1/>

          <Field2/>

          ...

    </Body>

</InitialVehicleInformation>

into a <node>    </node> contained in the output structure.

Result must be like this:

<node>

<InitialVehicleInformation>

   <Header>

        <Reference/>

     .......

   </Header>

    <Body>

        <Field1/>

        .......

    </Body>

</InitialVehicleInformation>

</node>

Thanks

Fabio

Accepted Solutions (1)

Accepted Solutions (1)

iaki_vila
Active Contributor
0 Kudos

Hi Fabio,

If your PI version is below than PI 7.1, you always can use a XSL mapping:

An easy XSL code:


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

<xsl:stylesheet version="1.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">

<node>

<xsl:copy-of select="//InitialVehicleInformation"/>

</node>

</xsl:template>

</xsl:stylesheet>

On other cases, the previous suggestions are the best.

Regards.

Former Member
0 Kudos

Hi Inaki,

I think I adore you!! 

It's exactly what I needed! it works perfectly!

thanks

Fabio

Answers (2)

Answers (2)

former_member186851
Active Contributor
0 Kudos

Hello Fabio,

use Return as XML option.

Map the root node to the field in which entire XML needs to be passed and select Return as XML option.

Former Member
0 Kudos

Hi,

this option is available on PI 7.0?

Fabio

ravicarpenter
Active Participant
0 Kudos

Unfortunately, AFAIK its available 7.1 onwards, for the lower version you'll probably have to use java udf. For that search the SDN there are a few articles giving you detailed java code

ravicarpenter
Active Participant
0 Kudos

Hi,

Check the following

Former Member
0 Kudos

Hi,

unfortunately I'm on PI 7,0, sorry I didn't mentioned it.

Fabio