cancel
Showing results for 
Search instead for 
Did you mean: 

RE: Help on XSLT/JAVA mapping XML to string ( PI 7.0)

former_member189441
Active Participant
0 Kudos

Hi Experts,

I am doing RFC to WebService synchronous scenario. As part of this, I need to send entire input xml file(RFC) as string ( webservice message field) to Webservice.

I am using PI 7.0..so options are Java Mapping and XSLT. I have created the java mapping and its working

Problem : But java mapping replacing french characters as below.

French : Chargé à: MONTRÉAL

Replacing as : Chargé à : MONTRÉAL

So other alternative is going to XSLT mapping. Could you please provide XSLT code for the same.

Input xml:

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

<root>

<A>

Chargé à: MONTRÉAL

</A>

</root>

expected output:

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

<Title>

<?xml version="1.0" encoding="UTF-8"?><root><A> Chargé à: MONTRÉAL</A></root>

</Title>

Note: Above mentioned xml is just for an example and actual xml contains around 100 fields

Message was edited by: Moderator - Please do not use words like 'Urgent'

Accepted Solutions (1)

Accepted Solutions (1)

udo_martens
Active Contributor
0 Kudos

Hi,

<?xml version="1.0" encoding="ISO-8859-1"?>

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

<xsl:output encoding="ISO-8859-1"/>

<xsl:template match="/">

  <Title>

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

   <xsl:copy-of select="*"/>

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

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

  </Title>

</xsl:template>

</xsl:stylesheet>

I think you need latin code instead of UTF-8

Regards,

Udo

Answers (4)

Answers (4)

former_member189441
Active Participant
0 Kudos

Hi All,

Thanks for your prompt response. Udo's xslt mapping is super and it solved my problem.and yes, as you all mentioned the issue is with encoding. I have used ISO-8859-1 and now french characters showing correctly.

Former Member
0 Kudos

use the folllowing link to conver the special characters.

http://www.htmlescape.net/javaescape_tool.html

anupam_ghosh2
Active Contributor
0 Kudos

Hi Krish,

                 Can you post the java mapping code you wrote? I think the encoding scheme needs to be corrected while producing the output.

Regards

Anupam

VijayKonam
Active Contributor
0 Kudos

This is nothing to do with Java mapping or XSLT mapping. You would have to use the correct code page and encoding while generating your target XML.

VJ