0

I am trying to generate a C# class from the following ReqIF XSD file.

I have tried with xsd.exe which failed and now also with xsd2code which fails with the following error message (translation: reference to undeclared attribute group):

Xsd2Code Version 3.4.0.32990
Code generation utility from XML schema files.

Error: Verweis auf nicht deklarierte Attributgruppe http://www.w3.org/1999/xhtml:xhtml.style.attrib.
    SubType: Unspecified

    Rule:

I suppose the xsd file is not 100% correct. I tried to get some information about the xsd format, but with my limited knowledge I was not able to solve the issue. Does somebody have an idea what could be wrong here or how I could proceed?

Thanks!

nogenius
  • 574
  • 1
  • 6
  • 18
  • Were you ever able to solve this issue? I'm attempting to use xsd.exe on the same schema and it just stalls at "parsing a schema..." – Jeremy Mangas Mar 27 '16 at 02:33
  • Not really. Actually I removed the BlkStruct.class reference causing the trouble and implemented it manually – nogenius Mar 31 '16 at 20:38
  • Thanks for the response. I was eventually able to solve my issue by overriding some of the behavior as well (for java). I put the answer below in case it help someone in the future. I know it's not C#, so I don't expect any upvotes (possibly some downvotes). – Jeremy Mangas Apr 01 '16 at 13:46
  • Have a look at reqifsharp.org, an open source c# reqif library. Not an answer to your question, but possibly an alternative – Sam Jul 07 '18 at 19:56

1 Answers1

0

I was able to generate java code with the linked files and the following command line on Windows (make sure the files are all in the same directory to make your life easier):

NOTE: It took my PC about 15 minutes to get past the parsing stage. I had thought it was locked up, but grabbed some coffee and was pleasantly surprised when I returned.

"<path_to_xjc.exe>" "<path_to_reqif.xsd>" -b "<path_to_linked_xjb_file>" -extension -p <the.package.name.you.want.to.generate.to>

Link to files I used to generate

Jeremy Mangas
  • 361
  • 1
  • 8