Project

Profile

Help

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

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

1
declare namespace my="my.uri";
2
declare function my:section-summary($book-or-section as element())
3
  as element()*
4
{
5
  for $section in $book-or-section/section
6
  return
7
    <section>
8
       { $section/@* }
9
       { $section/title }   
10
       <figcount>     
11
          { count($section/figure) }
12
       </figcount>        
13
       { my:section-summary($section) }            
14
    </section>
15
};
16

    
17
<toc>
18
  {
19
    for $s in doc("book.xml")/book
20
    return my:section-summary($s)
21
  }
22
</toc>
(14-14/14)