cancel
Showing results for 
Search instead for 
Did you mean: 

JAVA Mapping: Handle Special characters like u00E4,u00FC an so on

Former Member
0 Kudos

Hi everybody,

we have a JAVA Mapping that gerenates text nodes with special characters.

The generated XML is later used in an graphical message-mapping.

During runtime we ge the trace/error:

com.sap.aii.utilxi.misc.api.BaseRuntimeException: Fatal Error: 
com.sap.engine.lib.xml.parser.ParserException: Unsupported character: 31(:main:, row:1, col:2498) at 
com.sap.aii.mappingtool.tf3.Transformer.checkParserException

Does anybody know, how to modify the JAVA-mapping to have a workaound for this problem?

Thanks

Regards Mario

Edited by: Mario Müller on Jul 22, 2008 4:33 AM

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Mario,

As java mapping does not validate the xml,the output gets created but if u have to use the xml structure,the u will have to include the following.

Assume u r using a write method to write the output xml,then

check for tspecial charactters like &,<,>.' etc and replce them as shown below

private void write(String s)

{

//Traverse through the string

for (int i=0 ; i < string.length();i++)

{

String s1 = data.substring(i, i + 1);

if (s1.equals("&"))

{

write ("&amp;");

}

else if (s1.equals("<"))

{

write("&lt;");

}

else if (s1.equals(">"))

{

write("&gt;");

}

else if (s1.equals("\""))

{

write("&quot;");

}

else if (s1.equals("'"))

{

write("&apos;");

}

else

{

write(s1);

}

}

}

Should help u out

Edited by: Mohd Tauseef Ibrahim on Jul 22, 2008 11:08 AM

Edited by: Mohd Tauseef Ibrahim on Jul 22, 2008 11:09 AM

Former Member
0 Kudos

Hi,

Check this blog i think it will be useful for u.

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/9420 [original link is broken] [original link is broken] [original link is broken]

Regards,

Sharanya.

Former Member
0 Kudos

Hi,

it is not useful. Please check your answers before writing your answer.

Thanks Regards Mario

Former Member
0 Kudos

Hi,

maybe this document is helpful:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79...

and also this thread:

Regards

Patrick

Edited by: Patrick Koehnen on Jul 22, 2008 10:42 AM