1
我试图将XSD中的限制添加到复杂类型元素。我尝试使用minInclusive
value =“0.00034”和maxInclusive
value =“99”在我使用XML Notepad 2007验证XML文件时添加边界。我搜索了档案并且难以使用添加位置的语法限制。任何帮助表示赞赏。如何限制元素内容并在XSD中同时定义属性
<xsd:element name="R-value">
<xsd:annotation>
<xsd:documentation>Resistance of material</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:decimal">
<xsd:attribute name="unit" type="resistanceUnitEnum" use="required"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>