You're welcome. I don't get the error with the current development
version, so presumably the problem was fixed after 1.2.1, probably when
https://sourceforge.net/apps/trac/pyxb/ticket/183 was resolved.
The declaration was unnecessary since the same namespace was introduced in
the schema tag as xmlns:h and is referenced within the element using that
prefix, so if removing it was enough to make the schema work everything's
good.
Peter
On Fri, Apr 12, 2013 at 8:41 AM, Don Pellegrino <
donald.a.pellegr...@gmail.com> wrote:
> 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 <big...@acm.org> 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 <
>> donald.a.pellegr...@gmail.com> 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
>>> pyxb-users@lists.sourceforge.net
>>> 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
pyxb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyxb-users