[ 
https://issues.apache.org/jira/browse/XERCESJ-325?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Glavassevich reassigned XERCESJ-325:
--------------------------------------------

    Assignee: Khaled Noaman

> Regular Expression; Pattern "|" clause -- order dependent error
> ---------------------------------------------------------------
>
>                 Key: XERCESJ-325
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-325
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.0 Datatypes
>    Affects Versions: 2.0.1
>         Environment: Operating System: All
> Platform: All
>            Reporter: Richard Topolewski
>            Assignee: Khaled Noaman
>            Priority: Minor
>
> Get Error:
>  Value 'BBB - A' does not match regular expression facet 'AAA|BBB|BBB - A'..
> If change orderof Regular Expression to:
>         <xs:pattern value='AAA|BBB - A|BBB' />
> Then it works.
> XML trying to Validate:
>         <test        >BBB - A</test       >
> The following Schema throws an exception:
> Schema:
>   <xs:simpleType name='TestRich' >
>       <xs:restriction base='xs:string'>
>         <xs:pattern value='AAA|BBB|BBB - A' />
>       </xs:restriction >
>   </xs:simpleType>
> The following schema works:
> Schema:
>   <xs:simpleType name='TestRich' >
>       <xs:restriction base='xs:string'>
>         <xs:pattern value='AAA|BBB - A|BBB' />
>       </xs:restriction >
>   </xs:simpleType>
> --------------------------------------------------------------------
> Complete Schema:
> <?xml version="1.0" encoding="UTF-8" ?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";>
>   <xs:element name='xerces-pattern-bug'          type='XercesPatternBug' />
>   <xs:complexType name='XercesPatternBug' >
>         <xs:sequence>
>           <xs:element name='test'       type='TestRich'                       
> />
>         </xs:sequence>
>   </xs:complexType>
>   <xs:simpleType name='TestRich' >
>       <xs:restriction base='xs:string'>
>         <xs:pattern value='AAA|BBB|BBB - A' />
>       </xs:restriction >
>   </xs:simpleType>
> </xs:schema>
> Complete XML:
> <?xml version="1.0" encoding="UTF-8" ?>
> <xerces-pattern-bug xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
> xsi:noNamespaceSchemaLocation='http://localhost:8080/gpsis/easymap/XercesPattern
> Bug.xsd'>          
>         <test        >BBB - A</test       >
> </xerces-pattern-bug>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to