title: Can I have xml schema define data type choises
body: <p>I have a somewhat simple XML file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" standalone="no" ?&gt;
  &lt;SearchSettings&gt;
      &lt;ChangeHistory&gt;
          &lt;Changed By="Joe Schmoe" On="2013-07-17"&gt;Initial creation of this file.&lt;/Changed&gt;
      &lt;/ChangeHistory&gt;
  
      &lt;Logicals&gt;
          &lt;Logical Name="Exact Match"  ShortName="EM" Operator="== {0}" /&gt;
          &lt;Logical Name="Contains"     ShortName="Co" Operator="%{0}%" /&gt;
          &lt;Logical Name="Starts With"  ShortName="SW" Operator="{0}%" /&gt;
          &lt;Logical Name="Ends With"    ShortName="EW" Operator="%{0}" /&gt;
          &lt;Logical Name="Between"      ShortName="Be" Operator="gt= {0} AND lt= {0}" /&gt;
          &lt;Logical Name="Less Than"    ShortName="LT" Operator="lt {0}" /&gt;
          &lt;Logical Name="Greater Than" ShortName="GT" Operator="gt {0}" /&gt;
      &lt;/Logicals&gt;
  
      &lt;LogicalGroupings&gt;
          &lt;Group DisplayType="Text"    Allowed="EM|Co|SW|EW" /&gt;
          &lt;Group DisplayType="Decimal" Allowed="EM|Be|LT|GT" /&gt;
          &lt;Group DisplayType="Integer" Allowed="EM|Be|LT|GT" /&gt;
          &lt;Group DisplayType="Date"    Allowed="EM|Be|LT|GT" /&gt;
          &lt;Group DisplayType="List"    Allowed="EM" /&gt;
      &lt;/LogicalGroupings&gt;
  
      &lt;SearchFields&gt;
          &lt;SearchField DisplayName="Complaint Type"   DisplayType="List"    ColumnName="Complaint.ComplaintTypeID" GetMethod="GetComplaintTypes" ToolTipTitle="" ToolTipContent="" ToolTipKey="" Transform="" /&gt;
          &lt;SearchField DisplayName="Complaint Number" DisplayType="Text"    ColumnName="Complaint.Number" /&gt;
          &lt;SearchField DisplayName="Tax Year"         DisplayType="Integer" ColumnName="Complaint.TaxYear" /&gt;
          &lt;SearchField DisplayName="Category"         DisplayType="List"    ColumnName="Complaint.Category"        GetMethod="GetExistingCategories" /&gt;
          &lt;SearchField DisplayName="Building Value"   DisplayType="Integer" ColumnName="Complaint.BuildingValue" /&gt;
          &lt;SearchField DisplayName="Land Value"       DisplayType="Integer" ColumnName="Complaint.LandValue" /&gt;
          &lt;SearchField DisplayName="Owner Opinion"    DisplayType="Integer" ColumnName="Complaint.OwnerOpinion" /&gt;
          &lt;SearchField DisplayName="Notes"            DisplayType="Text"    ColumnName="Complaint.Notes"           AllowedLogicals="Co" /&gt;
      &lt;/SearchFields&gt;
  &lt;/SearchSettings&gt;
  </code></pre>
  
  <p>And I want the SearchFields.SearchField.DisplayType to only allow the DisplayType values from the LogicalGroupings list.</p>
  
  <p>Is this possible?  I keep trying to add a foreign key only relationship but then my schema intellisence stops working so I figure I am wrong.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Here is my existing (working but without what I want yet) .xsd file.  I removed the sections I do not care about to save space.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xs:schema id="SearchSettings" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"&gt;
    &lt;xs:element name="SearchSettings" msdata:IsDataSet="true" msdata:UseCurrentLocale="true"&gt;
      &lt;xs:complexType&gt;
        &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
          &lt;xs:element name="LogicalGroupings"&gt;
            &lt;xs:complexType&gt;
              &lt;xs:sequence&gt;
                &lt;xs:element name="Group" minOccurs="0" maxOccurs="unbounded"&gt;
                  &lt;xs:complexType&gt;
                    &lt;xs:attribute name="DisplayType" type="xs:string" /&gt;
                    &lt;xs:attribute name="Allowed" type="xs:string" /&gt;
                  &lt;/xs:complexType&gt;
                &lt;/xs:element&gt;
              &lt;/xs:sequence&gt;
            &lt;/xs:complexType&gt;
          &lt;/xs:element&gt;
          &lt;xs:element name="SearchFields"&gt;
            &lt;xs:complexType&gt;
              &lt;xs:sequence&gt;
                &lt;xs:element name="SearchField" minOccurs="0" maxOccurs="unbounded"&gt;
                  &lt;xs:complexType&gt;
                    &lt;xs:attribute name="DisplayName" type="xs:string" /&gt;
                    &lt;xs:attribute name="DisplayType" type="xs:string" /&gt;
                    &lt;xs:attribute name="ColumnName" type="xs:string" /&gt;
                    &lt;xs:attribute name="GetMethod" type="xs:string" /&gt;
                    &lt;xs:attribute name="ToolTipTitle" type="xs:string" /&gt;
                    &lt;xs:attribute name="ToolTipContent" type="xs:string" /&gt;
                    &lt;xs:attribute name="ToolTipKey" type="xs:string" /&gt;
                    &lt;xs:attribute name="Transform" type="xs:string" /&gt;
                    &lt;xs:attribute name="AllowedLogicals" type="xs:string" /&gt;
                  &lt;/xs:complexType&gt;
                &lt;/xs:element&gt;
              &lt;/xs:sequence&gt;
            &lt;/xs:complexType&gt;
          &lt;/xs:element&gt;
        &lt;/xs:choice&gt;
      &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
  &lt;/xs:schema&gt;
  </code></pre>