{"id":13432799,"url":"https://github.com/mganss/XmlSchemaClassGenerator","last_synced_at":"2025-03-17T10:32:42.209Z","repository":{"id":12644921,"uuid":"15316474","full_name":"mganss/XmlSchemaClassGenerator","owner":"mganss","description":"Generate C# classes from XML Schema files","archived":false,"fork":false,"pushed_at":"2024-08-30T17:33:32.000Z","size":6577,"stargazers_count":591,"open_issues_count":45,"forks_count":178,"subscribers_count":25,"default_branch":"master","last_synced_at":"2024-10-04T21:16:38.202Z","etag":null,"topics":["c-sharp","code-generation","code-generator","xml-schema","xmlserializer","xsd"],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mganss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-12-19T16:17:42.000Z","updated_at":"2024-09-26T21:53:33.000Z","dependencies_parsed_at":"2023-10-13T22:14:53.909Z","dependency_job_id":"19703825-a9fa-4cbb-8e85-90343a6a0fda","html_url":"https://github.com/mganss/XmlSchemaClassGenerator","commit_stats":{"total_commits":625,"total_committers":58,"mean_commits":"10.775862068965518","dds":0.5711999999999999,"last_synced_commit":"870d816170229612adda0615c3acb87a2054b4cf"},"previous_names":[],"tags_count":308,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mganss%2FXmlSchemaClassGenerator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mganss%2FXmlSchemaClassGenerator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mganss%2FXmlSchemaClassGenerator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mganss%2FXmlSchemaClassGenerator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mganss","download_url":"https://codeload.github.com/mganss/XmlSchemaClassGenerator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221675262,"owners_count":16861860,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-sharp","code-generation","code-generator","xml-schema","xmlserializer","xsd"],"created_at":"2024-07-31T02:01:16.730Z","updated_at":"2025-03-17T10:32:42.197Z","avatar_url":"https://github.com/mganss.png","language":"HTML","readme":"XmlSchemaClassGenerator\n=======================\n\n[![Nuget](https://img.shields.io/nuget/v/XmlSchemaClassGenerator-beta)](https://www.nuget.org/packages/XmlSchemaClassGenerator-beta/)\n[![Build status](https://ci.appveyor.com/api/projects/status/yhxiw0stmv5y7f6n/branch/master?svg=true)](https://ci.appveyor.com/project/mganss/xmlschemaclassgenerator/branch/master)\n[![codecov.io](https://codecov.io/github/mganss/XmlSchemaClassGenerator/coverage.svg?branch=master)](https://codecov.io/github/mganss/XmlSchemaClassGenerator?branch=master)\n[![netstandard2.0](https://img.shields.io/badge/netstandard-2.0-brightgreen.svg)](https://img.shields.io/badge/netstandard-2.0-brightgreen.svg)\n[![net462](https://img.shields.io/badge/net-462-brightgreen.svg)](https://img.shields.io/badge/net-462-brightgreen.svg)\n\nA console program and library to generate \n[XmlSerializer](http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx) compatible C# classes\nfrom [XML Schema](http://en.wikipedia.org/wiki/XML_Schema_(W3C)) files.\n\nFeatures\n--------\n\n* Map XML namespaces to C# namespaces, either explicitly or through a (configurable) function\n* Generate C# XML comments from schema annotations\n* Generate [DataAnnotations](http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.aspx) attributes \nfrom schema restrictions\n* Use [`Collection\u003cT\u003e`](http://msdn.microsoft.com/en-us/library/ms132397.aspx) properties \n(initialized in constructor and with private setter)\n* 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)\n* Automatic properties\n* Pascal case for classes and properties\n* Generate nullable adapter properties for optional elements and attributes without default values (see [below](#nullables))\n* Optional support for PCL\n* Optional support for [`INotifyPropertyChanged`](http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged)\n* Optional support for Entity Framework Code First (automatically generate key properties)\n* Optionally generate interfaces for groups and attribute groups\n* Optionally generate one file per class\n* Support for nullable reference types (NRTs) through [`AllowNullAttribute`](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.allownullattribute) and [`MaybeNullAttribute`](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.maybenullattribute)\n* Optionally generate a common specific type for union member types\n\nUnsupported:\n\n* Some restriction types\n* Recursive choices and choices whose elements have minOccurs \u003e 0 or nillable=\"true\" (see [below](#choice))\n* Possible name clashes and invalid identifiers when names contain non-alphanumeric characters\n* Groups with maxOccurs \u003e 0\n\nUsage\n-----\n\nFor command line use, choose your preferred installation:\n- Binary zips included in the [releases on GitHub](https://github.com/mganss/XmlSchemaClassGenerator/releases)\n- Binaries in the tools folder in the [console application NuGet package](https://www.nuget.org/packages/XmlSchemaClassGenerator.Console/)\n- .NET Core CLI tool available in the [dotnet-xscgen NuGet package](https://www.nuget.org/packages/dotnet-xscgen/)\n- CI Builds are available at the NuGet feed https://ci.appveyor.com/nuget/xmlschemaclassgenerator-0f1t3r6ti475\n\n\u003cpre\u003e\nUsage: xscgen [OPTIONS]+ xsdFile...\nGenerate C# classes from XML Schema files.\nVersion ...\nxsdFiles may contain globs, e.g. \"content\\{schema,xsd}\\**\\*.xsd\", and URLs.\nAppend - to option to disable it, e.g. --interface-.\n\nOptions:\n  -h, --help                 show this message and exit\n  -n, --namespace=VALUE      map an XML namespace to a C# namespace\n                               Separate XML namespace and C# namespace by '='.\n                               A single value (no '=') is taken as the C#\n                               namespace the empty XML namespace is mapped to.\n                               One option must be given for each namespace to\n                               be mapped.\n                               A file name may be given by appending a pipe\n                               sign (|) followed by a file name (like schema.\n                               xsd) to the XML namespace.\n                               If no mapping is found for an XML namespace, a\n                               name is generated automatically (may fail).\n      --nf, --namespaceFile=VALUE\n                             file containing mappings from XML namespaces to C#\n                               namespaces\n                               The line format is one mapping per line: XML\n                               namespace = C# namespace [optional file name].\n                               Lines starting with # and empty lines are\n                               ignored.\n      --tns, --typeNameSubstitute=VALUE\n                             substitute a generated type/member name\n                               Separate type/member name and substitute name by\n                               '='.\n                               Prefix type/member name with an appropriate kind\n                               ID as documented at: \u003ca href=\"https://t.ly/HHEI\"\u003ehttps://t.ly/HHEI\u003c/a\u003e.\n                               Prefix with 'A:' to substitute any type/member.\n      --tnsf, --typeNameSubstituteFile=VALUE\n                             file containing generated type/member name\n                               substitute mappings\n                               The line format is one mapping per line:\n                               prefixed type/member name = substitute name.\n                               Lines starting with # and empty lines are\n                               ignored.\n  -o, --output=FOLDER        the FOLDER to write the resulting .cs files to\n  -d, --datetime-offset      map xs:datetime and derived types to System.\n                               DateTimeOffset instead of System.DateTime\n  -i, --integer=TYPE         map xs:integer and derived types to TYPE instead\n                               of automatic approximation\n                               TYPE can be i[nt], l[ong], or d[ecimal]\n      --fb, --fallback, --use-integer-type-as-fallback\n                             use integer type specified via -i only if no type\n                               can be deduced\n  -e, --edb, --enable-data-binding\n                             enable INotifyPropertyChanged data binding\n  -r, --order                emit order for all class members stored as XML\n                               element\n  -c, --pcl                  PCL compatible output\n  -p, --prefix=PREFIX        the PREFIX to prepend to auto-generated namespace\n                               names\n  -v, --verbose              print generated file names on stdout\n  -0, --nullable             generate nullable adapter properties for optional\n                               elements/attributes w/o default values\n  -f, --ef                   generate Entity Framework Code First compatible\n                               classes\n  -t, --interface            generate interfaces for groups and attribute\n                               groups (default is enabled)\n  -a, --pascal               use Pascal case for class and property names (\n                               default is enabled)\n      --av, --assemblyVisible\n                             use the internal visibility modifier (default is\n                               false)\n  -u, --enableUpaCheck       should XmlSchemaSet check for Unique Particle\n                               Attribution (UPA) (default is enabled)\n      --ct, --collectionType=VALUE\n                             collection type to use (default is System.\n                               Collections.ObjectModel.Collection`1)\n      --cit, --collectionImplementationType=VALUE\n                             the default collection type implementation to use (\n                               default is null)\n      --csm, --collectionSettersMode=Private, Public, PublicWithoutConstructorInitialization, Init, InitWithoutConstructorInitialization\n                             generate a private, public, or init-only setter\n                               with or without backing field initialization for\n                               collections\n                               (default is Private; can be: Private, Public,\n                               PublicWithoutConstructorInitialization, Init,\n                               InitWithoutConstructorInitialization)\n      --ctro, --codeTypeReferenceOptions=GlobalReference, GenericTypeParameter\n                             the default CodeTypeReferenceOptions Flags to use (\n                               default is unset; can be: GlobalReference,\n                               GenericTypeParameter)\n      --tvpn, --textValuePropertyName=VALUE\n                             the name of the property that holds the text value\n                               of an element (default is Value)\n      --dst, --debuggerStepThrough\n                             generate DebuggerStepThroughAttribute (default is\n                               enabled)\n      --dc, --disableComments\n                             do not include comments from xsd\n      --nu, --noUnderscore   do not generate underscore in private member name (\n                               default is false)\n      --da, --description    generate DescriptionAttribute (default is true)\n      --cc, --complexTypesForCollections\n                             generate complex types for collections (default is\n                               true)\n  -s, --useShouldSerialize   use ShouldSerialize pattern instead of Specified\n                               pattern (default is false)\n      --sf, --separateFiles  generate a separate file for each class (default\n                               is false)\n      --nh, --namespaceHierarchy\n                             generate a separate folder for namespace hierarchy.\n                                Implies \"separateFiles\" if true (default is\n                               false)\n      --sg, --separateSubstitutes\n                             generate a separate property for each element of a\n                               substitution group (default is false)\n      --dnfin, --doNotForceIsNullable\n                             do not force generator to emit IsNullable = true\n                               in XmlElement annotation for nillable elements\n                               when element is nullable (minOccurs \u003c 1 or\n                               parent element is choice) (default is false)\n      --cn, --compactTypeNames\n                             use type names without namespace qualifier for\n                               types in the using list (default is false)\n      --cl, --commentLanguages=VALUE\n                             comment languages to use (default is en; supported\n                               are en, de)\n      --un, --uniqueTypeNames\n                             generate type names that are unique across\n                               namespaces (default is false)\n      --gc, --generatedCodeAttribute\n                             add version information to GeneratedCodeAttribute (\n                               default is true)\n      --nc, --netCore        generate .NET Core specific code that might not\n                               work with .NET Framework (default is false)\n      --nr, --nullableReferenceAttributes\n                             generate attributes for nullable reference types (\n                               default is false)\n      --ar, --useArrayItemAttribute\n                             use ArrayItemAttribute for sequences with single\n                               elements (default is true)\n      --es, --enumAsString   Use string instead of enum for enumeration\n      --ca, --commandArgs    generate a comment with the exact command line\n                               arguments that were used to generate the source\n                               code (default is true)\n      --uc, --unionCommonType\n                             generate a common type for unions if possible (\n                               default is false)\n      --dtd, --allowDtdParse\n                             allow DTD parsing (default is false)\n      --ns, --namingScheme   use the specified naming scheme for class and\n                               property names (default is Pascal; can be:\n                               Direct, Pascal, Legacy)\n      --fu, --forceUriScheme=VALUE\n                             force URI scheme when resolving URLs (default is\n                               none; can be: none, same, or any defined value\n                               for scheme, like https or http)\n\u003c/pre\u003e\n\nFor use from code use the [library NuGet package](https://www.nuget.org/packages/XmlSchemaClassGenerator-beta/):\n\n```C#\nvar generator = new Generator\n{\n    OutputFolder = outputFolder,\n    Log = s =\u003e Console.Out.WriteLine(s),\n    GenerateNullables = true,\n    NamespaceProvider = new Dictionary\u003cNamespaceKey, string\u003e \n    { \n        { new NamespaceKey(\"http://wadl.dev.java.net/2009/02\"), \"Wadl\" } \n    }\n    .ToNamespaceProvider(new GeneratorConfiguration { NamespacePrefix = \"Wadl\" }.NamespaceProvider.GenerateNamespace)\n};\n\ngenerator.Generate(files);\n```\n\nSpecifying the `NamespaceProvider` is optional. If you don't provide one, C# namespaces will be generated automatically. The example above shows how to create a custom `NamespaceProvider` that has a dictionary for a number of specific namespaces as well as a generator function for XML namespaces that are not in the dictionary. In the example the generator function is the default function but with a custom namespace prefix. You can also use a custom generator function, e.g.\n\n```C#\nvar generator = new Generator\n{\n    NamespaceProvider = new NamespaceProvider\n    { \n        GenerateNamespace = key =\u003e ...\n    }\n};\n```\n\n### Mapping xsd files to C# namespaces\n\nUsing the optional `|` syntax of the `-n` command line option you can map individual xsd files to C# namespaces. If you have several input files using the same XML namespace you can still generate an individual C# namespace for the types defined within a single xsd file. For example, if you have two input files `a.xsd` and `b.xsd` both of which have the same `targetNamespace` of `http://example.com/namespace` you can generate the C# namespaces `Example.NamespaceA` and `Example.NamespaceB`:\n\n```\nxscgen -n \"|a.xsd=Example.NamespaceA\" -n \"|b.xsd=Example.NamespaceB\" a.xsd b.xsd\n```\n\n#### Mapping empty XML namespaces\n\nIn order to provide a C# namespace name for an empty XML namespace you can specify it on the command line like this:\n\n```\nxscgen -n Example example.xsd\n```\n\nAn alternative form that is also valid is `-n =Example`. Note the space between `-n` and `=Example`.\n\n#### Using mapping files\n\nInstead of specifying the namespace mappings on the command line you can also use a mapping file which should contain one mapping per line in the following format:\n\n```\n# Comment\n\nhttp://example.com = Example.NamespaceA a.xsd\nhttp://example.com = Example.NamespaceB b.xsd\nEmpty\n# or alternatively\n= Empty\n```\n\nUse the `--nf` option to specify the mapping file.\n\n### Substituting generated C# type and member names\n\nIf a xsd file specifies obscure names for their types (classes, enums) or members (properties), you can substitute these using the `--tns`/`--typeNameSubstitute=` parameter:\n\n```\nxscgen --tns T:Example_RootType=Example --tns T:Example_RootTypeExampleScope=ExampleScope --tns P:StartDateDateTimeValue=StartDate example.xsd\n```\n\nThe syntax for substitution is: `{kindId}:{generatedName}={substituteName}`\n\nThe `{kindId}` is a single character identifier based on [documentation/analysis ID format](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/documentation-comments#d42-id-string-format), where valid values are:\n\n| ID | Scope |\n| -  | - |\n| `P` | Property |\n| `T` | Type: `class`, `enum`, `interface` |\n| `A` | Any property and/or type |\n\n#### Using substitution files\n\nInstead of specifying the substitutions on the command line you can also use a substitution file which should contain one substitution per line in the following format:\n\n```\n# Comment\nT:Example_RootType = Example\nT:Example_RootTypeExampleScope = ExampleScope\nP:StartDateDateTimeValue = StartDate\n```\n\nUse the `--tnsf`/`--typeNameSubstituteFile` option to specify the substitution file.\n\nNullables\u003ca name=\"nullables\"\u003e\u003c/a\u003e\n---------------------------------\n\nXmlSerializer has been present in the .NET Framework since version 1.1 \nand has never been updated to provide support for nullables\nwhich are a natural fit for the problem of signaling the absence or presence of a value type\nbut have only been present since .NET Framework 2.0.\n\nInstead XmlSerializer has support for a pattern where you provide an additional bool property\nwith \"Specified\" appended to the name to signal if the original property should be serialized. \nFor example:\n\n```xml\n\u003cxs:attribute name=\"id\" type=\"xs:int\" use=\"optional\"\u003e...\u003c/xs:attribute\u003e\n```\n\n```C#\n[System.Xml.Serialization.XmlAttributeAttribute(\"id\", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType=\"int\")]\npublic int Id { get; set; }\n\n[System.Xml.Serialization.XmlIgnoreAttribute()]\npublic bool IdSpecified { get; set; }\n```\n\nXmlSchemaClassGenerator can optionally generate an additional nullable property that works as an adapter to both properties:\n\n```C#\n[System.Xml.Serialization.XmlAttributeAttribute(\"id\", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType=\"int\")]\npublic int IdValue { get; set; }\n        \n[System.Xml.Serialization.XmlIgnoreAttribute()]\npublic bool IdValueSpecified { get; set; }\n\n[System.Xml.Serialization.XmlIgnoreAttribute()]\npublic System.Nullable\u003cint\u003e Id\n{\n    get\n    {\n        if (this.IdValueSpecified)\n        {\n            return this.IdValue;\n        }\n        else\n        {\n            return null;\n        }\n    }\n    set\n    {\n        this.IdValue = value.GetValueOrDefault();\n        this.IdValueSpecified = value.HasValue;\n    }\n}\n```\n\nChoice Elements\u003ca name=\"choice\"\u003e\u003c/a\u003e\n------------------------------------\n\nThe support for choice elements differs from that [provided by xsd.exe](http://msdn.microsoft.com/en-us/library/sa6z5baz).\nXsd.exe generates a property called `Item` of type `object` and, if not all choices have a distinct type, \nanother enum property that selects the chosen element.\nBesides being non-typesafe and non-intuitive, this approach breaks apart if the choices have a more complicated structure (e.g. sequences),\nresulting in possibly schema-invalid XML.\n\nXmlSchemaClassGenerator currently simply pretends choices are sequences.\nThis means you'll have to take care only to set a schema-valid combination of these properties to non-null values.\n\nInterfaces\u003ca name=\"interfaces\"\u003e\u003c/a\u003e\n-----------------------------------\n\nGroups and attribute groups in XML Schema are reusable components that can be included in multiple type definitions. XmlSchemaClassGenerator can optionally generate interfaces from these groups to make it easier to access common properties on otherwise unrelated classes. So\n\n```XML\n\u003cxs:attributeGroup name=\"Common\"\u003e\n  \u003cxs:attribute name=\"name\" type=\"xs:string\"\u003e\u003c/xs:attribute\u003e\n\u003c/xs:attributeGroup\u003e\n\n\u003cxs:complexType name=\"A\"\u003e\n  \u003cxs:attributeGroup ref=\"Common\"/\u003e\n\u003c/xs:complexType\u003e\n\n\u003cxs:complexType name=\"B\"\u003e\n  \u003cxs:attributeGroup ref=\"Common\"/\u003e\n\u003c/xs:complexType\u003e\n```\n\nbecomes\n\n```C#\npublic partial interface ICommon\n{\n  string Name { get; set; }\n}\n\npublic partial class A: ICommon\n{\n  public string Name { get; set; }\n}\n\npublic partial class B: ICommon\n{\n  public string Name { get; set; }\n}\n```\n\nCollection types\n----------------\n\nValues for the `--collectionType` and `--collectionImplementationType` options have to be given in the format accepted by\nthe [`Type.GetType()`](https://docs.microsoft.com/en-us/dotnet/api/system.type.gettype) method. For the `System.Collections.Generic.List\u003cT\u003e` class this means ``System.Collections.Generic.List`1``.\nMake sure to escape the backtick character (`` ` ``) to prevent it from being interpreted by the shell.\n\nInteger and derived types\n---------------------\nNot all numeric types defined by XML Schema can be safely and accurately mapped to .NET numeric data types, however, it's possible to approximate the mapping based on the integer bounds and restrictions such as `totalDigits`.  \nIf an explicit integer type mapping is specified via `--integer=TYPE`, that type will be used, otherwise an approximation will be made based on the table below. If you additionally specify `--fallback`, the type specified via `--integer=TYPE` will be used only if no type can be deduced by applying the rules below.\n\nIf the restrictions `minInclusive` and `maxInclusive` are present on the integer element, then the smallest CLR type that fully encompasses the specified range will be used. Unsigned types are given precedence over signed types. The following table shows the possible ranges and their corresponding CLR type, in the order they will be applied.\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eMinimum (Inclusive)\u003c/th\u003e\n\t\u003cth\u003eMaximum (Inclusive)\u003c/th\u003e\n\t\u003cth\u003eC# type\u003c/th\u003e\n\t\u003ctr\u003e\u003ctd\u003esbyte.MinValue\u003c/td\u003e\u003ctd\u003esbyte.MaxValue\u003c/td\u003e\u003ctd\u003esbyte\u003c/td\u003e\u003c/tr\u003e\n\t\u003ctr\u003e\u003ctd\u003ebyte.MinValue\u003c/td\u003e\u003ctd\u003ebyte.MaxValue\u003c/td\u003e\u003ctd\u003ebyte\u003c/td\u003e\u003c/tr\u003e\n\t\u003ctr\u003e\u003ctd\u003eushort.MinValue\u003c/td\u003e\u003ctd\u003eushort.MaxValue\u003c/td\u003e\u003ctd\u003eushort\u003c/td\u003e\u003c/tr\u003e\n\t\u003ctr\u003e\u003ctd\u003eshort.MinValue\u003c/td\u003e\u003ctd\u003eshort.MaxValue\u003c/td\u003e\u003ctd\u003eshort\u003c/td\u003e\u003c/tr\u003e\n\t\u003ctr\u003e\u003ctd\u003euint.MinValue\u003c/td\u003e\u003ctd\u003euint.MaxValue\u003c/td\u003e\u003ctd\u003euint\u003c/td\u003e\u003c/tr\u003e\n\t\u003ctr\u003e\u003ctd\u003eint.MinValue\u003c/td\u003e\u003ctd\u003eint.MaxValue\u003c/td\u003e\u003ctd\u003eint\u003c/td\u003e\u003c/tr\u003e\n\t\u003ctr\u003e\u003ctd\u003eulong.MinValue\u003c/td\u003e\u003ctd\u003eulong.MaxValue\u003c/td\u003e\u003ctd\u003eulong\u003c/td\u003e\u003c/tr\u003e\n\t\u003ctr\u003e\u003ctd\u003elong.MinValue\u003c/td\u003e\u003ctd\u003elong.MaxValue\u003c/td\u003e\u003ctd\u003elong\u003c/td\u003e\u003c/tr\u003e\n\t\u003ctr\u003e\u003ctd\u003edecimal.MinValue\u003c/td\u003e\u003ctd\u003edecimal.MaxValue\u003c/td\u003e\u003ctd\u003edecimal\u003c/td\u003e\u003c/tr\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\nIf the range specified by `minInclusive` and `maxInclusive` does not fit in any CLR type, or if those restrictions are not present, then the `totalDigits` restriction will be used, as shown in the following table.\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eXML Schema type\u003c/th\u003e\n    \u003cth\u003etotalDigits\u003c/th\u003e\n    \u003cth\u003eC# type\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\u003ctd rowspan=\"6\"\u003exs:positiveInteger\u003cbr\u003exs:nonNegativeInteger\u003c/td\u003e\u003ctd\u003e\u0026lt;3\u003c/td\u003e\u003ctd\u003ebyte\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003e\u0026lt;5\u003c/td\u003e\u003ctd\u003eushort\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003e\u0026lt;10\u003c/td\u003e\u003ctd\u003euint\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003e\u0026lt;20\u003c/td\u003e\u003ctd\u003eulong\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003e\u0026lt;30\u003c/td\u003e\u003ctd\u003edecimal\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003e\u0026gt;=30\u003c/td\u003e\u003ctd\u003estring\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd rowspan=\"6\"\u003exs:integer\u003cbr\u003exs:nonPositiveInteger\u003cbr\u003exs:negativeInteger\u003c/td\u003e\u003ctd\u003e\u0026lt;3\u003c/td\u003e\u003ctd\u003esbyte\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003e\u0026lt;5\u003c/td\u003e\u003ctd\u003eshort\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003e\u0026lt;10\u003c/td\u003e\u003ctd\u003eint\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003e\u0026lt;19\u003c/td\u003e\u003ctd\u003elong\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003e\u0026lt;29\u003c/td\u003e\u003ctd\u003edecimal\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003e\u0026gt;=29\u003c/td\u003e\u003ctd\u003estring\u003c/td\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\nUnions\n------\n\nIf you specify `--unionCommonType`, XmlSchemaClassGenerator will try to determine a common type for a union's member types. If, for example, the member types\nare all integer types, then the narrowest integer type will be used that can fit all member types.\n\nNote that semantic issues might arise with this approach. For example, `DateTime` values are serialized with both date and time information included. See discussion at [#397](https://github.com/mganss/XmlSchemaClassGenerator/issues/397).\n\nContributing\n------------\n\nContributions are welcome. Here are some guidelines:\n\n- If it's not a trivial fix, please submit an issue first\n- Try and blend new code with the existing code's style\n- Add unit tests\n","funding_links":[],"categories":["HTML","others"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmganss%2FXmlSchemaClassGenerator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmganss%2FXmlSchemaClassGenerator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmganss%2FXmlSchemaClassGenerator/lists"}