Possible Duplicate:
Control order of XML attributes in outputed file in Java
I have this code:
Element node = testDoc.createElement("image_file");
node.setAttribute("id", count);
node.setAttribute("file_name", fileNameCombinedWithPNG);
My XML has filename
before the id
, no matter what I do, even when I switch the orders of the set attributes, the output of the XML looks the same, i.e the it's:
image_file filename="xyz" id="1" as but I want is image_file id="1" filename="adfx"