【发布时间】:2010-12-06 15:25:56
【问题描述】:
我在根据架构验证 XML 时遇到即将发生的错误。
Value 'this/is/a/simple/node-path' is not facet-valid
with respect to pattern '^(\w+[\w\-/])+\w' for type 'PathModel'.
PathModel 类型的定义定义为simpleType,如下面的 sn-p 所示。被<path>this/is/a/simple/node-path</path>使用
<xs:simpleType name="PathModel">
<xs:restriction base="xs:string">
<xs:pattern value="^(\w+[\w\-/])+\w" />
</xs:restriction>
</xs:simpleType>
预期结果列在此匹配表中。
this/is/a/simple/node-path MATCHING
/this/is/a/simple/node-path NOT MATCHING
this/is/a/simple/node-path/ NOT MATCHING
this/is/a/simple/nodep%th NOT MATCHING (special characters)
出了什么问题?谢谢
【问题讨论】: