xerces-j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Glavassevich (JIRA)" <xerces-j-...@xml.apache.org>
Subject [jira] Assigned: (XERCESJ-1285) Restriction of choice/sequence with non-unity cardinality and any ##any fail with rcase-Recurse[Lax].2
Date Tue, 11 Dec 2007 03:24:43 GMT

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

Michael Glavassevich reassigned XERCESJ-1285:
---------------------------------------------

    Assignee: Sandy Gao

> Restriction of choice/sequence with non-unity cardinality and any ##any fail with rcase-Recurse[Lax].2
> ------------------------------------------------------------------------------------------------------
>
>                 Key: XERCESJ-1285
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1285
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema Structures
>    Affects Versions: 2.9.1
>         Environment: WindowsXP, Java 1.5.0-b64
>            Reporter: Martin Thomson
>            Assignee: Sandy Gao
>            Priority: Minor
>         Attachments: test1.xsd
>
>
> If a base type includes an any declaration, within a sequence or choice that has non-unity
cardinality, restrictions that specify more than one particle in place of the any declaration
fail, even though their cardinality should be allowed as a sequence derivation based on NSRecurseCheckCardinality.
> This does not occur when the cardinality of the base sequence or choice is 1 (i.e. minOccurs
and maxOccurs both equal 1).
> Using Sandy's notation for single-element choices or sequences:
> base_c = (##any*|)*
> base_s = (##any*,)*
> Restrictions of these types that include multiple particles in place of the any fail.
> restriction_c = (X|Y)*
> restriction_s = (X,Y)*
> You can dupe Xerces into passing the restriction by adding two layers of extra groupings:
> restriction_c = (((X|Y|),)|)*  -- passes
> restriction_s = (((X,Y,)|),)* -- passes
> But a simple grouping gets removed since it is a useless particle:
> restriction_c = ((X|Y|)|)*  -- fails
> restriction_s = ((X,Y,),)* -- fails
> This probably has something to do with the way that Xerces removes redundant particles.
> Here's a schema that fails on all restrictions except the dupe ones (those with _p in
the restriction type name).  You can remove all instances of element Q to simplify the content
-- it's there to show that this occurs only when part of the group is replaced.  (My apologies
for the size of this, there are a few cases to demonstrate).  
> I get 18 total errors from this schema, but each restriction error results in two error
messages from Xerces: rcase-Recurse.2 or rcase-RecurseLax.2 and derivation-ok-restriction.5.4.2.
> ~~
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>            targetNamespace="urn:restrict2" xmlns="urn:restrict2">
>   <xs:complexType name="base_s">
>     <xs:complexContent>
>       <xs:restriction base="xs:anyType">
>         <xs:sequence minOccurs="0">
>           <xs:element name="Q"/>
>           <xs:any namespace="##any"
>                   minOccurs="0" maxOccurs="unbounded"/>
>         </xs:sequence>
>       </xs:restriction>
>     </xs:complexContent>
>   </xs:complexType>
>   <xs:complexType name="restriction_s">
>     <xs:complexContent>
>       <xs:restriction base="base_s">
>         <xs:sequence minOccurs="0">
>           <xs:element name="Q"/>
>           <xs:element name="X"/>
>           <xs:element name="Y"/>
>         </xs:sequence>
>       </xs:restriction>
>     </xs:complexContent>
>   </xs:complexType>
>   <xs:complexType name="restriction_s2">
>     <xs:complexContent>
>       <xs:restriction base="base_s">
>         <xs:sequence minOccurs="0">
>           <xs:element name="Q"/>
>           <xs:sequence>
>             <xs:element name="X"/>
>             <xs:element name="Y"/>
>           </xs:sequence>
>         </xs:sequence>
>       </xs:restriction>
>     </xs:complexContent>
>   </xs:complexType>
>   <xs:complexType name="restriction_s_1">
>     <xs:complexContent>
>       <xs:restriction base="base_s">
>         <xs:sequence>
>           <xs:element name="Q"/>
>           <xs:element name="X"/>
>           <xs:element name="Y"/>
>         </xs:sequence>
>       </xs:restriction>
>     </xs:complexContent>
>   </xs:complexType>
>   <xs:complexType name="restriction_s_p">
>     <xs:complexContent>
>       <xs:restriction base="base_s">
>         <xs:sequence minOccurs="0">
>           <xs:element name="Q"/>
>           <xs:choice>
>             <xs:sequence>
>               <xs:element name="X"/>
>               <xs:element name="Y"/>
>             </xs:sequence>
>           </xs:choice>
>         </xs:sequence>
>       </xs:restriction>
>     </xs:complexContent>
>   </xs:complexType>
>   <xs:complexType name="base_c">
>     <xs:complexContent>
>       <xs:restriction base="xs:anyType">
>         <xs:choice minOccurs="0">
>           <xs:element name="Q"/>
>           <xs:any namespace="##any"
>                   minOccurs="0" maxOccurs="unbounded"/>
>         </xs:choice>
>       </xs:restriction>
>     </xs:complexContent>
>   </xs:complexType>
>   <xs:complexType name="restriction_c">
>     <xs:complexContent>
>       <xs:restriction base="base_c">
>         <xs:choice minOccurs="0">
>           <xs:element name="Q"/>
>           <xs:element name="X"/>
>           <xs:element name="Y"/>
>         </xs:choice>
>       </xs:restriction>
>     </xs:complexContent>
>   </xs:complexType>
>   <xs:complexType name="restriction_c2">
>     <xs:complexContent>
>       <xs:restriction base="base_c">
>         <xs:choice minOccurs="0">
>           <xs:element name="Q"/>
>           <xs:choice>
>             <xs:element name="X"/>
>             <xs:element name="Y"/>
>           </xs:choice>
>         </xs:choice>
>       </xs:restriction>
>     </xs:complexContent>
>   </xs:complexType>
>   <xs:complexType name="restriction_c_1">
>     <xs:complexContent>
>       <xs:restriction base="base_c">
>         <xs:choice>
>           <xs:element name="Q"/>
>           <xs:element name="X"/>
>           <xs:element name="Y"/>
>         </xs:choice>
>       </xs:restriction>
>     </xs:complexContent>
>   </xs:complexType>
>   <xs:complexType name="restriction_c_p">
>     <xs:complexContent>
>       <xs:restriction base="base_c">
>         <xs:choice minOccurs="0">
>           <xs:element name="Q"/>
>           <xs:sequence>
>             <xs:choice>
>               <xs:element name="X"/>
>               <xs:element name="Y"/>
>             </xs:choice>
>           </xs:sequence>
>         </xs:choice>
>       </xs:restriction>
>     </xs:complexContent>
>   </xs:complexType>
>   <xs:complexType name="base_su">
>     <xs:complexContent>
>       <xs:restriction base="xs:anyType">
>         <xs:sequence maxOccurs="unbounded">
>           <xs:element name="Q"/>
>           <xs:any namespace="##any"
>                   minOccurs="0" maxOccurs="unbounded"/>
>         </xs:sequence>
>       </xs:restriction>
>     </xs:complexContent>
>   </xs:complexType>
>   <xs:complexType name="restriction_su">
>     <xs:complexContent>
>       <xs:restriction base="base_su">
>         <xs:sequence maxOccurs="unbounded">
>           <xs:element name="Q"/>
>           <xs:element name="X"/>
>           <xs:element name="Y"/>
>         </xs:sequence>
>       </xs:restriction>
>     </xs:complexContent>
>   </xs:complexType>
>   <xs:complexType name="restriction_su_1">
>     <xs:complexContent>
>       <xs:restriction base="base_su">
>         <xs:sequence>
>           <xs:element name="Q"/>
>           <xs:element name="X"/>
>           <xs:element name="Y"/>
>         </xs:sequence>
>       </xs:restriction>
>     </xs:complexContent>
>   </xs:complexType>
>   <xs:complexType name="restriction_su_p">
>     <xs:complexContent>
>       <xs:restriction base="base_su">
>         <xs:sequence>
>           <xs:element name="Q"/>
>           <xs:choice>
>             <xs:sequence>
>               <xs:element name="X"/>
>               <xs:element name="Y"/>
>             </xs:sequence>
>           </xs:choice>
>         </xs:sequence>
>       </xs:restriction>
>     </xs:complexContent>
>   </xs:complexType>
> </xs:schema>

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


Mime
View raw message