在根据模式验证XML时,出现即将出现的错误。XML模式定义中的正则表达式失败
Value 'this/is/a/simple/node-path' is not facet-valid
with respect to pattern '^(\w+[\w\-/])+\w' for type 'PathModel'.
PathModel
类型的定义被定义为simpleType
如下面的片断所示。它被使用<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)
怎么回事?谢谢
谢谢你的回答。 Jiri Patera的帖子解决了这个问题。 – codevour 2010-12-07 08:32:15
啊...所以它看起来这个错误是在微软的.NET 2 XSD实现中,而不是你的:-)。 – 2010-12-07 10:36:22