Hi Erdal I would think of this approach - write a function, which takes as an argument value of attribute parentId - returns tree of all elements, referring to this id (and all nested trees) - inside call this function recursively for each element again returning next nested level - in your base XQuery call this function with selecting ids of elements, which are in the root of the document (they will probably have some empty value of @parentId or their parentId will not be found in your document) It would be nice exercise, but I cannot afford it today. Jan 2011/1/20 Erdal Karaca <erdal.karaca.de@googlemail.com>
I have a table that is to be transformed to a tree:
<entry id="entry1" parentId="parentOfThisEntry" /> <entry id="entry2" parentId="parentOfThisEntry" /> <entry id="entry3" parentId="parentOfThisEntry" /> <entry id="entry4" parentId="parentOfThisEntry" />
The tree structure can be constructed by the id/parentId relation. I failed to achieve this... :-( I am using basex 6.5.
_______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
-- *Ing. Jan Vlčinský* CAD programy Slunečnicová 338/3, 734 01 Karviná Ráj, Czech Republic tel: +420-597 602 024; mob: +420-608 979 040 skype: janvlcinsky; GoogleTalk: jan.vlcinsky@gmail.com http://cz.linkedin.com/in/vlcinsky