cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT mapping not working for escapeCharacters.

Former Member
0 Kudos

Hi,

I have an issue with escape characters in PI.

Now I'm trying with CCFile. Binary. (In production we will use FTP as CC.)

Scenarie: SAP --> MyParty.

MyParty needs to have the xml Freetext tag as this:

.....

<FreeText><![CDATA[<b> HELLO WORLD </b>]]></FreeText>

.........

I have a xslt mapping that like this (To Add the CDATA section.)

Source file is like this: &lt;b&gt; HELLO WORLD &lt;/b&gt;

<?xml version='1.0'?>

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

<xsl:output method="xml" encoding="utf-8" standalone="yes" cdata-section-elements="FreeText" />

<xsl:template match="@|">

<xsl:copy >

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

</xsl:copy>

</xsl:template>

</xsl:stylesheet>

When I use this xsl mapping in my favorite xslt tool everyting looks nice but when I use it in PI it looks like this in file on disk:

<FreeText><![CDATA[ &lt;b&gt; HELLO WORLD &lt;/b&gt; ]]></FreeText>

I don't whant escape characters in my target file. Any Pointers ?

//Martin

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member200962
Active Contributor
0 Kudos
MyParty needs to have the xml Freetext tag as this:
.....
<FreeText><![CDATA<b> HELLO WORLD </b>]></FreeText>
.........

When I use this xsl mapping in my favorite xslt tool everyting looks nice but when I use it in PI it looks like this in file on disk:
<FreeText><![CDATA <b> HELLO WORLD </b> ]></FreeText>

I am not able to make what output are you exactly looking for.....your above two statements look the same to me

Former Member
0 Kudos

Hi,

Sorry, SDN forum do not support "showing text as entered" . It will always try to Unescape

(I removed the "&" sign and two ending "]" to be abel to display it understandable. )

When I use this xsl mapping in my favorite xslt tool everyting looks nice but when I use it in PI it looks like this in file on disk:

<FreeText><![CDATA[ lt; b gt; HELLO WORLD lt;/ b gt; ></FreeText>

Br Martin

former_member187339
Active Contributor
0 Kudos

Hi Martin,

You required


<FreeText><![CDATA[ <b> HELLO WORLD </ b>]] ></FreeText>

and you got this in XI


<FreeText><![CDATA[ lt; b gt; HELLO WORLD lt; /b gt;]] ></FreeText> ( i removed &)

Have you seen the source of the XML output of XI? It will look like the one you mentioned but if you open that in browser it will be as per your requirement

Have you seen the source of output file created by you XML tool?

Regards

Suraj

Former Member
0 Kudos

Hi,

If I open the output file from XI in NotePad, there are lots of escape characters.

(If I open the same file in browser it will display Unescaped characters....like I want.)

My ReceiverSystem cannot handle escape characters. It needs "<" ">" signs.

Br Martin

Need some help here...

Edited by: Martin Andersson on Nov 13, 2009 8:31 AM