cancel
Showing results for 
Search instead for 
Did you mean: 

Convert XML Subelements to String

Former Member
0 Kudos

I have to submit a request to a web service that takes a string element that is actually xml; but of unspecified schema thus the string. But, I will have the XML and will need to convert it to a string and wrap it in a CDATA element. Is there a transform function or simple XSLT that can do this for me?

Accepted Solutions (0)

Answers (3)

Answers (3)

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Carlton,


But, I will have the XML and will need to convert it to a string

This part is already answered by the posters above


and wrap it in a CDATA element.

Use a constant along with concat to wrap the cdata. For example:

Constant1: <![CDATA[

Constant2: ]]>

Regards,

Mark

former_member182412
Active Contributor
0 Kudos

Hi Carlton,

Adding to Raghu's reply, map root node to the target field and return as xml and replace the xml definition like below.

Regards,

Praveen.

former_member186851
Active Contributor
0 Kudos

You wish to convert entire XML to string.

Try with Return as XML option in the mapping.

SAP PI 7.1 Mapping Enhancements Series: Copy XML Subtree