• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML String sorting issue .

 
Karn Kumar
Ranch Hand
Posts: 153
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 153
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also I have document object , If can perform any sorting operation . Let me know your suggestion.
 
g tsuji
Ranch Hand
Posts: 666
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 153
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks g tsuji ,

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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic