logo       

[jira] Commented: (XERCESJ-1066) Restriction+choice+substitutionGroup error: msg#00022

Subject: [jira] Commented: (XERCESJ-1066) Restriction+choice+substitutionGroup error
    [ 
http://issues.apache.org/jira/browse/XERCESJ-1066?page=comments#action_12450721 
] 
            
Ignacio Hernandez-Ros commented on XERCESJ-1066:
------------------------------------------------

Hello,

I've uploaded a new patch. (patch3) I hope this will be the definitive one.

Reading Sandy Gao comments I've implemented a simple change. The 
particleValidRestriction function returns a boolean value indicating if 
expansion has occur. In that case recurseLax goes back one element because 
ordering is not important.

Clever and simpler than I would expect.

patch3.txt incorporates also Lucian Holland patch to sort the particles.

> Restriction+choice+substitutionGroup error
> ------------------------------------------
>
>                 Key: XERCESJ-1066
>                 URL: http://issues.apache.org/jira/browse/XERCESJ-1066
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema Structures
>    Affects Versions: 2.6.2
>         Environment: N/A
>            Reporter: Martin Thomson
>         Assigned To: Sandy Gao
>         Attachments: bug1066-case0.xsd, bug1066-case1.xsd, bug1066-case2.xsd, 
> bug1066-case3.xsd, patch1.txt, patch2-2.txt, patch2.txt, patch3.txt
>
>
> When using a substitution group head in a choice, the head of the 
> substitition group is not correctly treated as a choice.
> Given a choice of X and Y where X is the head of a group with the members X1, 
> X2 and X3, the following SHOULD be true:
> Base = (X|Y)*
> ...according to clause 2.1 of Schema Component Constraint: Particle Valid 
> (Restriction) <http://www.w3.org/TR/xmlschema-1/#cos-particle-restrict> this 
> should be interpreted as:
> Base = ((X|X1|X2|X3)|Y)*
> Therefore the following should be a valid restriction, but Xerces does not 
> allow it:
> Restriction = ((X1|X2)|Y)*
> I am aware that some simplification of the choices is required by clause 2.2 
> of the above section, but this should not have the effect that it is.
> The following schema document demonstrates this:
> -----------------------------------------
> <?xml version="1.0"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
>             targetNamespace="urn:restrict" xmlns="urn:restrict"
>             elementFormDefault="qualified"
>             attributeFormDefault="unqualified">
>   <xsd:complexType name="base">
>     <xsd:complexContent>
>       <xsd:restriction base="xsd:anyType">
>         <xsd:choice minOccurs="0" maxOccurs="unbounded">
>           <xsd:element ref="X"/>
>           <xsd:element ref="Y"/>
>         </xsd:choice>
>       </xsd:restriction>
>     </xsd:complexContent>
>   </xsd:complexType>
>   <xsd:element name="X"/>
>   <xsd:element name="Y"/>
>   <xsd:complexType name="restriction">
>     <xsd:complexContent>
>       <xsd:restriction base="base">
>         <xsd:choice minOccurs="0" maxOccurs="unbounded">
>           <xsd:choice>
>             <xsd:element ref="X1"/>
>             <xsd:element ref="X2"/>
>           </xsd:choice>
>           <xsd:element ref="Y"/>
>         </xsd:choice>
>       </xsd:restriction>
>     </xsd:complexContent>
>   </xsd:complexType>
>   <xsd:element name="X1" substitutionGroup="X"/>
>   <xsd:element name="X2" substitutionGroup="X"/>
> </xsd:schema>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe