|
top
|
 Subject: External xquery functions Author: (Deleted User) Date: 21 May 2007 02:31 PM
|
Hi Dominic,
you should package the function in a module
module namespace functx = "http://www.functx.com";
declare function functx:pad-string-to-length( $stringToPad as xs:string? ,
$padChar as xs:string ,
$length as xs:integer ) as xs:string {
substring(
string-join (
($stringToPad, for $i in (1 to
$length) return $padChar)
,'')
,1,$length)
} ;
and then import it from your actual query
import module namespace functx = "http://www.functx.com" at "mod1.xquery";
functx:pad-string-to-length("ciao", " ", 10)
Hope this helps,
Alberto
|
|
|