Project

Profile

Help

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

he / src / use-cases / strong / q9.xq @ a31dd97a

1
import schema namespace ipo="http://www.example.com/IPO" at "ipo.xsd";
2

    
3
declare function local:comments-for-element( $e as element() )
4
  as schema-element(ipo:comment)*
5
{
6
  $e/schema-element(ipo:comment)
7
};
8

    
9
for $p in doc("ipo.xml")/schema-element(ipo:purchaseOrder)
10
where $p/shipTo/name="Helen Zoe"
11
  and $p/@orderDate = xs:date("1999-12-01")
12
return 
13
  <comments name="{$p/shipTo/name}" date="{$p/@orderDate}">
14
   {
15
     local:comments-for-element( $p )
16
   }
17
   {
18
     for $i in $p//item
19
     return local:comments-for-element( $i )
20
   }
21
  </comments>
(23-23/27)