It's not a secret anymore!*
The moose likes Groovy and the fly likes Ordering of Nodes with List Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Ordering of Nodes with List" Watch "Ordering of Nodes with List" New topic
Author

Ordering of Nodes with List

Bill Lee
Greenhorn

Joined: Feb 02, 2007
Posts: 20
I have a list of records. I am trying to attempt to write to write a sort of the children.NodeBuilder to fill it with one top level element and then have my nodes serve as reacords. In other words, my list what is below. It seems in the closure it only compares the 1st 2 kids in Qualification and Offer List and doesn't incorporate Identity List into the equation


<Transaction>
<Qualification>
<OfferList/>
<IdentityList/>
</Transaction>

I am trying to get the sort to look like.


<Transaction>
<IdentityList/>
<Qualification>
<OfferList/>

</Transaction>


When I run the following.

allRecords.each{
it.children().sort{it}

}

I am getting a totally different layout that apears like this.

<Transaction>
<OfferList/>
<Qualification>
<IdentityList/>

</Transaction>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ordering of Nodes with List
 
Similar Threads
Combo Box and Getting Data from the BEA Content Repository
Combo Box and Getting Data from the BEA Content Repository
Confusions about a DOM hierarchy
Urgent - DOM006 Hierarchy request error
how to use variable in XSLT if condition