IBM Support

XML attributes are in a different order when using Native XML Schema than in the XML Schema.

Troubleshooting


Problem

XML attributes may be displayed/created in a different order when using a Native XML Schema in an ITX map when compared to the order in the original XML Schema.

Symptom

XML attributes are in a different order when using Native XML Schema than in the XML Schema.

Cause

According to the XML specification, the order of attribute specifications in a start-tag or empty-element tag is not significant. Please see the following link.

https://www.w3.org/TR/REC-xml/#sec-starttags

Attributes can appear in any order.


Native schema displays the attributes in alphabetical order.

Environment

Using Native XML Schema which uses the Xerces parser and the XML schema for a Typetree.

Diagnosing The Problem

Looking at the fields in a card of an IBM Transformation Extender (ITX) Map the sequence of the XML attributes are in a different order than they are in the actual XML Schema.

Resolving The Problem

You could use the ITX XML Schema importer instead of using the Native XML Schema. The ITX XML Schema importer will create an editable Typetree.

If the data order is important to the application processing the XML, you should use elements in a sequence.

[{"Product":{"code":"SSVSD8","label":"IBM Transformation Extender"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"--","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"},{"code":"PF035","label":"z\/OS"}],"Version":"8.4.1.0;8.4.1.1;8.4.1.2;8.4.1.3;8.4.1.4;8.4.1.5;9.0.0.0;9.0.0.1;9.0.0.2","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Document Information

Modified date:
16 June 2018

UID

swg22013997