Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DOM, and (not) sorting by Attribute name

843834Apr 10 2003 — edited Apr 10 2003
I'm using XML files to store certian options for a program I'm making. The only problem though is that it seems as though the NamedNodeMap you get from calling node.getAttributes has the attributes in sorted order.

Namely it's sorted alphabetically.

This is not at all what I would like, it's pretty important that the attributes be in the order I wrote them, not sorted.

Is there another way I can do this?

I could always just have a text entry for the Attribute types, like
<?xml version="1.0" encoding="UTF-8"?>
<root>
AttributeType_1, AttributeType_2
<whatever AttributeType_1="whatever" AttributeType_2>
#And so on.
</root>

Or I could do any number of variations on that theme.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 8 2003
Added on Apr 10 2003
4 comments
795 views