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 |
XSLT Function DeclarationSee XQuery definition. | <xsl:function name="functx:scheme-from-uri" as="xs:string?"
xmlns:functx="http://www.functx.com">
<xsl:param name="uri" as="xs:string?"/>
<xsl:sequence select="
substring-before($uri,':')
"/>
</xsl:function>
|
ExamplesXPath Example | Results |
---|
functx:scheme-from-uri(
'https://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:
|