0

I am trying to generate C# classes from the following XSD file.

I run xsd.exe with the options to generate C# classes. Ideally I would like to create an ORM from the XSD (and thus generate the DDL from the schema file), but I am not sure if XSD.exe is the way to go forward.

In any event, this is what I want to do (in decreasing order of urgency)

  1. Create classes from the XSD file
  2. Provide CRUD functionality (active record pattern) via an (autogenerated?) ORM
  3. Autogenerate DDL from the XSD and populate the db with the permitted values specified in the XSD.

For the last one, I suspect that I may have to hack something together using XSLT.

Starting with the first problem, I run xsd.exe like this:

xsd mddl.xsd /c /eld /o: c:\some\folder

The output from running the above command is:

- Group 'mathNode.model' from targetNamespace='http://www.mddl.org/mddl/3.0-beta' has invalid definition: Circular group reference.

Now I am new to XML/XSD etc - so I am currently stuck on how to resolve this. Can someone spot why the Circular reference is being caused - and more importantly, how to fix it?

oompahloompah
  • 9,087
  • 19
  • 62
  • 90

1 Answers1

0

You may have already seen this; it complains of the same issue, and the answers suggest hand-creating the classes to handle the serialization. Doesn't seem like a great thing to me, but there you go.

I'm running into the same problem with a schema we've been given, and researching other tools that might be able to handle this. There's conflicting information as to whether this is actually valid from an XML Schema standpoint; most people think that it is (though MS disagrees: link).

Community
  • 1
  • 1
Jeff
  • 1,577
  • 1
  • 11
  • 8