An type for octets in the Binary Module

  Hi,

  First, thank you Jirka for this great quality "first draft" of
the Binary Module!

  So if I understand correctly, binary-to-octets() returns
xs:integers because xs:byte <http://w3.org/TR/xmlschema-2/#byte>
is not supported by XQuery nor by XSLT/Basic.  Even though
xs:byte would be perfect here has it has exactly the same value
space as an octet.

  Would it be possible to define a new type, say bin:octet, which
derives from xs:decimal or xs:integer, with the same facets as
xs:byte, and to use it in the signature of the functions?

  As far as I know, XSLT allows that explicitly for extension
functions <http://w3.org/TR/xslt20/#built-in-types> (at least),
XQuery also allows an implementation to augment the schema type
list <http://w3.org/TR/xquery/#id-xq-static-context-components>,
and I am pretty sure XPath allows the same thing (even though
I couldn't find the exact verse right now).

  If we are going to work on individual single octets, it would
make sense to me to constraint the value space of data flowing in
and out the bin:* functions.

  Regards,

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/

Received on Thursday, 14 March 2013 12:56:15 UTC