这是我的xml(不是完整的):
<xsd:complexType name="xx">
<xsd:complexContent>
<xsd:extension base="tns:xx">
<xsd:sequence>
<xsd:element name="rekVrednostDdv" nillable="true" type="decimal"/>
<xsd:element name="xx" nillable="true" type="dateTime"/>
<xsd:element name="xx" nillable="true" type="decimal"/>
<xsd:element name="xx" nillable="true" type="string"/>
<xsd:element name="xx" nillable="true" type="dateTime"/>
<xsd:element name="xx" nillable="true" type="string"/>
<xsd:element name="xx" nillable="true" type="decimal"/>
<xsd:element name="xx" nillable="true" type="decimal"/>
<xsd:element name="xx" nillable="true" type="string"/>
<xsd:element name="xx" nillable="true" type="string"/>
<xsd:element name="xx" nillable="true" type="decimal"/>
<xsd:element name="xx" nillable="true" type="tns:xx"/>
<xsd:element name="xx" nillable="true" type="dateTime"/>
<xsd:element name="xx" nillable="true" type="string"/>
<xsd:element name="xx" nillable="true" type="string"/>
<xsd:element name="xx" nillable="true" type="string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Run Code Online (Sandbox Code Playgroud)
例如,rekVrednostDdv必须具有精度2.如何判断此类型具有精度2.
我试着这样:
<xsd:element name="rekVrednostDdv" nillable="true">
<xsd:simpleType>
<xsd:restriction base="decimal">
<xsd:precision value="6"/>
<xsd:scale value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
Run Code Online (Sandbox Code Playgroud)
但现在我在使用http://www.brainbell.com/tutorials/XML/Working_With_Simple_Types.htm时得到了
Invalid XML schema: 'Element <xsd:precision> is not allowed under element <xsd:restriction>.'
Run Code Online (Sandbox Code Playgroud)
jas*_*sso 19
创建一个新的简单类型,限制xs:decimal并用于<xs:fractionDigits/>定义精度.然后在元素定义中引用此类型.
<xs:simpleType name="decimalTwoPrec">
<xs:restriction base="xs:decimal">
<xs:fractionDigits value="2" />
</xs:restriction>
</xs:simpleType>
<xs:element name="rekVrednostDdv" nillable="true" type="decimalTwoPrec"/>
Run Code Online (Sandbox Code Playgroud)
有关详细信息,请参阅规范http://www.w3.org/TR/xmlschema-2/#rf-fractionDigits
| 归档时间: |
|
| 查看次数: |
27752 次 |
| 最近记录: |