cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Pbs with <!CDATA[ ..... ]]>

Former Member
0 Kudos

Hi all,

I must recept and send messages matches following patterns :

<Message>

<Header>

....

</Header>

<Data>

<!CDATA[

....

<XML Message "Content" here>

....

]]>

</Data>

</Message>

Do someone know the both following :

1) how to get the XML message included in CDATA tag ?

2) how to create the full message with CDATA node from a Content XML message

Thanks a lot

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member190313
Active Participant
0 Kudos

hi

you will have to use java mapping for this purpose

Write a program in java that will f

- first read the input XML

- traverse through the nodes

- craete the output structure. you get the XML message included in CDATA tag and will also be able create the full message with CDATA node from a Content XML message

code is very simple

go through foll link

/people/thorsten.nordholmsbirk/blog/2006/08/10/using-jaxp-to-both-parse-and-emit-xml-in-xi-java-mapping-programs

any queries in java mapping do ask

regards

Sheetal

Former Member
0 Kudos

Thanks for your help however I must do it with XSLT mapping.

I manage to add <![CDATA[ and ]]>

using :

<xsl:element name="Data">

<xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[]]></xsl:text>

<xsl:copy>

<xsl:apply-templates select="@*|node()"/>

</xsl:copy>

<xsl:text disable-output-escaping="yes"><![CDATA[]]]]></xsl:text>

<xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>

</xsl:element>

but I don't manage yet to do the contrary : extract XML nodes included between <![CDATA[ and ]]>

Can somebody help me ?

Thanls a lot