W3C home > Mailing lists > Public > public-expath@w3.org > March 2013

Re: An type for octets in the Binary Module

From: Adam Retter <adam@exist-db.org>
Date: Thu, 14 Mar 2013 13:43:58 +0000
Message-ID: <CAJKLP9Zfrk=XSswpk=biMkGayGpdcGTLEEuvKeizhWpT9qsx2A@mail.gmail.com>
To: Florent Georges <fgeorges@fgeorges.org>
Cc: EXPath CG <public-expath@w3.org>
>   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.

Er... what?

http://www.w3.org/TR/xpath-datamodel/#types-hierarchy

I am pretty sure that XQuery does support xs:byte, or do I miss something?
Also if I read the specs correctly, xs:byte is supported in XSLT 3.0 I
think, but not in versions before?


>  Even though
> xs:byte would be perfect here has it has exactly the same value
> space as an octet.

Yup, so we should use it if we can.

>   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/
>



--
Adam Retter

eXist Developer
{ United Kingdom }
adam@exist-db.org
irc://irc.freenode.net/existdb
Received on Thursday, 14 March 2013 13:44:30 GMT

This archive was generated by hypermail 2.3.1 : Thursday, 14 March 2013 13:44:31 GMT