Save Java propertyfile into XML format in specific order -


i'm looking way save properties in specific order. property-class saves values unsorted :/ important me save them in specific order. way when saving xml format storetoxml()? want them in order in have inserted them.

for example:

put("name","frost"); put("surname","byte"); put("age","18"); put("country","germany"); 

gets stored in order:

<entry key="name">frost</entry> <entry key="country">germany</entry> <entry key="surname">byte</entry> <entry key="age">18</entry> 

any ideas?

properties wrong approach achieve this. properties extends hashtable hashmap , therefore not retain order of properties inserted.

you have use technology write xml files have order. e.g. can use jaxb create xml files directly involved objects.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -