Hey,
I want to generate python code from http://www.omg.org/spec/ReqIF/1.2/
There exist the necessary xsd file, but when i want to generate code : pyxbgen -u reqif.xsd -m reqif
an error occures : raise pyxb.NamespaceError(self, '%s has no category %s' % (self, category))
NamespaceError: http://www.w3.org/1999/xhtml has no category modelGroupDefinition
I can read/understand the output, but I dont know how to handle that. The files are conformed standart... maybe i did something wrong in the command line...
thanks for help
Nicolai
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Since that schema extends the content model of http://www.w3.org/1999/xhtml you would normally need to add this:
--archive-path ${PYXB_ROOT}/pyxb/bundles/common//
to your pyxbgen command line. This tells PyXB to import the content model metadata for the bundle that includes the xhtml namespace.
The schema still won't generate bindings because it references a model group {http://www.w3.org/1999/xhtml}xhtml.BlkStruct.class that only exists in the modularized version of that namespace, which is not what PyXB has built-in.
At this time it isn't obvious how or whether PyXB can be made to ignore the built in content model. If you would care to create an issue on github I may be able to look at this in a week or two.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey,
I want to generate python code from http://www.omg.org/spec/ReqIF/1.2/
There exist the necessary xsd file, but when i want to generate code : pyxbgen -u reqif.xsd -m reqif
an error occures : raise pyxb.NamespaceError(self, '%s has no category %s' % (self, category))
NamespaceError: http://www.w3.org/1999/xhtml has no category modelGroupDefinition
I can read/understand the output, but I dont know how to handle that. The files are conformed standart... maybe i did something wrong in the command line...
thanks for help
Nicolai
Since that schema extends the content model of
http://www.w3.org/1999/xhtml
you would normally need to add this:to your
pyxbgen
command line. This tells PyXB to import the content model metadata for the bundle that includes the xhtml namespace.The schema still won't generate bindings because it references a model group
{http://www.w3.org/1999/xhtml}xhtml.BlkStruct.class
that only exists in the modularized version of that namespace, which is not what PyXB has built-in.At this time it isn't obvious how or whether PyXB can be made to ignore the built in content model. If you would care to create an issue on github I may be able to look at this in a week or two.
Thanks; now tracked on github.
An example bundle showing how to use the modularized XHTML namespace has been added; see issue 81.