Thanks for the quick response. I added the "-m cml3" flag however I still
received the same error message from pyxbgen. I found that the schema.xsd
file had a reference to xmlns="http://www.w3.org/1999/xhtml"; on line 2228.
I removed this from the schema file and then pyxbgen worked without error.

$ diff schema.xsd schema-positiveNumberType-modified.xsd
2228c2228
<     <xsd:simpleType name="positiveNumberType" id="st.positiveNumberType"
xmlns="http://www.w3.org/1999/xhtml";>
---
>     <xsd:simpleType name="positiveNumberType" id="st.positiveNumberType">
11459c11459
< </xsd:schema>
\ No newline at end of file
---
> </xsd:schema>

I tested on Python 2.7.3 and Python 2.6.6 with PyXB 1.2.1.

Thanks for the great work on PyXB. I am now using the resulting cml3.py and
it has been very useful.

On Wed, Apr 10, 2013 at 12:11 PM, Peter Bigot <[email protected]> wrote:

> You need to tell pyxbgen both the module name into which the bindings
> should be generated, and where it can find the schema.  Please review the
> user manual at: http://pyxb.sourceforge.net/userref_pyxbgen.html
>
> pyxbgen -m cml3 -u schema.xsd
>
> works for me with the version 3 CML schema with the current development
> version of pyxb.
>
>
> On Wed, Apr 10, 2013 at 10:57 AM, Don Pellegrino <
> [email protected]> wrote:
>
>> I tried pyxbgen from PyXB 1.2.1 on Chemical Markup Language Schema 3 from
>> http://www.xml-cml.org/schema/. Unfortunately, I received the following
>> error message:
>>
>> $ pyxbgen schema.xsd
>> Exception generating bindings: http://www.w3.org/1999/xhtml has no
>> category typeDefinition
>> Traceback (most recent call last):
>>   File "/home/u549486/apps/virtualenv-1.9.1/myVE/bin/pyxbgen", line 73,
>> in <module>
>>     modules = generator.bindingModules()
>>   File
>> "/home/u549486/apps/virtualenv-1.9.1/myVE/lib/python2.6/site-packages/pyxb/binding/generate.py",
>> line 2727, in bindingModules
>>     self.__resolveComponentDependencies(reset)
>>   File
>> "/home/u549486/apps/virtualenv-1.9.1/myVE/lib/python2.6/site-packages/pyxb/binding/generate.py",
>> line 2587, in __resolveComponentDependencies
>>     pyxb.namespace.resolution.ResolveSiblingNamespaces(namespaces)
>>   File
>> "/home/u549486/apps/virtualenv-1.9.1/myVE/lib/python2.6/site-packages/pyxb/namespace/resolution.py",
>> line 301, in ResolveSiblingNamespaces
>>     if not ns.resolveDefinitions(allow_unresolved=True):
>>   File
>> "/home/u549486/apps/virtualenv-1.9.1/myVE/lib/python2.6/site-packages/pyxb/namespace/resolution.py",
>> line 222, in resolveDefinitions
>>     resolvable._resolve()
>>   File
>> "/home/u549486/apps/virtualenv-1.9.1/myVE/lib/python2.6/site-packages/pyxb/xmlschema/structures.py",
>> line 4392, in _resolve
>>     self.__initializeFromList(candidate, **kw)
>>   File
>> "/home/u549486/apps/virtualenv-1.9.1/myVE/lib/python2.6/site-packages/pyxb/xmlschema/structures.py",
>> line 4066, in __initializeFromList
>>     return self.__completeResolution(body, self.VARIETY_list,
>> self._DA_list)
>>   File
>> "/home/u549486/apps/virtualenv-1.9.1/myVE/lib/python2.6/site-packages/pyxb/xmlschema/structures.py",
>> line 4270, in __completeResolution
>>     self.__itemTypeDefinition = it_en.typeDefinition()
>>   File
>> "/home/u549486/apps/virtualenv-1.9.1/myVE/lib/python2.6/site-packages/pyxb/namespace/__init__.py",
>> line 98, in __getattr__
>>     category_value =
>> self.namespace().categoryMap(name).get(self.localName())
>>   File
>> "/home/u549486/apps/virtualenv-1.9.1/myVE/lib/python2.6/site-packages/pyxb/namespace/__init__.py",
>> line 295, in categoryMap
>>     raise pyxb.NamespaceError(self, '%s has no category %s' % (self,
>> category))
>> NamespaceError: http://www.w3.org/1999/xhtml has no category
>> typeDefinition
>>
>> I do not know what to make of "NamespaceError:
>> http://www.w3.org/1999/xhtml has no category typeDefinition" Please let
>> me know if you have any suggestions for debugging this.
>>
>>
>> ------------------------------------------------------------------------------
>> Precog is a next-generation analytics platform capable of advanced
>> analytics on semi-structured data. The platform includes APIs for building
>> apps and a phenomenal toolset for data science. Developers can use
>> our toolset for easy data analysis & visualization. Get a free account!
>> http://www2.precog.com/precogplatform/slashdotnewsletter
>> _______________________________________________
>> pyxb-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/pyxb-users
>>
>>
>
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
pyxb-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyxb-users

Reply via email to