Hi Pragya, Is this what you're looking for? It's not a solution to be used as massive scale:
xquery version "1.0-ml"; let $books := <books> <book> <title count="1">5 point someone</title> </book> <book> <title count="1">Ramayana</title> </book> <book> <chapter count="9">chapter1</chapter> <title count="9">Shivaji</title> </book> <book> <title count="324">Rana Pratap</title> </book> <book> <chapter count="9">chapter2</chapter> <title count="9">America</title> </book> </books> for $book in $books/book order by $book/*[1] return $book Charles On 08/29/2013 10:23 PM, Pragya Kapoor wrote: > <books> > <book> > <title count="1">5 point someone</title> > </book> > <book> > <title count="1">Ramayana</title> > </book> > <book> > <chapter count="9">chapter1</chapter> > <title count="9">Shivaji</title> > </book> > <book> > <title count="324">Rana Pratap</title> > </book> > <book> > <chapter count="9">chapter2</chapter> > <title count="9">America</title> > </book> > </books> -- Charles Greer Senior Engineer MarkLogic Corporation [email protected] Phone: +1 707 408 3277 www.marklogic.com _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
