我有以下文件:
a.xml
<?xml version="1.0"?>
<e xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="a.xsd">
2
</e>
a.xsd
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="e">
<xs:simpletype>
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]"/>
</xs:restriction>
</xs:simpletype>
</xs:element>
</xs:schema>
当验证时我得到:
错误:(4,5)cvc-pattern-valid:值' 2 对于类型'#AnonType_e',相对于模式'[0-9]','并非有效。
我在做什么错了?