Error generating class c# from XSD

Asked

Viewed 56 times

2

Guys, I’m having to change the XSD version of my application, because the ANS has now made it more flexible to send the SIB to the SIB FLEX.

Link to the XSD: http://www.ans.gov.br/padroes/sib/schemas/sib.xsd

With this, I have to generate a new class c# on top of this new XSD that I mentioned above. Only I’m not managing to generate the class, because, these errors are presented:

inserir a descrição da imagem aqui

Ok... But as I am a bit of a beginner in programming I would like to know.

1 - The declaration of these types is made in the class generated from this XSD?

2 - If yes, how will I solve this problem if I can’t generate the class?

3 - If not, how do I declare those types in those errors?

4 - How to resolve this situation?

Thank you for your attention.

1 answer

1


From what you can tell from XSD, there are two files that are included in schema:

<!-- Inclusão do arquivo simpleType-->
<xsd:include schemaLocation="sibSimpleType.xsd"/>
<!-- -->
<!-- Inclusão do arquivo complexType-->
<xsd:include schemaLocation="sibComplexType.xsd"/>

To generate the file class sib.xsd it is necessary to have, in addition to the XSD "", the XSD corresponding to the types that are missing in that (those indicated above), i.e.:

sibSimpleType.xsd
sibComplexType.xsd

With these two XSD "auxiliary" will already be able to generate the class correctly:

xsd sib.xsd /classes

This command will generate the class in the folder where you are running it.
Stress that you need to have writing permissions in folder, otherwise you will have access error.

  • It worked my friend... Thank you so much for your help!!!

  • You are welcome! Give an UP and mark the answer as correct :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.