Hello,
I am working on xerces parser in java to generate an xml document. Everything is fine with it except that if I add three attributes to a node, they will be shown in alphabetic order, not in the order that I created the attributes.
I used two different ways of creating attribute, but non of them worked fine.
First way:
PHP Code:
fac_item.setAttribute("lastName",lastname); // Attach lastname attribute to Faculty element
fac_item.setAttribute("firstname",firstname); // Attach firstname attribute to Faculty element
fac_item.setAttribute("departmentID",dept_id); // Attach dept_id attribute to Faculty element
This code produces departmentID first, then firstname and finally lastname, while I want it in the order I wrote the code.
I used the setAttributeNode method way of creating an attribute, but it produced the same output, too.
Any idea how I can change the order?
Thanks in advance.