#96 Bad constraint for 'base64Binary'

PyXB 1.1.3
closed
None
fixed
Binding model
major
PyXB 1.1.2
defect
2010-11-24
2010-11-24
No

"base64Binary" values apparently want check a length contraint but do not define a meaningfull "XsdValueLength" method.

I hit this problem while trying to construct an XML Signature
"Signature" value:

             DigestValue()

This results in a traceback:

  File "/home/dieter/bfd/plone/Python-2.4/lib/python2.4/site-packages/pyxb/binding/basis.py", line 1349, in __call__
    return self.typeDefinition().Factory(*args, **kw)
  File "/home/dieter/bfd/plone/Python-2.4/lib/python2.4/site-packages/pyxb/binding/basis.py", line 227, in Factory
    rv = cls._DynamicCreate(*args, **kw)
  File "/home/dieter/bfd/plone/Python-2.4/lib/python2.4/site-packages/pyxb/binding/basis.py", line 509, in _DynamicCreate
    return ctor(*args, **kw)
  File "/home/dieter/bfd/plone/Python-2.4/lib/python2.4/site-packages/pyxb/binding/basis.py", line 751, in __init__
    self.xsdConstraintsOK()
  File "/home/dieter/bfd/plone/Python-2.4/lib/python2.4/site-packages/pyxb/binding/basis.py", line 884, in xsdConstraintsOK
    return self.XsdConstraintsOK(self)
  File "/home/dieter/bfd/plone/Python-2.4/lib/python2.4/site-packages/pyxb/binding/basis.py", line 877, in XsdConstraintsOK
    if not f.validateConstraint(value):
  File "/home/dieter/bfd/plone/Python-2.4/lib/python2.4/site-packages/pyxb/binding/facets.py", line 194, in validateConstraint
    return self._validateConstraint_vx(value)
  File "/home/dieter/bfd/plone/Python-2.4/lib/python2.4/site-packages/pyxb/binding/facets.py", line 350, in _validateConstraint_vx
    value_length = value.xsdValueLength()
  File "/home/dieter/bfd/plone/Python-2.4/lib/python2.4/site-packages/pyxb/binding/basis.py", line 916, in xsdValueLength
    return self.XsdValueLength(self)
  File "/home/dieter/bfd/plone/Python-2.4/lib/python2.4/site-packages/pyxb/binding/datatypes.py", line 705, in XsdValueLength
    raise NotImplementedError('No length calculation for base64Binary')
NotImplementedError: No length calculation for base64Binary

The corresponding schema http://www.w3.org/TR/xmldsig-core/ is

   <simpleType name="DigestValueType">
     <restriction base="base64Binary"/>
   </simpleType>
1 Attachments

Discussion

  • Dieter Maurer

    Dieter Maurer - 2010-11-24

    Workaround -- but probably not the best solution. More likely: do not add constraints facets when the schema does not call for them

     
  • Peter A. Bigot

    Peter A. Bigot - 2010-11-24
    • status changed from new to assigned
    • milestone changed from PyXB 1.1.2 to PyXB 1.1.3

    In fact, the error is correct. xs:base64Binary is completely unimplemented.

    Now that xs:hexBinary has paved the way for representations where the value and lexical space are not distinguishable by Python type, it would be possible to implement this type. I'll look into that.

     
  • Peter A. Bigot

    Peter A. Bigot - 2010-11-24
    • status changed from assigned to closed
    • resolution set to fixed

    base64Binary has been implemented in branch trac/96, which has also been merged to next. Will be in next release.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks