Generating bindings for XSD with extensions containing wildcards can cause...
Brought to you by:
pabigot
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"/>
</complexType>
<element name="Notification">
<complexType>
<complexContent>
<extension base="tgt:BaseRequestType">
<attribute name="attrib2" type="xsd:string" use="optional"/>
<anyAttribute namespace="##any" processContents="skip"/>
</extension>
</complexContent>
</complexType>
</element>
</schema>
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
resolvable._resolve()
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
annotation=complete_wildcard.annotation())
TypeError: _setAttributeWildcard() got an unexpected keyword argument 'process_contents'
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.
Potential fix for problem
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.)
The patch seems to fix things.
Thank you.
commit b59744b0d0caf03dd395448b7052963c96ec946f
Author: Peter A. Bigot <pabigot@‌>
Date: Sat May 21 09:20:11 2011 -0500