cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting XML Embedded Within Single Node

Former Member
0 Kudos

Hi,

We are looking to consume a web service via PI which has a format as per the example below:

<Message>

  <f1>INSERT</f1>

  <f2><?xml version="1.0" encoding="ISO-8859-1"?><reports>xxxxxx</reports></f2>

  <f3>AZ12</f3>

</message>

i.e.. the second field f2 contains an entire XML string.

My question - Is it possible, within PI, to get the XML out of f2 and have it mapped onto a relevant structure which can then be passed out to the Receiver?

Cheers,

PaulC.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

Use xslt/java mapping to read XML string and convert the same into structure.

Thanks

Amit Srivastava

Former Member
0 Kudos

Thanks, Amit. Didn't think of XSLT. I'll give it a try

Answers (1)

Answers (1)

Former Member
0 Kudos

If you've never tried XSLT mapping in combination with normal PI GUI mappings, it can be very handy in situations like these. You can put it before or after your other mappings by defining sequence inside the Operation Mapping.

Here is a nice online tool to help you get your syntax right before uploading the XSLT into PI.

Free Online XSL Transformer (XSLT) - FreeFormatter.com

Former Member
0 Kudos

Cheers, Aaron. I have used XSLT before in combo with standard graphical mappings, and it works a treat. However, I hadn't thought of using it here, but it seems the way to go. Thanks for your response.

PaulC.