Changes

Jump to navigation Jump to search
808 bytes removed ,  13:18, 16 September 2016
=Conventions=
All functions and errors in this module are assigned to the {{Code|<code><nowiki>http://expath.org/ns/binary}} </nowiki></code> namespace, which is statically bound to the {{Code|bin}} prefix.<br/>
=Constants and Conversions=
|-
| '''Examples'''
|<code>string(bin:hex('11223F4E'))</code> yields <code>ESI/Tg==</code>.<br/><code>string(xs:hexBinary(bin:hex('FF')))</code> yields <code>FF</code>.
|}
|-
| '''Examples'''
|<code>string(bin:bin('1101000111010101'))</code> yields <code>0dU=</code>.<br/><code>string(xs:hexBinary(bin:bin('1000111010101')))</code> yields <code>11D5</code>.
|}
|-
| '''Examples'''
|<code>string(xs:hexBinary(bin:octal('11223047')))</code> yields <code>252627</code>.
|}
=Basic Operations=
==bin:hexlength==
{| width='100%'
|-
|-
| width='120' | '''Signatures'''
|{{Func|bin:part|$in as xs:base64Binary?, $offset as xs:integer|xs:base64Binary?}}<br/>{{Func|bin:part|$in as xs:base64Binary?, $offset as xs:integer, $size as xs:integer|xs:base64Binary?}}
|-
| '''Summary'''
|-
| '''Errors'''
|{{Error|negative-offset|#Errors}} the specified offset is negative.<br/>{{Error|negative-size|#Errors}} the specified size is negative.<br/>{{Error|offsetindex-out-beyondof-endrange|#Errors}} the specified offset + size extends beyond the binary datais out of range.
|-
| '''Examples'''
|-
| '''Errors'''
|{{Error|negativeindex-offset|#Errors}} the specified offset is negative.<br/>{{Error|offsetout-beyondof-endrange|#Errors}} the specified offset extends beyond the binary datais out of range.
|}
|-
| '''Summary'''
|Returns the first location of the binary search sequence in the input, or if not found, the empty sequence.<br/>The {{Code|$offset }} and the returned location are zero based. If the value of {{Code|$in }} is the empty sequence, the function returns an empty sequence.
|-
| '''Errors'''
|{{Error|negativeindex-offset|#Errors}} the specified offset is negative.<br/>{{Error|offsetout-beyondof-endrange|#Errors}} the specified offset extends beyond the binary data.<br/>{{Error|empty-search-item|#Errors}} the specified search data + size is emptyout of range.
|}
|-
| '''Errors'''
|{{Error|negative-offset|#Errors}} the specified offset is negative.<br/>{{Error|negative-size|#Errors}} the specified size is negative.<br/>{{Error|offsetindex-out-beyondof-endrange|#Errors}} the specified offset + size extends beyond the binary datais out of range.<br/>{{Error|unknown-encoding|#Errors}} the specified encoding is unknown.<br/>{{Error|decodingconversion-error|#Errors}} an error or malformed input occurred during decoding the string.
|-
| '''Examples'''
|-
| '''Errors'''
|{{Error|unknown-encoding|#Errors}} the specified encoding is unknown.<br/>{{Error|encodingconversion-error|#Errors}} an error or malformed input occurred during encoding the string.
|}
|-
| width='120' | '''Signatures'''
|{{Func|bin:pack-float|$in as xs:doublefloat|xs:base64Binary}}<br/>{{Func|bin:pack-float|$in as xs:doublefloat, $octet-order as xs:string|xs:base64Binary}}
|-
| '''Summary'''
|-
| width='120' | '''Signatures'''
|{{Func|bin:pack-integer|$in as xs:doubleinteger, $size as xs:integer|xs:base64Binary}}<br/>{{Func|bin:pack-floatinteger|$in as xs:doubleinteger, $size as xs:integer, $octet-order as xs:string|xs:base64Binary}}
|-
| '''Summary'''
|-
| '''Errors'''
|{{Error|negativeindex-offset|#Errors}} the specified offset is negative.<br/>{{Error|offsetout-beyondof-endrange|#Errors}} the specified offset + 8 extends beyond the binary datais out of range.<br/>{{Error|unknown-significance-order|#Errors}} the specified octet order is unknown.
|}
|-
| width='120' | '''Signatures'''
|{{Func|bin:unpack-float|$in as xs:base64Binary, $offset as xs:integer|xs:doublefloat}}<br/>{{Func|bin:unpack-float|$in as xs:base64Binary, $offset as xs:integer, $octet-order as xs:string|xs:float}}
|-
| '''Summary'''
|-
| '''Errors'''
|{{Error|negativeindex-offset|#Errors}} the specified offset is negative.<br/>{{Error|offsetout-beyondof-endrange|#Errors}} the specified offset + 4 extends beyond the binary datasize is out of range.<br/>{{Error|unknown-significance-order|#Errors}} the specified octet order is unknown.
|}
|-
| width='120' | '''Signatures'''
|{{Func|bin:unpack-integer|$in as xs:base64Binary, $offset as xs:integer, $size as xs:integer|xs:doubleinteger}}<br/>{{Func|bin:unpack-integer|$in as xs:base64Binary, $offset as xs:integer, $size as xs:integer, $octet-order as xs:string|xs:floatinteger}}
|-
| '''Summary'''
|-
| '''Errors'''
|{{Error|negative-offset|#Errors}} the specified offset is negative.<br/>{{Error|negative-size|#Errors}} the specified size is negative.<br/>{{Error|offsetindex-out-beyondof-endrange|#Errors}} the specified offset + 4 extends beyond the binary datasize is out of range.<br/>{{Error|unknown-significance-order|#Errors}} the specified octet order is unknown.
|}
|-
| width='120' | '''Signatures'''
|{{Func|bin:unpack-unsigned-integer|$in as xs:base64Binary, $offset as xs:integer, $size as xs:integer|xs:doubleinteger}}<br/>{{Func|bin:unpack-unsigned-integer|$in as xs:base64Binary, $offset as xs:integer, $size as xs:integer, $octet-order as xs:string|xs:floatinteger}}
|-
| '''Summary'''
|-
| '''Errors'''
|{{Error|negative-offset|#Errors}} the specified offset is negative.<br/>{{Error|negative-size|#Errors}} the specified size is negative.<br/>{{Error|offsetindex-out-beyondof-endrange|#Errors}} the specified offset + 4 extends beyond the binary datasize is out of range.<br/>{{Error|unknown-significance-order|#Errors}} the specified octet order is unknown.
|}
|The arguments to a bitwise operation have different lengths.
|-
|{{Code|negativeindex-offset}}|An offset value is negative.|-|{{Code|offsetout-beyondof-endrange}}|An offset value extends beyond the binary datais out of range.
|-
|{{Code|negative-size}}
|A size value is negative.
|-
|{{Code|empty-search-item}}
|Binary search data is empty.
|-
|{{Code|octet-out-of-range}}
|An encoding is not supported.
|-
|{{Code|decodingconversion-error}}|An error or malformed input during decoding a string.|-|{{Code|decoding-error}}|An error or malformed input during encoding converting a string.
|-
|{{Code|unknown-significance-order}}
Introduced with Version 7.8.
 
[[Category:XQuery]]
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu