#735 Schema pattern facet on .NET

v9.0
closed
.NET API (34)
5
2012-10-08
2007-11-13
Michael Kay
No

When a pattern facet in a schema is used to validate an input string using Saxon on .NET, a validation failure may be reported incorrectly. The problem occurs when the pattern in question matches a substring of the input string as well as matching the entire string. For example, the XHTML schema uses the pattern "[-+]?(\d+|\d+(.\d+)?%)", and this reports a failure attempting to match the input string "50%"; the reason for this is that the pattern first matches the substring "50".

A fix will be announced when it is available.

Discussion

  • Michael Kay

    Michael Kay - 2007-11-13

    Logged In: YES
    user_id=251681
    Originator: YES

    Note, although reported against Saxon 9.0, this bug is also likely to affect all previous releases of Saxon on .NET.

     
  • Michael Kay

    Michael Kay - 2007-11-15

    Logged In: YES
    user_id=251681
    Originator: YES

    I can't see any way in the .NET regex API of testing whether a pattern matches an entire string, so I've patched this by changing the RegexTranslator to surround the regex between "^(?:" and ")$" to anchor the match explicitly, and then use IsMatch() on the relevant path. Not yet tested.

     
  • Michael Kay

    Michael Kay - 2007-12-01

    Logged In: YES
    user_id=251681
    Originator: YES

    Fixed in 9.0.0.2