source: Dev/branches/rest-dojo-ui/client/dojox/highlight/tests/example-xquery-source.xquery @ 256

Last change on this file since 256 was 256, checked in by hendrikvanantwerpen, 13 years ago

Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).

File size: 798 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.