在从客户端向服务器端导入Excel的时候,需要与预设的XSD文档进行匹配。
有的时候在修改一列之后会提示一下错误:
<errors>
<error column="739"
line="2">cvc-minLength-valid: Value '' with length =
'0' is not facet-valid with respect to minLength '1' for type
'string_type'.</error>
<error column="739"
line="2">cvc-type.3.1.3: The value '' of element
'col_16' is not valid.</error>
<error column="1112"
line="2">cvc-minLength-valid: Value '' with length =
'0' is not facet-valid with respect to minLength '1' for type
'string_type'.</error>
<error column="1112"
line="2">cvc-type.3.1.3: The value '' of element
'col_16' is not valid.</error>
<error column="1488"
line="2">cvc-minLength-valid: Value '' with length =
'0' is not facet-valid with respect to minLength '1' for type
'string_type'.</error>
<error column="1488"
line="2">cvc-type.3.1.3: The value '' of element
'col_16' is not valid.</error>
<error column="1861"
line="2">cvc-minLength-valid: Value '' with length =
'0' is not facet-valid with respect to minLength '1' for type
'string_type'.</error>
<error column="1861"
line="2">cvc-type.3.1.3: The value '' of element
'col_16' is not valid.</error>
<error column="2234"
line="2">cvc-minLength-valid: Value '' with length =
'0' is not facet-valid with respect to minLength '1' for type
'string_type'.</error>
<error column="2234"
line="2">cvc-type.3.1.3: The value '' of element
'col_16' is not valid.</error>
<error column="2610"
line="2">cvc-minLength-valid: Value '' with length =
'0' is not facet-valid with respect to minLength '1' for type
'string_type'.</error>
<error column="2610"
line="2">cvc-type.3.1.3: The value '' of element
'col_16' is not valid.</error>
以上提示的错误解决办法是:
在输入的数据中的最小长度和XSD中要求的最短长度是不符的。
解决方法:
在XSD文件中新定义数据类型将其最小长度设置为客户端要求的最短长度,相应的列使用该类型:
例如:
<xs:simpleType
name="string_cifcode">
<xs:restriction
base="xs:string">
<xs:minLength
value="0"/>
</xs:restriction>
</xs:simpleType>
加载中,请稍候......