Subject:External xquery functions Author:Dominic Vieira Date:18 May 2007 12:23 PM
I would like to take advantage of functions defined in the following namespace;
declare 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)
} ;
What do I need to do in xquery to take advantage of such functions in development and deployment environments and how would I reference the functions in my code.
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)
} ;