cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Adding comment line in XML message

Former Member
0 Likes
4,943

Hi,

Does anyone know how to add a comment line in outgoing XML message from XI? Using graphical mapping or java or adapter module?

Something like .....

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

<! this is a comment>

<record>

Thanks

Pushpinder

View Entire Topic
Former Member
0 Likes

You can transform your XML with an XSLT transformation:

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

<xsl:output encoding="utf-8" indent="no" method="xml" version="1.0"/>

<xsl:param name="COMMENT"/>

<xsl:preserve-space elements="*"/>

<xsl:template match="/">

<xsl:comment>

<xsl:value-of select="$COMMENT"/>

</xsl:comment>

<xsl:copy>

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

</xsl:copy>

</xsl:template>

<xsl:template match="@*|node()">

<xsl:copy>

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

</xsl:copy>

</xsl:template>

</xsl:transform>

Best wishes,

Jan