I have to generate a XML based on structures, I use Simple Transformation to generate it.
It seems that while performing the serialization there is an automatic sorting of the attributes of the XML.
Example, sample of ST :
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates" xmlns:ddic="http://www.sap.com/abapxml/types/dictionary" xmlns:def="http://www.sap.com/abapxml/types/defined" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <tt:root name="TOP" type="ddic:ZZ_STRUCTURE_XML"/>
<tt:template>
<Element1 tt:ref="TOP">
<tt:attribute name="Name" value-ref="FIELD01"/>
<tt:attribute name="Version" value-ref="FIELD02"/>
<tt:attribute name="Tag" value-ref="FIELD03"/>
</Element2>
</tt:template>
</tt:transform>
Expected result (XML) :
<?xml version="1.0" encoding="utf-8"?>
<Element1 Name="xx" Version="xx" Tag="xx"/>
Actual result (XML) :
<?xml version="1.0" encoding="utf-8"?>
<Element1 Name="xx" Tag="xx" Version="xx"/>
Is there a way to remove the alphabetical sorting of the attributes using ST ? I know that this unexpected sort doesn’t have impact for the parsing of the XML but still it is not the expected result.