home contribute faq download

FunctX XQuery Functions

functx:fragment-from-uri

Returns the fragment from a URI

Google
Webxqueryfunctions.com

Description

The functx:fragment-from-uri function returns the fragment part of a URI, which appears after a hash mark. If there is no fragment, a zero-length string is returned.

Arguments and Return Type

NameTypeDescription
$uri xs:string? the URI
return value xs:string?

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:fragment-from-uri 
  ( $uri as xs:string? )  as xs:string? {
       
   substring-after($uri,'#')
 } ;
XQuery Syntax for May 2003:
declare namespace functx = "http://www.functx.com" 
define function fragment-from-uri 
  ( $uri as xs:string? )  as xs:string? {
       
   fn:substring-after($uri,'#')
 }

Examples

XQuery ExampleResults
functx:fragment-from-uri(
     'http://datypic.com/index.htm#abc')
abc
functx:fragment-from-uri(
     'http://datypic.com/index.htm')
zero-length string

See Also

functx:scheme-from-uriReturns the scheme from a URI

History

Published OnLast UpdatedContributor(s)
2006-06-272007-02-26Priscilla Walmsley, Datypic, pwalmsley@datypic.com, http://www.datypic.com
Need XQuery Help?
D A T Y P I C
Training | Consulting | Development

XQuery by Priscilla WalmsleyGet the book!
XQuery by Priscilla Walmsley