Re: Comment on "Allow both xs:base64Binary and xs:hexBinary as arguments"

On 4.7.2013 15:11, Florent Georges wrote:

>   Well, yeah, the dynamic type of an actual item, returned by such a
> function, will be either of them.  But the static return type, the
> type that appears in the function signature, should be
> xs:anyAtomicType (for the same reason the static type of the
> parameters has to be xs:anyAtomicType), isn't it?

I'm not expert on type system used in XPath, but I think that return
type should be one of existing binary types, probably base64Binary in
order to align with existing usage in file module. Such value can be
then feed into any binary module function as it formally accepts
anyAtomicType but requires it to be either base64Binary or hexBinary.

Declaring return type as anyAtomicType but requiring in prose text to be
it base64Binary doesn't seem much useful. The difference is that for
input parameters we want flexibility of accepting both binary types as
we don't know what types stylesheet author needs to process.

For output (return) value we are fine with just one type as it can be
accepted by any other function on input. I'm not sure whether I was able
to explain it in a digestible form, though.

    Jirka

-- 
------------------------------------------------------------------
  Jirka Kosek      e-mail: jirka@kosek.cz      http://xmlguru.cz
------------------------------------------------------------------
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep.
------------------------------------------------------------------
    Bringing you XML Prague conference    http://xmlprague.cz
------------------------------------------------------------------

Received on Thursday, 4 July 2013 13:20:15 UTC