Menu

NamespaceError

Help
nicolai
2017-07-05
2017-07-05
  • nicolai

    nicolai - 2017-07-05

    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

     
  • Peter A. Bigot

    Peter A. Bigot - 2017-07-05

    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.

     
  • Peter A. Bigot

    Peter A. Bigot - 2017-07-06

    Thanks; now tracked on github.

     
  • Peter A. Bigot

    Peter A. Bigot - 2017-08-04

    An example bundle showing how to use the modularized XHTML namespace has been added; see issue 81.

     

Log in to post a comment.