0

I'm looking for a way to restrict character pair denoting an unicode character from appearing in the resulting XML. This character pair is &# (for example &#xBB) . I'm trying to create a pattern in the XSD schema - to match if such character pair (&#) appear anywhere in the XML file. If such pair appears then the XML validation should fail . The restriction should also take into account the fact that the minimum string length equals to 1 and maximum to 79.

I've been trying to use following regex patternvalue="[^&#]{1,79}" but it does not work as expected. XML by design are encoded in the ISO-8859-2 format so any kind of unicode entries are not permitted.

What is the correct regex to establish such restriction ?

Thank You in advance. Jack

4

1 回答 1

0

XML Schema 看到和验证的数据是实体和字符引用扩展之后的数据。因此,如果 XML 文件包含»,那么架构处理器看到的是». 你不能在不禁止 XSD 的»情况下禁止».

于 2013-06-07T20:19:14.737 回答