OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Existing libraries/mechanisms for alphabetically sorting and formatting

[ Lists Home | Date Index | Thread Index ]
  • To: <xml-dev@lists.xml.org>
  • Subject: Existing libraries/mechanisms for alphabetically sorting and formatting XML files
  • From: "Peter Loh Yoon Chao" <yoonchao@starhub.net.sg>
  • Date: Tue, 10 Feb 2004 09:50:30 +0800
  • Importance: Normal


I currently have XML files with a flat key-value structure and the elements
are unsorted and without proper formatting, e.g.

  <value xml:lang="en">data 2</value>
<value xml:lang="en">data 1</value>

Are there any existing libraries or mechanisms to do the following?
- convert the file structure into a hierarchical tree structure
- alphabetically sorting the individual elements at each level
- indent the individual nodes properly in the resulting XML file

The resulting XML file should look something like the following:

                <value xml:lang="en">data 1</value>
                <value xml:lang="en">data 2</value>

I would rather not reinvent the wheel if there are existing
libraries/mechanisms to do this sort of thing.  Thanks in advance for any



News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS