[jdom-interest] Sorting elements in a document by a Node

George Pieri george.pieri at wcom.com
Mon Apr 15 13:50:10 PDT 2002

Using JDOM is it possible to sort all the elements in an XML 
string by one of the nodes...

e.g. Sort all the the XML "NAME" nodes/tags in ascending order ??

            StringReader sReader = new StringReader(xmlData) ;
            doc = builder.build(sReader) ;
            root = doc.getRootElement() ;

            doc.sort("NAME","asc")   ????????????????????

Thanks in advance!

More information about the jdom-interest mailing list