【发布时间】:2012-01-23 17:24:07
【问题描述】:
在使用生成的 .xsd 时,我在 WebSphere MQ Broker Tool v7.0 中收到以下验证错误:
a-props-correct.2: Invalid value constraint value '0' in attribute 'attrname'.
相关的.xsd文本是属性的用法:
<xsd:complexType name="CTypeContent">
<xsd:simpleContent>
<xsd:extension base="xsd:base64Binary">
<xsd:attribute name="attrname" type="BooleanType" use="optional" default="1" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
以及属性的定义:
<xsd:simpleType name="BooleanType">
<xsd:restriction base="xsd:boolean">
<xsd:pattern value="0|1" />
</xsd:restriction>
</xsd:simpleType>
我在 Google 上搜索过很多关于 SOAP 之类的讨论,但这似乎有点偏离我的项目。我只是想确保 .xsd 中的逻辑是有根据的。
编辑:
如果我删除属性的默认部分,错误就会消失。这对我来说不是一个解决方案 - 但也许它有助于诊断。
【问题讨论】: