XSLT can be used as a workaround to get the xml sequencing correct.
What about XML to JSON, have anyone faced similar sequencing issue in JSON output?I am seeing an issue, where the JSOn output fields are not in sequence after using "Apply JSON Transformation" assetion, with "xml to Json" selected.
One of my client is looking for solution, if there is any sequencing issue with XML to JSON using "Apply JSON Transformation" assertion.
Did you try Changing transformation convention from standard to JSONML
From the JSON spec at http://json.org:
An object is an unordered set of name/value pairs.
However, the XML schema might be imposing an order which the conversion from JSON might not respect; which seems to be the issue you're encountering. So for this, which it seems like you're aware of already, we have a workaround. You can apply a XSL Transformation to the policy to order things how you want as our Gateway doesn't preserve the element order.
Apply XSL Transformation Assertion - CA API Gateway - 9.1 - CA Technologies Documentation
I have used "Apply JSON Transformation" assertion for JSON to XML conversion followed by xslt.
Now trying to convert XML response to JSON with proper sequence using XSLT.
Is there any custom xslt available to use it or any sample would be useful.