File: function-declaration-010.xq

package info (click to toggle)
qtxmlpatterns-opensource-src 5.15.8-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 308,892 kB
  • sloc: xml: 360,343; cpp: 91,994; ansic: 388; sh: 53; sed: 31; makefile: 23
file content (20 lines) | stat: -rw-r--r-- 827 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
(:*******************************************************:)
(: Test: function-declaration-010.xq          :)
(: Written By: Pulkita Tyagi                             :)
(: Date: Thu Jun  2 00:24:56 2005                        :)
(: Purpose: Demonstrate function declaration in different combination :)
(:********************************************************************:)

declare function local:prnt($n as xs:integer,$n2 as xs:string, $n3 as xs:date,
                          $n4 as xs:long, $n5 as xs:string, $n6 as xs:decimal)
{
    if ($n < 2)
        then 1
        else concat($n, " ",$n2," ",$n3," ",$n4," ",$n5," ",$n6)
};
<table>
{
     <td>Value is =  {local:prnt(4,xs:string("hello"),xs:date("2005-02-22"),
                      xs:long(5),xs:string("well"),xs:decimal(1.2))}</td>
}
</table>