RE: forbiddenCharacters data category - related to [ACTIOn-189]

> But I don't think we should disallow [A-[B]] as
> this syntax is available in XML Schema nad XPath 
> 2.0/XQuery 1.0 -- there are plenty of existing 
> implementations around.
> Moreover other languages offer similar syntax. For 
> example in Java you can map this to [A&&[^B]] if 
> I'm not mistaken.

But, as you show, such character class subtraction doesn't have a common syntax across different engines, or it's not supported in other (like JavaScript as far as I know). That's why I think we want to avoid picking the all the features of one engine. For example we wouldn't allow \d, \w, etc. either because it's not interoperable.

On the other hand, the following simpler subset is, I think, fully interoperable:

- The set is defined between square brackets ('[', and ']').
- One or more operators '-' MAY be used to indicate ranges.
- The prefix '^' MAY be used just after the opening bracket to invert the selection.
- The characters '[', ']', '-', '^' and '\' MUST be prefixed with '\' when used as literal.

Cheers,
-yves

Received on Monday, 27 August 2012 20:31:25 UTC