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 Type| Name | Type | Description |
$uri |
xs:string? |
the URI |
| return value |
xs:string? |
XSLT Function Declaration| See XQuery definition. | | XSLT 2.0 Syntax: |
|---|
<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>
|
Examples| XSLT 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 |
|