Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT Transformation error: Non-canonical structure of element name

Former Member
0 Kudos

Good day experts,

I have recently started using xslt, and came upon the following demo in the sdn.

http://wiki.sdn.sap.com/wiki/display/ABAP/XMLXSLTwith+ABAP

I have retrieved the example xml files from airplus.com, as per the instructions, and implemented the code.

When I test the xslt transformation in se80, it transforms correctly.

However, when I run the program, I get the following error.

CX_XSLT_FORMAT_ERROR

Transformation error: Non-canonical structure of element name XML_OUTPUT

Is there an error in the example that I am not aware of?

Thanks in advance,

Johan Kriek

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello,

I am also facing the same error in this tutorial:

Transformation error: Non-canonical structure of element name XML_OUTPUT

Any help will be really appreciated

Regards,

Jai

8 REPLIES 8

Former Member
0 Kudos

Good day,

Can anyone provide me with any feedback?

Thanks once again

Regards,

Johan Kriek

0 Kudos

Have you test different file format ( UTF8 / unicode). May be some characters are not well evaluated....

Former Member
0 Kudos

Hello,

I am also facing the same error in this tutorial:

Transformation error: Non-canonical structure of element name XML_OUTPUT

Any help will be really appreciated

Regards,

Jai

Found the solution.

You rename the tag <XML_OUTPUT> to anything else like <TEST>. And Hurray!!! it works.

It looks like SAP is using this name internally somewhere so we are getting error when we are using same name.

Anyways the problem is solved.

Regards,

Jai

pepl
Active Participant
0 Kudos

I have a reply from SAP:

Names starting with "XML..." are reserved and must be escaped (in JSON and in XML) to "X-ML...".

An ABAP field with Name "XML..." that will serialized to JSON will automatically escaped to "X-ML..." and vice versa.

Sandra_Rossi
Active Contributor

Reference in ABAP doc - asXML :

  • [...] characters are replaced in accordance with the following table:
  • [...]
  • [ABAP type:] "XML" as the first three characters in any combination of uppercase and lowercase letters.
  • [XML name:] "X-ML" in the appropriate combination of uppercase and lowercase letters

pepl
Active Participant
0 Kudos

@sandra.rossi exactly! To me it looks so weird restriction.

We have swagger JSON - they use xml as json object name.

If I do JSON to JSON transformation now I have also to control this name attribute. Such non-logical restriction. I hope ABAP team will redesign it soon or later.

Sandra_Rossi
Active Contributor
0 Kudos

SAP did the ABAP to JSON transformations via sXML, that's why... So, yes, a native ABAP to JSON transformation would be welcome (performance, restrictions...), a day, maybe, maybe...