Project

Profile

Help

How to connect?
Download (357 Bytes) Statistics
| Branch: | Revision:

he / src / use-cases / tree / q1.xq @ a31dd97a

1
declare namespace my="my.uri";
2
declare function my:toc($book-or-section as element()) as element()*
3
{
4
    for $section in $book-or-section/section
5
    return
6
        <section>
7
                { $section/@* , $section/title , my:toc($section) }
8
        </section>
9
};
10

    
11
<toc>
12
   {
13
     for $s in doc("book.xml")/book return my:toc($s)
14
   }
15
</toc>
(4-4/14)