Generating a C # Class File from an XML Schema

I want to parse a complex XML schema file and export it to a C # file.

Do I need to use a namespace System.XML.Schema?

+3
source share
2 answers

You can use XSD.EXE and the command will look something like this:

XSD.EXE your.xsd /c

The generated source has several quirks:

  • It generates [SerializableAttribute], [XmlTypeAttribute], [XmlRootAttribute]and so on, and not [DataContract], and [DataMember]that may (not) be an issue for you.
  • It defines child / detail structures using arrays inside, not general List<T>structures.

( ), . , .

+4
+4

Source: https://habr.com/ru/post/1722686/


All Articles