aizu-m commented on PR #145:
URL: https://github.com/apache/poi-xmlbeans/pull/145#issuecomment-6400713378

   Fair point. Nobody has complained because the lax side is quiet. A facet 
like `[^\w]+` is usually written to keep word characters out, and with the old 
tables `+`, `$` or `Dž` get through it and validate. I only noticed it when 
running the same schemas through XmlBeans and the JDK's Xerces side by side. 
Xerces changed the same code in 2.12.0, so a schema that passes there can still 
disagree here.
   
   That said, I agree it shouldn't change under existing users. Pushed c788baa:
   
   - default is the old behaviour again. `\w` and `\W` use the XML 1.0 Letter 
and Digit tables, same as before this PR.
   - `-Dxmlbean.regex.strictword=true` switches to the spec definition 
(`[^\p{P}\p{Z}\p{C}]`).
   
   I went with a system property, not an `XmlOptions` setting. Pattern facets 
get compiled when the type system loads (`SchemaRegularExpression.forPattern`), 
and no options are in scope at that point. The `\w` ranges are also cached in a 
static table in `ParserForXMLSchema`. It follows the existing 
`xmlbean.uniqueparticleattribution` style. The tests cover both modes: the 
default keeps the old tables, and the strict test sets the property.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to