#100 Generating bindings for XSD with extensions containing wildcards can cause exception

PyXB 1.1.3
Generation Model
PyXB 1.1.2

I have the following schema:

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    version="1.0" targetNamespace="http://www.example.com/test" xmlns:tgt="http://www.example.com/test" 
    elementFormDefault="qualified" attributeFormDefault="unqualified">

  <complexType name="BaseRequestType" abstract="true">
    <attribute  name="attrib1"  type="xsd:string"/>
    <anyAttribute namespace="##any" processContents="skip"/>

  <element name="Notification">
        <extension base="tgt:BaseRequestType">
          <attribute name="attrib2"         type="xsd:string"         use="optional"/>
          <anyAttribute  namespace="##any" processContents="skip"/> 


Running this through pyxbgen gives the following traceback:

Exception generating bindings: _setAttributeWildcard() got an unexpected keyword argument 'process_contents'
Traceback (most recent call last):
  File "PyXB\scripts\pyxbgen", line 74, in <module>
    modules = generator.bindingModules()
  File "C:\Code\RSGatewayLinux\PyXB\pyxb\binding\generate.py", line 2409, in bindingModules
    self.__bindingModules = self.__buildBindingModules()
  File "C:\Code\RSGatewayLinux\PyXB\pyxb\binding\generate.py", line 2275, in __buildBindingModules
    pyxb.namespace.resolution.ResolveSiblingNamespaces(namespaces, self.generationUID())
  File "C:\Code\RSGatewayLinux\PyXB\pyxb\namespace\resolution.py", line 264, in ResolveSiblingNamespaces
    if not ns.resolveDefinitions(allow_unresolved=True):
  File "C:\Code\RSGatewayLinux\PyXB\pyxb\namespace\resolution.py", line 207, in resolveDefinitions
  File "C:\Code\RSGatewayLinux\PyXB\pyxb\xmlschema\structures.py", line 2534, in _resolve
    return self.__completeProcessing(self.__pendingDerivationMethod, self.__contentStyle)
  File "C:\Code\RSGatewayLinux\PyXB\pyxb\xmlschema\structures.py", line 2183, in __completeProcessing
TypeError: _setAttributeWildcard() got an unexpected keyword argument 'process_contents'
1 Attachments


  • Buse

    Buse - 2011-04-14

    I realize the anyAttribute tags are doubled up. But it should still be parseable and valid, even if it doesn't make much logical sense.

  • Peter A. Bigot

    Peter A. Bigot - 2011-04-14

    Potential fix for problem

  • Peter A. Bigot

    Peter A. Bigot - 2011-04-14
    • status changed from new to assigned

    See whether the trac-100.patch I just posted fixes this. It builds; whether it does the right thing is currently untested. (The patch is against the development version, but except for line numbers it's probably right for 1.1.2.)

  • Buse

    Buse - 2011-04-14

    The patch seems to fix things.

    Thank you.

  • Peter A. Bigot

    Peter A. Bigot - 2011-05-21
    • status changed from assigned to closed
    • resolution set to fixed

    commit b59744b0d0caf03dd395448b7052963c96ec946f
    Author: Peter A. Bigot <pabigot@‌>
    Date: Sat May 21 09:20:11 2011 -0500

    trac/100 Generating bindings for XSD with extensions containing wildcards can cause exception

  • Peter A. Bigot

    Peter A. Bigot - 2011-05-21
    • milestone changed from PyXB 1.1.2 to PyXB 1.1.3

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

Sign up for the SourceForge newsletter:

No, thanks