为什么set属性反向出现?

时间:2012-11-30 01:11:25

标签: java xml dom

  

可能重复:
  Control order of XML attributes in outputed file in Java

我有这段代码:

 Element node = testDoc.createElement("image_file");
 node.setAttribute("id", count);
 node.setAttribute("file_name", fileNameCombinedWithPNG);

我的XML在filename之前有id,无论我做什么,即使我切换设置属性的顺序,XML的输出看起来都是一样的,即它是:< / p>

image_file filename="xyz" id="1" as but I want is image_file id="1" filename="adfx"

0 个答案:

没有答案