Skip to Content

Special Characters - XSLT Mapping

Hi all,

I have out of a sales order situations, where my business people enter some wired stuff into texts.

The information will be viewable also in the source message properly:

The Source message is UTF-8:

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

In my XSLT I have configured, that this field should be encapsultated in CDATA section:

<xsl:output method="xml" omit-xml-declaration="yes" cdata-section-elements="proc3:P_INTCOMMENTLB-VARCHAR2-IN" indent="yes"/>

<!-- some other code -->

<xsl:variable name="tdid0002"><xsl:apply-templates select="E1EDKT1[TDID='0002']/E1EDKT2"/></xsl:variable>

<proc3:P_INTCOMMENTLB-VARCHAR2-IN><xsl:value-of select="substring($tdid0002,1,500)"/></proc3:P_INTCOMMENTLB-VARCHAR2-IN>

<!-- some other code -->

<xsl:template match="E1EDKT2">

  <xsl:if test="position() &gt; 1"><xsl:value-of select="'&#xD;'" /></xsl:if>  

  <xsl:value-of select="TDLINE"/>

</xsl:template>

<!-- some other code -->

If I look at the result message, it became invalid:

I want to send the information to the receiver using Web Service and their server proxy (not SAP) is refusing it.

Any ideas who to fix it?

Regards

   Helmut

SDN1.gif (24.9 kB)
SDN2.gif (33.2 kB)
SDN3.gif (15.3 kB)
SDN4.gif (9.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 16, 2015 at 07:07 AM

    Hi Helmut,

    Have you tried with disable-output-escaping="yes" ?

    Also if you have the PI with the SP necessary you can try the instruction xsl:character-map, check this link Disable-output-escaping and xsl:character-map

    Regards,

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 16, 2015 at 09:25 AM

    Hi all,

    the problem is, that xsl:character-map is not available in XSLT 1.0 :-(

    disable-escaping does not work for some reason ...

    The "positive list" is also not good as we want to see regular Chinees and Japanese characters.

    But I have solved it now like this:

    <xsl:template match="E1EDKT2">

      <xsl:if test="position() &gt; 1"><xsl:value-of select="'&#xD;'" /></xsl:if>  

      <xsl:value-of select="translate(TDLINE,'&#x1F603;','')" />

      

    </xsl:template>

    Whenever I have another "bad guy" I need to add is as well... But since one your it was the 2nd time ... So I assume it's an acceptable approach.

    Regards

       Helmut

    Add comment
    10|10000 characters needed characters exceeded