Skip to content

XmlSchemaClassGenerator

Generate C# classes from XML Schema files.

Features

  • Map XML namespaces to C# namespaces, either explicitly or through a (configurable) function
  • Generate C# XML comments from schema annotations
  • Generate DataAnnotations attributes from schema restrictions
  • Use Collection<T> properties (initialized in constructor and with private setter)
  • Map xs:integer and derived types to the closest possible .NET type, if not possible - fall back to string. Can be overriden by explicitly defined type (int, long, or decimal)
  • Automatic properties
  • Pascal case for classes and properties
  • Generate nullable adapter properties for optional elements and attributes without default values (see below)
  • Optional support for PCL
  • Optional support for INotifyPropertyChanged
  • Optional support for Entity Framework Code First (automatically generate key properties)
  • Optionally generate interfaces for groups and attribute groups
  • Optionally generate one file per class

Example

xscgen 도구 설치:

dotnet new tool-manifest
dotnet tool install  dotnet-xscgen --version 2.0.490
dotnet tool run xscgen

xscgen 도구 실행 방법:

dotnet tool run xscgen --interface- -n =MusicXmlSchema -o temp ~/Downloads/musicxml-3.1/schema/musicxml.xsd

See also

Favorite site