Description
The functx:is-absolute-uri function returns true if URI is absolute, meaning that it starts with a scheme name such as http or ftp. It returns false if it is a relative URI.
Arguments and Return TypeName | Type | Description |
$uri |
xs:string? |
the URI to test |
return value |
xs:boolean |
XSLT Function DeclarationSee XQuery definition. | <xsl:function name="functx:is-absolute-uri" as="xs:boolean"
xmlns:functx="http://www.functx.com">
<xsl:param name="uri" as="xs:string?"/>
<xsl:sequence select="
matches($uri,'^[a-z]+:')
"/>
</xsl:function>
|
ExamplesXPath Example | Results |
---|
functx:is-absolute-uri(
'https://www.datypic.com') |
true |
functx:is-absolute-uri(
'ftp://ftp.datypic.com') |
true |
functx:is-absolute-uri('ftp.datypic.com') |
false |
functx:is-absolute-uri('www.datypic.com') |
false |
functx:is-absolute-uri('prod.html') |
false |
See AlsoHistory |
Recommended Reading:
|