Hi All, I am learning XPath and Xquery, i am trying to implement the following query. But i need some inputs to get proper solution.
here you go with sample XML : <Book> <Unit> <Lesson> 0.0.a </Lesson> </Unit><Unit> <Lesson> 0.0.a.a </Lesson> </Unit><Unit> <Lesson> 0.0.a.b </Lesson> </Unit><Unit> <Lesson> 0.0.a.c </Lesson> </Unit> <Unit> <Lesson> 0.0.b </Lesson> </Unit> <Unit> <Lesson> 0.0.b.a </Lesson> </Unit> <Unit> <Lesson> 0.0.b.a.b </Lesson> </Unit> <Unit> <Lesson> 0.0.b.a.b.c </Lesson> </Unit> <Unit> <Chapter> 0.0.b.b </Lesson> </Unit><Unit> <Lesson> 0.0.b.c </Lesson> </Unit> </Book> I want the result like : <Book> <Unit> <Chapter>0.0.a <Lessons> <Lesson> 0.0.a.a </Lesson> <Lesson> 0.0.a.b </Lesson> <Lesson> 0.0.a.c </Lesson> </Lessons> </Chapter> <Chapter>0.0.b <Lessons> <Lesson> 0.0.b.a </Lesson> <Lesson> 0.0.b.a.b <Lessons> <Lesson> 0.0.b.a.b.c </Lesson> </Lessons> </Lesson> <Lesson>0.0.b.b </Lesson> <Lesson> 0.0.b.c </Lesson> </Lessons> </Chapter> </Unit> </Book> any solution for this. Thank you in advance one and all. _______________________________________________ General mailing list General@developer.marklogic.com http://xqzone.com/mailman/listinfo/general