title: xsd2code++ restrictions not generated
body: <p>I tried to generate C#-Classes from XSD using XSD2Code++ (V4.2.0.31, licensed version). The Code generation is working, but it is omitting the restrictions. </p>
  
  <p>XSD:</p>
  
  <pre><code>&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
      &lt;xs:element name ="Product"&gt;
          &lt;xs:complexType&gt;
              &lt;xs:sequence maxOccurs="3"&gt;
                  &lt;xs:element name="Header" minOccurs="1" maxOccurs="1"/&gt;
                  &lt;xs:element name="Body"/&gt;
                  &lt;xs:element name ="value2" maxOccurs="1"&gt;
                      &lt;xs:simpleType&gt;
                           &lt;xs:restriction base="xs:string"&gt;
                               &lt;xs:minLength value="20" /&gt;
                               &lt;xs:maxLength value="22" /&gt;
                           &lt;/xs:restriction&gt;
                      &lt;/xs:simpleType&gt;
                  &lt;/xs:element&gt;
                  &lt;xs:element name ="value4" maxOccurs="1"&gt;
                      &lt;xs:simpleType&gt;
                          &lt;xs:restriction base="xs:int"&gt;
                              &lt;xs:minInclusive value="5" /&gt;
                              &lt;xs:maxInclusive value="6" /&gt;
                          &lt;/xs:restriction&gt;
                      &lt;/xs:simpleType&gt;
                  &lt;/xs:element&gt;
              &lt;/xs:sequence&gt;
          &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>And this code was generated, the restrictions are missing. I expected to see them in the setters.</p>
  
  <pre><code>// ------------------------------------------------------------------------------
  //  &lt;auto-generated&gt;
  //    Generated by Xsd2Code++. Version 4.2.0.31
  //    &lt;NameSpace&gt;xsd2code_Probierprojekt&lt;/NameSpace&gt;&lt;Collection&gt;List&lt;/Collection&gt;&lt;codeType&gt;CSharp&lt;/codeType&gt;&lt;EnableDataBinding&gt;False&lt;/EnableDataBinding&gt;&lt;GenerateCloneMethod&gt;False&lt;/GenerateCloneMethod&gt;&lt;GenerateDataContracts&gt;False&lt;/GenerateDataContracts&gt;&lt;DataMemberNameArg&gt;OnlyIfDifferent&lt;/DataMemberNameArg&gt;&lt;DataMemberOnXmlIgnore&gt;False&lt;/DataMemberOnXmlIgnore&gt;&lt;CodeBaseTag&gt;Net40&lt;/CodeBaseTag&gt;&lt;InitializeFields&gt;All&lt;/InitializeFields&gt;&lt;GenerateUnusedComplexTypes&gt;False&lt;/GenerateUnusedComplexTypes&gt;&lt;GenerateUnusedSimpleTypes&gt;False&lt;/GenerateUnusedSimpleTypes&gt;&lt;GenerateXMLAttributes&gt;True&lt;/GenerateXMLAttributes&gt;&lt;OrderXMLAttrib&gt;False&lt;/OrderXMLAttrib&gt;&lt;EnableLazyLoading&gt;False&lt;/EnableLazyLoading&gt;&lt;VirtualProp&gt;False&lt;/VirtualProp&gt;&lt;PascalCase&gt;False&lt;/PascalCase&gt;&lt;AutomaticProperties&gt;False&lt;/AutomaticProperties&gt;&lt;PropNameSpecified&gt;None&lt;/PropNameSpecified&gt;&lt;PrivateFieldName&gt;StartWithUnderscore&lt;/PrivateFieldName&gt;&lt;PrivateFieldNamePrefix&gt;&lt;/PrivateFieldNamePrefix&gt;&lt;EnableRestriction&gt;True&lt;/EnableRestriction&gt;&lt;RestrictionMaxLenght&gt;True&lt;/RestrictionMaxLenght&gt;&lt;RestrictionRegEx&gt;True&lt;/RestrictionRegEx&gt;&lt;RestrictionRange&gt;True&lt;/RestrictionRange&gt;&lt;ValidateProperty&gt;True&lt;/ValidateProperty&gt;&lt;ClassNamePrefix&gt;&lt;/ClassNamePrefix&gt;&lt;ClassLevel&gt;Public&lt;/ClassLevel&gt;&lt;PartialClass&gt;True&lt;/PartialClass&gt;&lt;ClassesInSeparateFiles&gt;False&lt;/ClassesInSeparateFiles&gt;&lt;ClassesInSeparateFilesDir&gt;&lt;/ClassesInSeparateFilesDir&gt;&lt;TrackingChangesEnable&gt;False&lt;/TrackingChangesEnable&gt;&lt;GenTrackingClasses&gt;False&lt;/GenTrackingClasses&gt;&lt;HidePrivateFieldInIDE&gt;False&lt;/HidePrivateFieldInIDE&gt;&lt;EnableSummaryComment&gt;False&lt;/EnableSummaryComment&gt;&lt;EnableAppInfoSettings&gt;False&lt;/EnableAppInfoSettings&gt;&lt;EnableExternalSchemasCache&gt;False&lt;/EnableExternalSchemasCache&gt;&lt;EnableDebug&gt;False&lt;/EnableDebug&gt;&lt;EnableWarn&gt;False&lt;/EnableWarn&gt;&lt;ExcludeImportedTypes&gt;False&lt;/ExcludeImportedTypes&gt;&lt;ExpandNesteadAttributeGroup&gt;False&lt;/ExpandNesteadAttributeGroup&gt;&lt;CleanupCode&gt;False&lt;/CleanupCode&gt;&lt;EnableXmlSerialization&gt;True&lt;/EnableXmlSerialization&gt;&lt;SerializeMethodName&gt;Serialize&lt;/SerializeMethodName&gt;&lt;DeserializeMethodName&gt;Deserialize&lt;/DeserializeMethodName&gt;&lt;SaveToFileMethodName&gt;SaveToFile&lt;/SaveToFileMethodName&gt;&lt;LoadFromFileMethodName&gt;LoadFromFile&lt;/LoadFromFileMethodName&gt;&lt;EnableEncoding&gt;False&lt;/EnableEncoding&gt;&lt;EnableXMLIndent&gt;False&lt;/EnableXMLIndent&gt;&lt;Encoder&gt;UTF8&lt;/Encoder&gt;&lt;Serializer&gt;XmlSerializer&lt;/Serializer&gt;&lt;sspNullable&gt;False&lt;/sspNullable&gt;&lt;sspString&gt;False&lt;/sspString&gt;&lt;sspCollection&gt;False&lt;/sspCollection&gt;&lt;sspComplexType&gt;False&lt;/sspComplexType&gt;&lt;sspSimpleType&gt;False&lt;/sspSimpleType&gt;&lt;sspEnumType&gt;False&lt;/sspEnumType&gt;&lt;BaseClassName&gt;EntityBase&lt;/BaseClassName&gt;&lt;UseBaseClass&gt;False&lt;/UseBaseClass&gt;&lt;GenBaseClass&gt;False&lt;/GenBaseClass&gt;&lt;CustomUsings&gt;&lt;/CustomUsings&gt;&lt;AttributesToExlude&gt;&lt;/AttributesToExlude&gt;
  //  &lt;/auto-generated&gt;
  // ------------------------------------------------------------------------------
  #pragma warning disable
  
  namespace xsd2code_Probierprojekt
  {
  using System;
  using System.Diagnostics;
  using System.Xml.Serialization;
  using System.Collections;
  using System.Xml.Schema;
  using System.ComponentModel;
  using System.IO;
  using System.Text;
  using System.ComponentModel.DataAnnotations;
  using System.Xml;
  using System.Collections.Generic;
  
  
  [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34209")]
  [System.SerializableAttribute()]
  [System.Diagnostics.DebuggerStepThroughAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
  [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
  public partial class Product
  {     
      private List&lt;object&gt; _header;
      private List&lt;object&gt; _body;
      private List&lt;string&gt; _value2;
      private List&lt;double&gt; _value4;
      private static XmlSerializer serializer;
  
      public Product()
      {
          this._value4 = new List&lt;double&gt;();
          this._value2 = new List&lt;string&gt;();
          this._body = new List&lt;object&gt;();
          this._header = new List&lt;object&gt;();
      }
  
  
      [System.Xml.Serialization.XmlElementAttribute("Header", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public List&lt;object&gt; Header
      {
          get
          {
              return this._header;
          }
          set
          {
              this._header = value;
          }
      }
  
  
      [System.Xml.Serialization.XmlElementAttribute("Body", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public List&lt;object&gt; Body
      {
          get
          {
              return this._body;
          }
          set
          {
              this._body = value;
          }
      }
  
  
      [System.Xml.Serialization.XmlElementAttribute("value2", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public List&lt;string&gt; value2
      {
          get
          {
              return this._value2;
          }
          set
          {
              this._value2 = value;
          }
      }
  
  
      [System.Xml.Serialization.XmlElementAttribute("value4", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
      public List&lt;double&gt; value4
      {
          get
          {
              return this._value4;
          }
          set
          {
              this._value4 = value;
          }
      }
  
  Serialisers and Deserialisers etc.
  
  }
  }
  
  #pragma warning restore
  </code></pre>
  
  <p>Of course, I can validate it by myself, but my company wants to generate the restrictions from XSD to be faster and to avoid errors. This was the reason for purcasing the professional version of xsd2code.</p>
  
  <p>Maybe someone has more experiences than me, 
  thank you in advance!</p>