【发布时间】:2013-03-15 20:50:10
【问题描述】:
在 XML Schema 中,如何使元素 Age 具有 restriction 以允许写入最大值为 10 和最小值为 1 的整数,在元素 Age 内部以及元素 Age 具有属性?
<xsd:element name="Age">
<xsd:complexType>
here i want to have restriction to control max and min value inside Age element
<xsd:attribute name="type" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
没有警告的 XML 代码
<Age type="sth">
5
</Age>
带有警告的 XML 代码
<Age type="sth">
22
</Age>
【问题讨论】: