You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Andrew Fang (JIRA)" <xe...@xml.apache.org> on 2006/05/04 16:05:21 UTC

[jira] Created: (XERCESC-1591) Mishandling of recursive definition on complex content restriction

Mishandling of recursive definition on complex content restriction
------------------------------------------------------------------

         Key: XERCESC-1591
         URL: http://issues.apache.org/jira/browse/XERCESC-1591
     Project: Xerces-C++
        Type: Bug

  Components: Validating Parser (Schema) (Xerces 1.5 or up only)  
    Versions: 2.6.0    
 Environment: Windows XP
    Reporter: Andrew Fang


When trying to the following schema in Xerces 2.6, it complains that the base type of CV does not have any attribute defined (Line: 34 Column: 31
Base type definition does not have any attributes). Apparently, we see attribute defined in CE (the base type of CV).

The problem seems to be caused by element "qualifier" in complexType "CD". The element "qualifier" has type of CR which contains an element of type CV which is a derivative of CE, which in turns is the derivative of CD. Xerces trys to resolve CE before attributes in CD is processed and thus the error.

Although the syntax looks wierd, it  is from a govenment stanadard and we have no position of changing that.

A workaround is to move definition of CR ahead of CD. However, since the position of element definition in Schema should have no effect on validation, we think Xerces should report no error as it is.


<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="urn:hl7-org:v3"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="urn:hl7-org:v3" 
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	elementFormDefault="qualified">

	<xsd:complexType name="ANY" abstract="true"></xsd:complexType>

	<xsd:complexType name="CD">
		<xsd:complexContent>
			<xsd:extension base="ANY">
				<xsd:sequence>
					<xsd:element name="qualifier" type="CR"
						minOccurs="0" maxOccurs="unbounded"/>
				</xsd:sequence>
				<xsd:attribute name="code" use="optional"/>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<xsd:complexType name="CE">
		<xsd:complexContent>
			<xsd:restriction base="CD">
				<xsd:sequence>
				</xsd:sequence>
				<xsd:attribute name="code" use="optional"/>
			</xsd:restriction>
		</xsd:complexContent>
	</xsd:complexType>

	<xsd:complexType name="CV">
		<xsd:complexContent>
			<xsd:restriction base="CE">
				<xsd:sequence>

				</xsd:sequence>
				<xsd:attribute name="code" use="optional"/>
			</xsd:restriction>
		</xsd:complexContent>
	</xsd:complexType>

	<xsd:complexType name="CR">
		<xsd:complexContent>
			<xsd:extension base="ANY">
				<xsd:sequence>
					<xsd:element name="name" type="CV" minOccurs="0"
						maxOccurs="1"/>
				</xsd:sequence>
				<xsd:attribute name="inverted" use="optional"
					default="false"/>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<xsd:element name="root" type="CV" />

</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


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Updated: (XERCESC-1591) Mishandling of recursive definition on complex content restriction

Posted by "Anton Nikolaevsky (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESC-1591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anton Nikolaevsky updated XERCESC-1591:
---------------------------------------

    Affects Version/s: 2.7.0

> Mishandling of recursive definition on complex content restriction
> ------------------------------------------------------------------
>
>                 Key: XERCESC-1591
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1591
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Validating Parser (Schema) (Xerces 1.5 or up only)
>    Affects Versions: 2.6.0, 2.7.0
>         Environment: Windows XP
>            Reporter: Andrew Fang
>         Attachments: TraverseSchema.cpp.diff
>
>
> When trying to the following schema in Xerces 2.6, it complains that the base type of CV does not have any attribute defined (Line: 34 Column: 31
> Base type definition does not have any attributes). Apparently, we see attribute defined in CE (the base type of CV).
> The problem seems to be caused by element "qualifier" in complexType "CD". The element "qualifier" has type of CR which contains an element of type CV which is a derivative of CE, which in turns is the derivative of CD. Xerces trys to resolve CE before attributes in CD is processed and thus the error.
> Although the syntax looks wierd, it  is from a govenment stanadard and we have no position of changing that.
> A workaround is to move definition of CR ahead of CD. However, since the position of element definition in Schema should have no effect on validation, we think Xerces should report no error as it is.
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema targetNamespace="urn:hl7-org:v3"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xmlns="urn:hl7-org:v3" 
> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> 	elementFormDefault="qualified">
> 	<xsd:complexType name="ANY" abstract="true"></xsd:complexType>
> 	<xsd:complexType name="CD">
> 		<xsd:complexContent>
> 			<xsd:extension base="ANY">
> 				<xsd:sequence>
> 					<xsd:element name="qualifier" type="CR"
> 						minOccurs="0" maxOccurs="unbounded"/>
> 				</xsd:sequence>
> 				<xsd:attribute name="code" use="optional"/>
> 			</xsd:extension>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:complexType name="CE">
> 		<xsd:complexContent>
> 			<xsd:restriction base="CD">
> 				<xsd:sequence>
> 				</xsd:sequence>
> 				<xsd:attribute name="code" use="optional"/>
> 			</xsd:restriction>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:complexType name="CV">
> 		<xsd:complexContent>
> 			<xsd:restriction base="CE">
> 				<xsd:sequence>
> 				</xsd:sequence>
> 				<xsd:attribute name="code" use="optional"/>
> 			</xsd:restriction>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:complexType name="CR">
> 		<xsd:complexContent>
> 			<xsd:extension base="ANY">
> 				<xsd:sequence>
> 					<xsd:element name="name" type="CV" minOccurs="0"
> 						maxOccurs="1"/>
> 				</xsd:sequence>
> 				<xsd:attribute name="inverted" use="optional"
> 					default="false"/>
> 			</xsd:extension>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:element name="root" type="CV" />
> </xsd: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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Commented: (XERCESC-1591) Mishandling of recursive definition on complex content restriction

Posted by "Anton Nikolaevsky (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESC-1591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12499787 ] 

Anton Nikolaevsky commented on XERCESC-1591:
--------------------------------------------

I've observed the same problem on 2.6.0 and 2.7.0 with a similar HL7 sample xsd. 
It seems TraverseSchema::processAttributes does not expect preprocessed (but not actually loaded) complex type definitions as a base type. So attributes of preprocessed base type have not been loaded yet and derived type contains attribute definition. This leads to 'Base type definition does not have any attributes' error.

Proposed fix is attached.

> Mishandling of recursive definition on complex content restriction
> ------------------------------------------------------------------
>
>                 Key: XERCESC-1591
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1591
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Validating Parser (Schema) (Xerces 1.5 or up only)
>    Affects Versions: 2.6.0
>         Environment: Windows XP
>            Reporter: Andrew Fang
>
> When trying to the following schema in Xerces 2.6, it complains that the base type of CV does not have any attribute defined (Line: 34 Column: 31
> Base type definition does not have any attributes). Apparently, we see attribute defined in CE (the base type of CV).
> The problem seems to be caused by element "qualifier" in complexType "CD". The element "qualifier" has type of CR which contains an element of type CV which is a derivative of CE, which in turns is the derivative of CD. Xerces trys to resolve CE before attributes in CD is processed and thus the error.
> Although the syntax looks wierd, it  is from a govenment stanadard and we have no position of changing that.
> A workaround is to move definition of CR ahead of CD. However, since the position of element definition in Schema should have no effect on validation, we think Xerces should report no error as it is.
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema targetNamespace="urn:hl7-org:v3"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xmlns="urn:hl7-org:v3" 
> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> 	elementFormDefault="qualified">
> 	<xsd:complexType name="ANY" abstract="true"></xsd:complexType>
> 	<xsd:complexType name="CD">
> 		<xsd:complexContent>
> 			<xsd:extension base="ANY">
> 				<xsd:sequence>
> 					<xsd:element name="qualifier" type="CR"
> 						minOccurs="0" maxOccurs="unbounded"/>
> 				</xsd:sequence>
> 				<xsd:attribute name="code" use="optional"/>
> 			</xsd:extension>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:complexType name="CE">
> 		<xsd:complexContent>
> 			<xsd:restriction base="CD">
> 				<xsd:sequence>
> 				</xsd:sequence>
> 				<xsd:attribute name="code" use="optional"/>
> 			</xsd:restriction>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:complexType name="CV">
> 		<xsd:complexContent>
> 			<xsd:restriction base="CE">
> 				<xsd:sequence>
> 				</xsd:sequence>
> 				<xsd:attribute name="code" use="optional"/>
> 			</xsd:restriction>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:complexType name="CR">
> 		<xsd:complexContent>
> 			<xsd:extension base="ANY">
> 				<xsd:sequence>
> 					<xsd:element name="name" type="CV" minOccurs="0"
> 						maxOccurs="1"/>
> 				</xsd:sequence>
> 				<xsd:attribute name="inverted" use="optional"
> 					default="false"/>
> 			</xsd:extension>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:element name="root" type="CV" />
> </xsd: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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Resolved: (XERCESC-1591) Mishandling of recursive definition on complex content restriction

Posted by "cargilld (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESC-1591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

cargilld resolved XERCESC-1591.
-------------------------------

    Resolution: Fixed

Patch applied to 2.7 and trunk.

> Mishandling of recursive definition on complex content restriction
> ------------------------------------------------------------------
>
>                 Key: XERCESC-1591
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1591
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Validating Parser (Schema) (Xerces 1.5 or up only)
>    Affects Versions: 2.6.0, 2.7.0
>         Environment: Windows XP
>            Reporter: Andrew Fang
>            Assignee: cargilld
>         Attachments: TraverseSchema.cpp.diff
>
>
> When trying to the following schema in Xerces 2.6, it complains that the base type of CV does not have any attribute defined (Line: 34 Column: 31
> Base type definition does not have any attributes). Apparently, we see attribute defined in CE (the base type of CV).
> The problem seems to be caused by element "qualifier" in complexType "CD". The element "qualifier" has type of CR which contains an element of type CV which is a derivative of CE, which in turns is the derivative of CD. Xerces trys to resolve CE before attributes in CD is processed and thus the error.
> Although the syntax looks wierd, it  is from a govenment stanadard and we have no position of changing that.
> A workaround is to move definition of CR ahead of CD. However, since the position of element definition in Schema should have no effect on validation, we think Xerces should report no error as it is.
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema targetNamespace="urn:hl7-org:v3"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xmlns="urn:hl7-org:v3" 
> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> 	elementFormDefault="qualified">
> 	<xsd:complexType name="ANY" abstract="true"></xsd:complexType>
> 	<xsd:complexType name="CD">
> 		<xsd:complexContent>
> 			<xsd:extension base="ANY">
> 				<xsd:sequence>
> 					<xsd:element name="qualifier" type="CR"
> 						minOccurs="0" maxOccurs="unbounded"/>
> 				</xsd:sequence>
> 				<xsd:attribute name="code" use="optional"/>
> 			</xsd:extension>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:complexType name="CE">
> 		<xsd:complexContent>
> 			<xsd:restriction base="CD">
> 				<xsd:sequence>
> 				</xsd:sequence>
> 				<xsd:attribute name="code" use="optional"/>
> 			</xsd:restriction>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:complexType name="CV">
> 		<xsd:complexContent>
> 			<xsd:restriction base="CE">
> 				<xsd:sequence>
> 				</xsd:sequence>
> 				<xsd:attribute name="code" use="optional"/>
> 			</xsd:restriction>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:complexType name="CR">
> 		<xsd:complexContent>
> 			<xsd:extension base="ANY">
> 				<xsd:sequence>
> 					<xsd:element name="name" type="CV" minOccurs="0"
> 						maxOccurs="1"/>
> 				</xsd:sequence>
> 				<xsd:attribute name="inverted" use="optional"
> 					default="false"/>
> 			</xsd:extension>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:element name="root" type="CV" />
> </xsd: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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Commented: (XERCESC-1591) Mishandling of recursive definition on complex content restriction

Posted by "cargilld (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESC-1591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12514650 ] 

cargilld commented on XERCESC-1591:
-----------------------------------

Here is the due diligence information from Anton:

Anton Nikolaevsky <an...@edifecs.com> 
07/19/2007 04:00 AM	
	To
	David Cargill/Toronto/IBM@IBMCA
	cc
	
	Subject
	Re: due dilligence for xercesc-1591 patch
	
	
	
	


Hi David,

a) Anton Nikolaevsky, Edifecs, Inc.

b) Yes, I am the author.

c) Yes, I do.

d) Edifecs, Inc. owns all rights to code written by me and it has given 
me permission to contribute the code on its behalf of.

e) This patch can be contributed without any restrictions.

Thanks,
Anton Nikolaevsky
XEngine Core Development
Edifecs, Inc. - "The DNA of B2B®"
http://www.edifecs.com/

-------- Original Message  --------
Subject: due dilligence for xercesc-1591 patch
From: David Cargill <ca...@ca.ibm.com>
To: antonn@edifecs.com
Date: Wed, 4 Jul 2007 22:44:52

