Ok, I figured out why I am getting random ordering. Sling is returning the
nodes in the correct order in the response (I should have checked that
-sorry). But when converting the response to a JSONObject, the child nodes,
which are also represented as JSONObjects are randomized. This is per the
JSON spec:
An object is an unordered set of name/value pairs.
So, why are you not returning the child nodes as a JSONArray? This would
preserve order and seems to be a far more intuitive structure.
JSONOBject
JSONArray[]
JSONObject
JSONArrray[]
JSONObject
JSONArray[]
--
View this message in context:
http://apache-sling.73963.n3.nabble.com/Getting-ordered-nodes-tp4030376p4030493.html
Sent from the Sling - Users mailing list archive at Nabble.com.