Skip to Content
0

Call Transformation - cx_xslt_runtime_error - character reference not supported character range

Mar 20 at 03:51 PM

39

avatar image
Former Member

Hello,

I have a problem with a XSL Tranformation and a special masked character.

I have an XML. The XML document contains the masked character:

128073 (It is an imoticon - White Right Pointing Backhand - and part of Unicode 6.0)

When I call the command CALL TRANSFORMATION I will get an cx_xslt_runtime_error with the message: "character reference '128073' evaluates to an not supported character range".

Does anybody have an idea what I have to do? Is, it a problem on the Application Server?

DATA:<br>ol_ixml  type ref to if_ixml,<br>ol_stream_factory type ref to if_ixml_stream_factory,<br>ol_encoding  type ref to if_ixml_encoding,<br>ol_srcstream  type ref to if_ixml_istream,<br>ol_resstream type ref to if_ixml_ostream,<br>vl_xdata  type xstring.
....
ol_ixml = cl_ixml=>create( ).<br>ol_stream_factory = ol_ixml->create_stream_factory( ).
  ol_encoding = ol_ixml->create_encoding( character_set = 'utf-8'<br>  byte_order = 0 ).<br>  ol_srcstream = ol_stream_factory->create_istream_xstring( string = vl_xdata )<br>ol_resstream = ol_stream_factory->create_ostream_xstring( string = vl_data_out ).<br>ol_resstream->set_encoding( encoding = ol_encoding ).
  try.<br>call transformation zrmx3_convert_encoding<br>source xml ol_srcstream<br>  result xml ol_resstream.
catch cx_xslt_runtime_error into ol_xslt.<br>....

Best regards
Uwe

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Sandra Rossi Mar 20 at 05:19 PM
0

EDIT : 128073 corresponds to the character U+F449. It's part of the Supplementary Private Use Area-A (U+F0000–U+FFFFD). It has not a standard meaning.

In fact, you are talking about the character U+1F449 (https://www.fileformat.info/info/unicode/char/1f449/index.htm). Unfortunately SAP systems are Unicode UCS-2 all characters occupy 2 bytes, so all characters above U+FFFF will lead to an incorrect interpretation if you store them in a STRING variable.

Maybe you could let (or convert) your input stream in UTF-8 as an XSTRING variable, and try again...

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hello Sandra,

Thank's for your response.

There is also an information in the CALL TRANSFORMATION documentation:

https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcall_transformation.htm

The library used also determines the character set that is supported. The iXML Library supports UCS-2; the sXML Library supports UTF.

I think there is no way to process an XSLT with not supported characters.

Best Regards
Uwe

1

Thanks. You might remove those characters, via a code page conversion, and by replacing invalid characters with # for instance.

0