> Hi Anton,
> Can you please answer the following due dilligence questions so your patch
> can be contributed to xercesc.  Thanks.
>                                                                                
>                                                                                
>                                                                                
>                                                                                
>                                                                                
>                                                                                
>                                                                                
>   7.3 If the contribution in question is a small bugfix, the contributor need  
>   not sign a CLA, but need only provide the following information, attaching   
>   it to the communication containing the patch:                                
>                                                                                
>                                                                                
>   a) Name and employer                                                         
>                                                                                
>                                                                                
>   b) Are you the author of the code being contributed?                         
>                                                                                
>                                                                                
>   c) Do you have the right to grant the copyright and patent licenses for the  
>   contribution that are set forth in the ASF v.2.0 license                     
>   (http://www.apache.org/licenses/LICENSE-2.0)?                                
>                                                                                
>                                                                                
>   d) Does your employer have any rights to code that you have written, for     
>   example, through your contract for employment? If so, has your employer      
>   given you permission to contribute the code on its behalf or waived its      
>   rights in the code?                                                          
>                                                                                
>                                                                                
>   e) Are you aware of any third-party licenses or other restrictions (such as  
>   related patents or trademarks) that could apply to your contribution? If so, 
>   what are they?                                                               
>                                                                                
>                                                                                
>                                                                                
> 
> 
> Thanks.
> 
> Regards,
> David A. Cargill
> XML Parser Development
> IBM Toronto Lab
> (905) 413-2371, tie 969
> cargilld@ca.ibm.com


> Mishandling of recursive definition on complex content restriction
> ------------------------------------------------------------------
>
>                 Key: XERCESC-1591
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1591
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Validating Parser (Schema) (Xerces 1.5 or up only)
>    Affects Versions: 2.6.0, 2.7.0
>         Environment: Windows XP
>            Reporter: Andrew Fang
>            Assignee: cargilld
>         Attachments: TraverseSchema.cpp.diff
>
>
> When trying to the following schema in Xerces 2.6, it complains that the base type of CV does not have any attribute defined (Line: 34 Column: 31
> Base type definition does not have any attributes). Apparently, we see attribute defined in CE (the base type of CV).
> The problem seems to be caused by element "qualifier" in complexType "CD". The element "qualifier" has type of CR which contains an element of type CV which is a derivative of CE, which in turns is the derivative of CD. Xerces trys to resolve CE before attributes in CD is processed and thus the error.
> Although the syntax looks wierd, it  is from a govenment stanadard and we have no position of changing that.
> A workaround is to move definition of CR ahead of CD. However, since the position of element definition in Schema should have no effect on validation, we think Xerces should report no error as it is.
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema targetNamespace="urn:hl7-org:v3"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xmlns="urn:hl7-org:v3" 
> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> 	elementFormDefault="qualified">
> 	<xsd:complexType name="ANY" abstract="true"></xsd:complexType>
> 	<xsd:complexType name="CD">
> 		<xsd:complexContent>
> 			<xsd:extension base="ANY">
> 				<xsd:sequence>
> 					<xsd:element name="qualifier" type="CR"
> 						minOccurs="0" maxOccurs="unbounded"/>
> 				</xsd:sequence>
> 				<xsd:attribute name="code" use="optional"/>
> 			</xsd:extension>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:complexType name="CE">
> 		<xsd:complexContent>
> 			<xsd:restriction base="CD">
> 				<xsd:sequence>
> 				</xsd:sequence>
> 				<xsd:attribute name="code" use="optional"/>
> 			</xsd:restriction>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:complexType name="CV">
> 		<xsd:complexContent>
> 			<xsd:restriction base="CE">
> 				<xsd:sequence>
> 				</xsd:sequence>
> 				<xsd:attribute name="code" use="optional"/>
> 			</xsd:restriction>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:complexType name="CR">
> 		<xsd:complexContent>
> 			<xsd:extension base="ANY">
> 				<xsd:sequence>
> 					<xsd:element name="name" type="CV" minOccurs="0"
> 						maxOccurs="1"/>
> 				</xsd:sequence>
> 				<xsd:attribute name="inverted" use="optional"
> 					default="false"/>
> 			</xsd:extension>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:element name="root" type="CV" />
> </xsd: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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Assigned: (XERCESC-1591) Mishandling of recursive definition on complex content restriction

Posted by "cargilld (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESC-1591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

cargilld reassigned XERCESC-1591:
---------------------------------

    Assignee: cargilld

> Mishandling of recursive definition on complex content restriction
> ------------------------------------------------------------------
>
>                 Key: XERCESC-1591
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1591
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Validating Parser (Schema) (Xerces 1.5 or up only)
>    Affects Versions: 2.6.0, 2.7.0
>         Environment: Windows XP
>            Reporter: Andrew Fang
>            Assignee: cargilld
>         Attachments: TraverseSchema.cpp.diff
>
>
> When trying to the following schema in Xerces 2.6, it complains that the base type of CV does not have any attribute defined (Line: 34 Column: 31
> Base type definition does not have any attributes). Apparently, we see attribute defined in CE (the base type of CV).
> The problem seems to be caused by element "qualifier" in complexType "CD". The element "qualifier" has type of CR which contains an element of type CV which is a derivative of CE, which in turns is the derivative of CD. Xerces trys to resolve CE before attributes in CD is processed and thus the error.
> Although the syntax looks wierd, it  is from a govenment stanadard and we have no position of changing that.
> A workaround is to move definition of CR ahead of CD. However, since the position of element definition in Schema should have no effect on validation, we think Xerces should report no error as it is.
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema targetNamespace="urn:hl7-org:v3"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xmlns="urn:hl7-org:v3" 
> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> 	elementFormDefault="qualified">
> 	<xsd:complexType name="ANY" abstract="true"></xsd:complexType>
> 	<xsd:complexType name="CD">
> 		<xsd:complexContent>
> 			<xsd:extension base="ANY">
> 				<xsd:sequence>
> 					<xsd:element name="qualifier" type="CR"
> 						minOccurs="0" maxOccurs="unbounded"/>
> 				</xsd:sequence>
> 				<xsd:attribute name="code" use="optional"/>
> 			</xsd:extension>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:complexType name="CE">
> 		<xsd:complexContent>
> 			<xsd:restriction base="CD">
> 				<xsd:sequence>
> 				</xsd:sequence>
> 				<xsd:attribute name="code" use="optional"/>
> 			</xsd:restriction>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:complexType name="CV">
> 		<xsd:complexContent>
> 			<xsd:restriction base="CE">
> 				<xsd:sequence>
> 				</xsd:sequence>
> 				<xsd:attribute name="code" use="optional"/>
> 			</xsd:restriction>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:complexType name="CR">
> 		<xsd:complexContent>
> 			<xsd:extension base="ANY">
> 				<xsd:sequence>
> 					<xsd:element name="name" type="CV" minOccurs="0"
> 						maxOccurs="1"/>
> 				</xsd:sequence>
> 				<xsd:attribute name="inverted" use="optional"
> 					default="false"/>
> 			</xsd:extension>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:element name="root" type="CV" />
> </xsd: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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Updated: (XERCESC-1591) Mishandling of recursive definition on complex content restriction

Posted by "Anton Nikolaevsky (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESC-1591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anton Nikolaevsky updated XERCESC-1591:
---------------------------------------

    Attachment: TraverseSchema.cpp.diff

Patch to xerces/c/branches/xerces-2.7/src/xercesc/validators/schema/TraverseSchema.cpp, revision 540668 

> Mishandling of recursive definition on complex content restriction
> ------------------------------------------------------------------
>
>                 Key: XERCESC-1591
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1591
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Validating Parser (Schema) (Xerces 1.5 or up only)
>    Affects Versions: 2.6.0
>         Environment: Windows XP
>            Reporter: Andrew Fang
>         Attachments: TraverseSchema.cpp.diff
>
>
> When trying to the following schema in Xerces 2.6, it complains that the base type of CV does not have any attribute defined (Line: 34 Column: 31
> Base type definition does not have any attributes). Apparently, we see attribute defined in CE (the base type of CV).
> The problem seems to be caused by element "qualifier" in complexType "CD". The element "qualifier" has type of CR which contains an element of type CV which is a derivative of CE, which in turns is the derivative of CD. Xerces trys to resolve CE before attributes in CD is processed and thus the error.
> Although the syntax looks wierd, it  is from a govenment stanadard and we have no position of changing that.
> A workaround is to move definition of CR ahead of CD. However, since the position of element definition in Schema should have no effect on validation, we think Xerces should report no error as it is.
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema targetNamespace="urn:hl7-org:v3"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xmlns="urn:hl7-org:v3" 
> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> 	elementFormDefault="qualified">
> 	<xsd:complexType name="ANY" abstract="true"></xsd:complexType>
> 	<xsd:complexType name="CD">
> 		<xsd:complexContent>
> 			<xsd:extension base="ANY">
> 				<xsd:sequence>
> 					<xsd:element name="qualifier" type="CR"
> 						minOccurs="0" maxOccurs="unbounded"/>
> 				</xsd:sequence>
> 				<xsd:attribute name="code" use="optional"/>
> 			</xsd:extension>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:complexType name="CE">
> 		<xsd:complexContent>
> 			<xsd:restriction base="CD">
> 				<xsd:sequence>
> 				</xsd:sequence>
> 				<xsd:attribute name="code" use="optional"/>
> 			</xsd:restriction>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:complexType name="CV">
> 		<xsd:complexContent>
> 			<xsd:restriction base="CE">
> 				<xsd:sequence>
> 				</xsd:sequence>
> 				<xsd:attribute name="code" use="optional"/>
> 			</xsd:restriction>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:complexType name="CR">
> 		<xsd:complexContent>
> 			<xsd:extension base="ANY">
> 				<xsd:sequence>
> 					<xsd:element name="name" type="CV" minOccurs="0"
> 						maxOccurs="1"/>
> 				</xsd:sequence>
> 				<xsd:attribute name="inverted" use="optional"
> 					default="false"/>
> 			</xsd:extension>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:element name="root" type="CV" />
> </xsd: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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Commented: (XERCESC-1591) Mishandling of recursive definition on complex content restriction

Posted by "cargilld (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESC-1591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510365 ] 

cargilld commented on XERCESC-1591:
-----------------------------------

I sent Anton email requesting he fill out the due dilligence questions from the charter so that his patch can be applied.

> Mishandling of recursive definition on complex content restriction
> ------------------------------------------------------------------
>
>                 Key: XERCESC-1591
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1591
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Validating Parser (Schema) (Xerces 1.5 or up only)
>    Affects Versions: 2.6.0, 2.7.0
>         Environment: Windows XP
>            Reporter: Andrew Fang
>            Assignee: cargilld
>         Attachments: TraverseSchema.cpp.diff
>
>
> When trying to the following schema in Xerces 2.6, it complains that the base type of CV does not have any attribute defined (Line: 34 Column: 31
> Base type definition does not have any attributes). Apparently, we see attribute defined in CE (the base type of CV).
> The problem seems to be caused by element "qualifier" in complexType "CD". The element "qualifier" has type of CR which contains an element of type CV which is a derivative of CE, which in turns is the derivative of CD. Xerces trys to resolve CE before attributes in CD is processed and thus the error.
> Although the syntax looks wierd, it  is from a govenment stanadard and we have no position of changing that.
> A workaround is to move definition of CR ahead of CD. However, since the position of element definition in Schema should have no effect on validation, we think Xerces should report no error as it is.
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema targetNamespace="urn:hl7-org:v3"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xmlns="urn:hl7-org:v3" 
> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> 	elementFormDefault="qualified">
> 	<xsd:complexType name="ANY" abstract="true"></xsd:complexType>
> 	<xsd:complexType name="CD">
> 		<xsd:complexContent>
> 			<xsd:extension base="ANY">
> 				<xsd:sequence>
> 					<xsd:element name="qualifier" type="CR"
> 						minOccurs="0" maxOccurs="unbounded"/>
> 				</xsd:sequence>
> 				<xsd:attribute name="code" use="optional"/>
> 			</xsd:extension>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:complexType name="CE">
> 		<xsd:complexContent>
> 			<xsd:restriction base="CD">
> 				<xsd:sequence>
> 				</xsd:sequence>
> 				<xsd:attribute name="code" use="optional"/>
> 			</xsd:restriction>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:complexType name="CV">
> 		<xsd:complexContent>
> 			<xsd:restriction base="CE">
> 				<xsd:sequence>
> 				</xsd:sequence>
> 				<xsd:attribute name="code" use="optional"/>
> 			</xsd:restriction>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:complexType name="CR">
> 		<xsd:complexContent>
> 			<xsd:extension base="ANY">
> 				<xsd:sequence>
> 					<xsd:element name="name" type="CV" minOccurs="0"
> 						maxOccurs="1"/>
> 				</xsd:sequence>
> 				<xsd:attribute name="inverted" use="optional"
> 					default="false"/>
> 			</xsd:extension>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 	<xsd:element name="root" type="CV" />
> </xsd: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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org