aspose file tools*
The moose likes XML and Related Technologies and the fly likes XML String sorting issue . Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML String sorting issue ." Watch "XML String sorting issue ." New topic
Author

XML String sorting issue .

Karn Kumar
Ranch Hand

Joined: Aug 06, 2009
Posts: 146

Hi All ,

Actually i have XML string in one format as below




The xml should be in the format as below i.e. can consider first tag <PQR> for sorting .



Is there any mechanism/Utility in java i can operate on xml string the format 1 given above ?
Karn Kumar
Ranch Hand

Joined: Aug 06, 2009
Posts: 146

Also I have document object , If can perform any sorting operation . Let me know your suggestion.
g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 517
    
    3
Normally, one can do it through a simple xsl transformation. The central piece is an identity transformation whereas the template matching element node is slightly modified for the purpose of the required sorting. This is the typical look of it.

If you've not much of an idea of xslt, read up its general way of thinking in terms of templates or functional programming and its general settings, and apply the above. You can of course even integrate xslt with your existing document object inside your programming code as you said you have it already.
Karn Kumar
Ranch Hand

Joined: Aug 06, 2009
Posts: 146

Thanks g tsuji ,

I am new to xsl , but will check for solution provided.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XML String sorting issue .