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 Type| Name | Type | Description |
$uri |
xs:string? |
the URI to test |
| return value |
xs:boolean |
XQuery Function Declaration| See XSLT definition. | | XQuery Syntax for July 2004 - January 2007 (1.0): |
|---|
declare namespace functx = "http://www.functx.com";
declare function functx:is-absolute-uri
( $uri as xs:string? ) as xs:boolean {
matches($uri,'^[a-z]+:')
} ; | | XQuery Syntax for May 2003: |
|---|
declare namespace functx = "http://www.functx.com"
define function is-absolute-uri
( $uri as xs:string? ) as xs:boolean {
fn:matches($uri,'^[a-z]+:')
} |
Examples| XQuery Example | Results |
|---|
functx:is-absolute-uri(
'http://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 |
|