Description
The functx:scheme-from-uri function returns the scheme part of a URI, for example http or ftp , which appears before the colon. If there is no scheme (because it is a relative URI), a zero-length string is returned.
Arguments and Return TypeName | Type | Description |
$uri |
xs:string? |
the URI |
return value |
xs:string |
XQuery Function DeclarationSee XSLT definition. | declare namespace functx = "http://www.functx.com";
declare function functx:scheme-from-uri
( $uri as xs:string? ) as xs:string? {
substring-before($uri,':')
} ; |
ExamplesXQuery Example | Results |
---|
functx:scheme-from-uri(
'http://www.datypic.com') |
http |
functx:scheme-from-uri(
'ftp://ftp.datypic.com') |
ftp |
functx:scheme-from-uri('ftp.datypic.com') |
zero-length string |
functx:scheme-from-uri('www.datypic.com') |
zero-length string |
functx:scheme-from-uri('prod.html') |
zero-length string |
See AlsoHistory |
Recommended Reading:
|