Project

Profile

Help

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

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

1
declare namespace f="my-functions.uri";
2
declare function f:one_level ($p as element()) as element()
3
{
4
    <part partid="{ $p/@partid }"
5
          name="{ $p/@name }" >
6
        {
7
            for $s in doc("partlist.xml")//part
8
            where $s/@partof = $p/@partid
9
            return f:one_level($s)
10
        }
11
    </part>
12
};
13

    
14
<parttree>
15
  {
16
    for $p in doc("partlist.xml")//part[empty(@partof)]
17
    return f:one_level($p)
18
  }
19
</parttree>
20

    
(4-4/4)