Changes

Jump to navigation Jump to search
40 bytes added ,  17:10, 9 March 2023
no edit summary
| width='120' | '''Signature'''
|<pre>fetch:binary(
$uri href as xs:string
) as xs:base64Binary</pre>
|- valign="top"
| '''Summary'''
|Fetches the resource referred to by the given URI {{Code|href}} string and returns it as [[Lazy Module|lazy]] {{Code|xs:base64Binary}} item.
|- valign="top"
| '''Errors'''
| width='120' | '''Signature'''
|<pre>fetch:text(
$uri href as xs:string,
$encoding as xs:string := (),
$fallback as xs:boolean? := false()
|- valign="top"
| '''Summary'''
|Fetches the resource referred to by the given {{Code|$urihref}} string and returns it as [[Lazy Module|lazy]] {{Code|xs:string}} item:
* The UTF-8 default encoding can be overwritten with the optional {{Code|$encoding}} argument.
* By default, invalid characters will be rejected. If {{Code|$fallback}} is set to true, these characters will be replaced with the Unicode replacement character <code>FFFD</code> (&#xFFFD;).
| width='120' | '''Signature'''
|<pre>fetch:doc(
$uri href as xs:string,
$options as map(*)? := map { }
) as document-node()</pre>
|- valign="top"
| '''Summary'''
|Fetches the resource referred to by the given {{Code|$urihref}} string and returns it as a document node.<br/>The {{Code|$options}} argument can be used to change the parsing behavior. Allowed options are all [[Options#Parsing|parsing]] and [[Options#XML Parsing|XML parsing]] options in lower case.<br/>The function differs from {{Code|fn:doc}} in various aspects:
* It is ''non-deterministic'', i.e., a new document node will be created by each call of this function.
* A document created by this function will be garbage-collected as soon as it is not referenced anymore.
| width='120' | '''Signature'''
|<pre>fetch:content-type(
$uri href as xs:string
) as xs:string</pre>
|- valign="top"
| '''Summary'''
|Returns the content-type (also called mime-type) of the resource specified by {{Code|$urihref}}string:
* If a remote resource is addressed, the request header will be evaluated.
* If the addressed resource is locally stored, the content-type will be guessed based on the file extension.
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu