我有一个有点简单的 XML 文件:
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<SearchSettings>
<ChangeHistory>
<Changed By="Joe Schmoe" On="2013-07-17">Initial creation of this file.</Changed>
</ChangeHistory>
<Logicals>
<Logical Name="Exact Match" ShortName="EM" Operator="== {0}" />
<Logical Name="Contains" ShortName="Co" Operator="%{0}%" />
<Logical Name="Starts With" ShortName="SW" Operator="{0}%" />
<Logical Name="Ends With" ShortName="EW" Operator="%{0}" />
<Logical Name="Between" ShortName="Be" Operator="gt= {0} AND lt= {0}" />
<Logical Name="Less Than" ShortName="LT" Operator="lt {0}" />
<Logical Name="Greater Than" ShortName="GT" Operator="gt {0}" />
</Logicals>
<LogicalGroupings>
<Group DisplayType="Text" Allowed="EM|Co|SW|EW" />
<Group DisplayType="Decimal" Allowed="EM|Be|LT|GT" />
<Group DisplayType="Integer" Allowed="EM|Be|LT|GT" />
<Group DisplayType="Date" Allowed="EM|Be|LT|GT" />
<Group DisplayType="List" Allowed="EM" />
</LogicalGroupings>
<SearchFields>
<SearchField DisplayName="Complaint Type" DisplayType="List" ColumnName="Complaint.ComplaintTypeID" GetMethod="GetComplaintTypes" ToolTipTitle="" ToolTipContent="" ToolTipKey="" Transform="" />
<SearchField DisplayName="Complaint Number" DisplayType="Text" ColumnName="Complaint.Number" />
<SearchField DisplayName="Tax Year" DisplayType="Integer" ColumnName="Complaint.TaxYear" />
<SearchField DisplayName="Category" DisplayType="List" ColumnName="Complaint.Category" GetMethod="GetExistingCategories" />
<SearchField DisplayName="Building Value" DisplayType="Integer" ColumnName="Complaint.BuildingValue" />
<SearchField DisplayName="Land Value" DisplayType="Integer" ColumnName="Complaint.LandValue" />
<SearchField DisplayName="Owner Opinion" DisplayType="Integer" ColumnName="Complaint.OwnerOpinion" />
<SearchField DisplayName="Notes" DisplayType="Text" ColumnName="Complaint.Notes" AllowedLogicals="Co" />
</SearchFields>
</SearchSettings>
我希望 SearchFields.SearchField.DisplayType 只允许来自 LogicalGroupings 列表的 DisplayType 值。
这可能吗?我一直在尝试添加仅外键的关系,但后来我的模式智能停止工作,所以我认为我错了。
编辑
这是我现有的(工作但还没有我想要的).xsd 文件。我删除了我不关心的部分以节省空间。
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="SearchSettings" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="SearchSettings" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="LogicalGroupings">
<xs:complexType>
<xs:sequence>
<xs:element name="Group" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="DisplayType" type="xs:string" />
<xs:attribute name="Allowed" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SearchFields">
<xs:complexType>
<xs:sequence>
<xs:element name="SearchField" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="DisplayName" type="xs:string" />
<xs:attribute name="DisplayType" type="xs:string" />
<xs:attribute name="ColumnName" type="xs:string" />
<xs:attribute name="GetMethod" type="xs:string" />
<xs:attribute name="ToolTipTitle" type="xs:string" />
<xs:attribute name="ToolTipContent" type="xs:string" />
<xs:attribute name="ToolTipKey" type="xs:string" />
<xs:attribute name="Transform" type="xs:string" />
<xs:attribute name="AllowedLogicals" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>