I'm developing an XML schema and I need to restrict an integer to being within a ranger of -20 to 20, but not 0.
I was going to use minInclusive and maxInclusive for the -20 to 20.
I tried to add the regex "="^(?!0).+", but that does not appear to开发者_如何转开发 be a valid XML regex.
What value can I put in for xs:pattern that will prevent an integer from being 0?
Have you tried enumerating the legal values. Workable since the range is quite small.
Simple lack of escape character. The pattern value should have read "^(\?!0).+".
精彩评论