XML parsing fails in Opera if regex contains ampersand

Apr 7, 2010 at 10:05 AM
Edited Apr 7, 2010 at 10:05 AM
With a regex rule, containing ampersands ("^[a-zA-Z0-9/€?:().,'+&\\s-]*$") the Opera's strict XML parser fails with: XML parsing failed XML parsing failed: syntax error (Line: 638, Character: 220) Reparse document as HTML Error: invalid entity reference Specification: http://www.w3.org/TR/REC-xml/#NT-EntityRef <script type="text/javascript">xVal.AttachValidator("foo", {"Fields":[{"FieldName":"bar","FieldRules":[{"RuleName":"RegEx","RuleParameters":{"Pattern":"^[a-zA-Z0-9/€?:().,\u0027+&\\s-]*$"},"Message":"Field contains invalid characters."},..... It highlights the "&" character in regex pattern. Note that the apostrophe character was properly encoded. Ampersand should probably also be encoded or put a CDATA or a html comment between script tag and xVal.AttachValidator function call (Opera 10.51, xVal 1.0)