Changes

Jump to navigation Jump to search
956 bytes added ,  19:22, 20 May 2019
no edit summary
|-
| '''Summary'''
|Fetches the resource referred to by the given {{Code|$uri}} and returns it as XML document node.<br/>In contrast to <code>fn:doc</code>, each function call returns a different document node. As a consequence, document instances created by this function will not be kept in memory until the end of query evaluation.<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.
|-
| '''Errors'''
|-
| '''Summary'''
|Parses binary {{Code|$data}} and returns it as XML document node.<br/>In contrast to fn:parse-xml, which expects an XQuery string, the input of this function can be arbitrarily encoded. The encoding will be derived from the XML declaration or (in case of UTF16 or UTF32) from the first bytes of the input.<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.
|-
| '''Examples'''
|
* <code><nowiki>fetch:content-type("http://docs.basex.org/skins/vector/images/wiki.png")</nowiki></code> returns {{Code|image/png}}.
|}
 
==fetch:doc==
 
{{Mark|Introduced with Version 9.3.}}
 
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|fetch:doc|$uri as xs:string|document-node()}}
|-
| '''Summary'''
|Retrieves the document from the specified {{Code|$uri}} and returns it as document node.<br/>The only difference to <code>fn:doc</code> is that documents in databases will be ignored. As a consequence, the function call will never lead to [[Transaction_Management|database locks]].
|}
 
==fetch:collection==
 
{{Mark|Introduced with Version 9.3.}}
 
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|fetch:collection|$uri as xs:string|document-node()*}}
|-
| '''Summary'''
|Retrieves all documents from the specified {{Code|$uri}} and returns a sequence of document nodes.<br/>The only difference to <code>fn:collection</code> is that documents in databases will be ignored. As a consequence, the function call will never lead to [[Transaction_Management|database locks]].
|}
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu