[ http://nagoya.apache.org/jira/browse/XERCESJ-928?page=comments#action_56476 ] Michael Glavassevich commented on XERCESJ-928: ----------------------------------------------
E2-67 made it into the 2nd edition of XML schema. The behaviour will be changed to meet the current spec. > Schema xs:pattern value does not correctly handle [-xxx] or [xxx-] > ------------------------------------------------------------------ > > Key: XERCESJ-928 > URL: http://nagoya.apache.org/jira/browse/XERCESJ-928 > Project: Xerces2-J > Type: Bug > Components: XML Schema datatypes > Versions: 2.6.2 > Environment: Operating System: Other > Platform: Other > Reporter: Roger Orr > Assignee: Xerces-J Developers Mailing List > > Overall Description > Xerces-2 does not correctly handle leading or trailing - characters in > character sets, but requires the addition of an escape character \. > Steps to reproduce > Validate the xml: > <Test Sign="-"/> > Using the schema: > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> > <xs:element name="Test"> > <xs:complexType> > <xs:attribute name="Sign" type="Pattern" > use="required"/> > </xs:complexType> > </xs:element> > <xs:simpleType name="Pattern"> > <xs:restriction base="xs:string"> > <xs:pattern value="[+-]"/> > </xs:restriction> > </xs:simpleType> > </xs:schema> > The parser gives the error "InvalidRegex: Pattern value '[+-]' is not a valid > regular expression. The reported error was: ''-' is an invalid character > range. > Write '\-'.'. > According to http://www.w3.org/TR/xmlschema-2/#dt-charrange > "The - character is a valid character range only at the beginning or end of a > �- positive character group�- ." > So the - character should not need to be escaped if it is next to a square > bracket. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://nagoya.apache.org/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
