Changes

Jump to navigation Jump to search
1,130 bytes added ,  18:05, 19 September 2014
=Functions=
 
==fetch:binary==
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|fetch:binary|$uri as xs:string|xs:base64Binary}}<br/>
|-
| '''Summary'''
|Fetches the resource referred to by the given URI and returns it as [[Streaming Module|streamable]] {{Code|xs:base64Binary}}.
|-
| '''Errors'''
|{{Error|BXFE0001|XQuery Errors#Functions Errors}} the URI could not be resolved, or the resource could not be retrieved.
|-
| '''Examples'''
|
* <code><nowiki>fetch:binary("http://images.trulia.com/blogimg/c/5/f/4/679932_1298401950553_o.jpg")</nowiki></code> returns the addressed image.
* <code><nowiki>stream:materialize(fetch:binary("http://en.wikipedia.org"))</nowiki></code> returns a materialized representation of the streamable result.
|}
==fetch:text==
|}
==fetch:binaryxml== {{Mark|Added with Version 8.0}}: 
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|fetch:binaryxml|$uri as xs:string|xs:base64Binarydocument-node()}}<br/>{{Func|fetch:xml|$uri as xs:string, $options as item()|document-node()}}
|-
| '''Summary'''
|Fetches the resource referred to by the given URI {{Code|$uri}} and returns it as an XML document.<br/><br/>The {{Code|$options}} argument can be used to change the parsing behavior. Allowed options are all [[Options#Parsing|parsing]] and [[Streaming ModuleOptions#XML Parsing|streamableXML parsing]] options in lower case. Options can be specified either...<br />* as children of an {{Code|xs:base64Binary<options/>}}element, e.g.<pre class="brush:xml"><options> <chop value='false'/></options></pre>* or as map, which contains all key/value pairs:<pre class="brush:xquery">map { "chop": false() }</pre>
|-
| '''Errors'''
| '''Examples'''
|
* <code><nowiki>fetch:binary("http://images.trulia.com/blogimg/c/5/f/4/679932_1298401950553_o.jpg")</nowiki></code> returns the addressed image.* <code><nowiki>stream:materialize(fetch:binaryxml("http://en.wikipedia.org"))</nowiki></code> returns a materialized an XML representation of the streamable resultEnglish Wikipedia main HTML page.
|}
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu