You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Kristian Andersen (JIRA)" <xe...@xml.apache.org> on 2004/12/09 22:37:25 UTC

[jira] Commented: (XERCESJ-928) Schema xs:pattern value does not correctly handle [-xxx] or [xxx-]

     [ http://nagoya.apache.org/jira/browse/XERCESJ-928?page=comments#action_56475 ]
     
Kristian Andersen commented on XERCESJ-928:
-------------------------------------------

It looks to me as if E2-18 has been superseded by E2-67 [1] and that "the - character is a valid character range only at the beginning or end of a positive character group"

[1] http://www.w3.org/2001/05/xmlschema-errata#e2-67


Regards, Kristian.

> 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: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org