【发布时间】:2009-06-29 19:59:36
【问题描述】:
假设我想像这样设置一个通用的 complexType:
<xs:complexType name="button">
<xs:sequence>
<xs:element name="id" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="href" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="label" type="xs:string" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
我想在我的架构文件的不同位置引用该 complexType,如下所示:
<xs:element name="someButton" type="button" />
我是否可以通过 someButton 元素为按钮子元素设置默认值? (即,如果我希望 someButton 的默认标签为“Go”或默认 href 为“index.html”)
基本上...现在我有类似的东西
<Field Name="State" DataSourceField="State" />
我正在尝试以尽可能简单的方式消除冗余。
【问题讨论】: