Menu

#27 Assertion Error while create the DS

2.0
closed
None
2021-10-20
2021-10-19
Samantha R
No

When executing the command generateDS -o pocd.py -s pocd_sub.py pocd.xsd I get the below error.

Traceback (most recent call last): File "/home/samanthb/.pyenv/versions/3.8.12/bin/generateDS", line 8, in <module> sys.exit(main()) File "/home/samanthb/.pyenv/versions/3.8.12/bin/generateDS.py", line 9863, in main parseAndGenerate( File "/home/samanthb/.pyenv/versions/3.8.12/bin/generateDS.py", line 9175, in parseAndGenerate result = process_includes.process_include_files( File "/home/samanthb/.pyenv/versions/3.8.12/bin/process_includes.py", line 186, in process_include_files doc, ns_dict, schema_ns_dict, rename_data = prep_schema_doc( File "/home/samanthb/.pyenv/versions/3.8.12/bin/process_includes.py", line 591, in prep_schema_doc collect_inserts(root1, params, inserts, ns_dict, File "/home/samanthb/.pyenv/versions/3.8.12/bin/process_includes.py", line 410, in collect_inserts aux_roots = collect_inserts_aux( File "/home/samanthb/.pyenv/versions/3.8.12/bin/process_includes.py", line 433, in collect_inserts_aux assert(root.attrib['targetNamespace'] == AssertionError
Installed generateDS using pip command.
OS: ArcoLinux
Python Version: 3.8.12 (pyenv)

Discussion

  • Dave Kuhlman

    Dave Kuhlman - 2021-10-19

    Samantha,

    Thank you for reporting this. I was able to reproduce this error using the POCD_MT000040.xsd schema that I found at https://github.com/srdc/ontmalizer. I'm guessing that you were using the same.

    Here are notes from the README.rst:

    Version 2.40.5 (10/19/2021)
    
    
    - Fix to test for targetNamespace agreement between including and
      included schemas.  Thanks to Samantha R. for this report.
      See ticket #27 "Assertion Error while create the DS" at
      SourceForge.
    
      Comment: The assertion exception was caused by a check for
      consistency of the targetNamespace between including and included
      schemas.  I'm wondering if generateds should be checking schemas
      for correctness.  Perhaps, if we can parse the schemas (with Lxml
      etree) we should always try to generate a module.  At any rate, I
      modified the test so that it passes.
    
      See the following for a description of this requirement:
    
    
      - https://www.w3schools.com/xml/el_include.asp
      - "Definitive XML Schema", by Priscilla Walmsley, page 66, section
        4.4.1 "Include"
    
      The following schemas reproduced the error and can be used for testing:
      https://github.com/srdc/ontmalizer
    

    Thanks again. Please let me know if this does not fix the issue for you.

    Dave

     
    👍
    1
  • Samantha R

    Samantha R - 2021-10-20

    Thank you Dave. The newer version is now working as expect.

     
    • Samantha R

      Samantha R - 2021-10-20

      We can close this issue.

       
  • Dave Kuhlman

    Dave Kuhlman - 2021-10-20
    • status: open --> closed
     
  • Dave Kuhlman

    Dave Kuhlman - 2021-10-20

    Closed

     

Log in to post a comment.

MongoDB Logo MongoDB