wood burning stoves 2.0
The moose likes XML and Related Technologies and the fly likes move an element to top 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 "move an element to top" Watch "move an element to top" New topic

move an element to top

rick collette
Ranch Hand

Joined: Mar 22, 2002
Posts: 208
the following is a well-formed xhtml file:
<input type="text" name="n1" value="v1"/>
<input type="text" name="n2" value="v2"/>
<input type="text" name="n3" value="title"/>
I want to transform it into a plain text file such as:
That means I need to move third element to the top,
how can I do it? It took a long while with no answer.
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
Would <xsl:sort/> do the trick?

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Hari Vignesh Padmanaban
Ranch Hand

Joined: Oct 07, 2003
Posts: 578
yes lasse, it would
here is teh code

Hope this helps
rick collette
Ranch Hand

Joined: Mar 22, 2002
Posts: 208
Thanks, guys.

I modified DOM code, and it works fine now.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: move an element to top
It's not a secret anymore!