cancel
Showing results for 
Search instead for 
Did you mean: 

special charater & issue while generate XML message in PI

Former Member
0 Kudos

Hi Experts,

I got error when i run the XML report with Short Name Tag.

Error :

The XML page cannot be displayed

Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.

Whitespace is not allowed at this location. Error processing resource.

<ShortName>Enter a description for this item.DEWDE" , & ... </ShortName>

Accepted Solutions (1)

Accepted Solutions (1)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Ally,

             You need to replace the XML invalid characters (using UDF or standard function in message mapping within SAP-PI). The list of these invalid characters can be found in this link in "entity references" section

http://www.w3schools.com/xml/xml_syntax.asp .

Regards

Anupam

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for your answers.

The problem is resolved by using java code.

replaceAll("&", "&amp;").replaceAll("<", "&lt;")

If there is a a character like "<" inside an XML element, it will generate an error because the parser interprets it as the start of a new element.

Only the characters "<" and "&" are strictly illegal in XML. The greater than character is legal, but it is a good habit to replace it.

ambrish_mishra
Active Contributor
0 Kudos

HI Ally,

I assume, the report generates XML and sends the data to PI and it fails in PI while parsing the XML due to invalid characters.

You need to check from source on what invalid characters are existing in the underlying tables. Try and fix at the source first, otherwise you can use Java mapping to ignore these.

Hope it helps!

Ambrish