source: Dev/trunk/src/client/dojox/highlight/tests/example-xquery-source.xquery @ 532

Last change on this file since 532 was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

File size: 799 bytes
Line 
1declare variable $my:entityName as xs:string external;
2
3declare variable $databaseURI := concat('jdbc://getCreditDefaultSwapsByEntityName?cd%&', $my:entityName);
4declare variable $creditDefaultSwaps := collection($databaseURI);
5
6declare function local:equityRows($root) {
7        for $equity in $root//equity
8        let $referenceEntity := $creditDefaultSwaps//fpml:referenceEntity
9        where $equity/name = $referenceEntity/fpml:entityName
10        return
11                <tr xmlns="http://www.w3.org/1999/xhtml">
12                        <td>{ $equity/*:symbol/text() }</td>
13                        <td>{ $equity/*:name/text() }</td>
14                        <td>{ $equity/*:high/text() }</td>
15                        <td>{ $equity/*:currency/text() }</td>
16                </tr>
17};
18
19<table border="1">
20<tr>
21        <th>Ticker Symbol</th>
22        <th>Company Name</th>
23        <th>High</th>
24        <th>Currency</th>
25</tr>
26{ local:equityRows(/) }
27</table>
Note: See TracBrowser for help on using the repository browser.