在根據模式驗證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