functx:scheme-from-uri

Returns the scheme from a URI

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.

Parameters

Description

uri:string()

the URI

Examples

XPath

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 Also