0
votes

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

1

1 Answers

0
votes

The data that XML Schema sees and validates is the data AFTER expansion of entity and character references. So if the XML file contains » then what the schema processor sees is ». You cannot in XSD ban » without also banning ».