xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amass...@apache.org
Subject svn commit: r804226 - in /xerces/c/trunk: src/xercesc/internal/ tests/src/XSTSHarness/regression/ tests/src/XSTSHarness/regression/XERCESC-1707/
Date Fri, 14 Aug 2009 13:44:26 GMT
Author: amassari
Date: Fri Aug 14 13:44:26 2009
New Revision: 804226

URL: http://svn.apache.org/viewvc?rev=804226&view=rev
Log:
Ignore the lax directive if an element has an xsi:type directive (XERCESC-1707)

Added:
    xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1707/
    xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1707/test.xml
    xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1707/test.xsd
Modified:
    xerces/c/trunk/src/xercesc/internal/IGXMLScanner.cpp
    xerces/c/trunk/src/xercesc/internal/SGXMLScanner.cpp
    xerces/c/trunk/src/xercesc/internal/XSAXMLScanner.cpp
    xerces/c/trunk/tests/src/XSTSHarness/regression/Xerces.testSet

Modified: xerces/c/trunk/src/xercesc/internal/IGXMLScanner.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/internal/IGXMLScanner.cpp?rev=804226&r1=804225&r2=804226&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/internal/IGXMLScanner.cpp (original)
+++ xerces/c/trunk/src/xercesc/internal/IGXMLScanner.cpp Fri Aug 14 13:44:26 2009
@@ -2406,7 +2406,7 @@
     bool bXsiTypeSet= (fValidator && fGrammarType == Grammar::SchemaGrammarType)?((SchemaValidator*)fValidator)->getIsXsiTypeSet():false;
     if (wasAdded)
     {
-        if (laxThisOne) {
+        if (laxThisOne && !bXsiTypeSet) {
             fValidate = false;
             fElemStack.setValidationFlag(fValidate);
         }

Modified: xerces/c/trunk/src/xercesc/internal/SGXMLScanner.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/internal/SGXMLScanner.cpp?rev=804226&r1=804225&r2=804226&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/internal/SGXMLScanner.cpp (original)
+++ xerces/c/trunk/src/xercesc/internal/SGXMLScanner.cpp Fri Aug 14 13:44:26 2009
@@ -1427,7 +1427,7 @@
     bool bXsiTypeSet= (fValidator)?((SchemaValidator*)fValidator)->getIsXsiTypeSet():false;
     if (wasAdded)
     {
-        if (laxThisOne) {
+        if (laxThisOne && !bXsiTypeSet) {
             fValidate = false;
             fElemStack.setValidationFlag(fValidate);
         }

Modified: xerces/c/trunk/src/xercesc/internal/XSAXMLScanner.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/internal/XSAXMLScanner.cpp?rev=804226&r1=804225&r2=804226&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/internal/XSAXMLScanner.cpp (original)
+++ xerces/c/trunk/src/xercesc/internal/XSAXMLScanner.cpp Fri Aug 14 13:44:26 2009
@@ -346,7 +346,7 @@
     bool bXsiTypeSet= (fValidator)?((SchemaValidator*)fValidator)->getIsXsiTypeSet():false;
     if (wasAdded || !elemDecl->isDeclared())
     {
-        if (laxThisOne) {
+        if (laxThisOne && !bXsiTypeSet) {
             fValidate = false;
             fElemStack.setValidationFlag(fValidate);
         }

Added: xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1707/test.xml
URL: http://svn.apache.org/viewvc/xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1707/test.xml?rev=804226&view=auto
==============================================================================
--- xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1707/test.xml (added)
+++ xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1707/test.xml Fri Aug 14 13:44:26
2009
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<purchaseOrder xmlns="http://www.openuri.org/mySchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.openuri.org/mySchema test.xsd">
+	<shipTo>
+		<name>ship-to-name</name>
+		<element_of_any_type>
+			<unknown_element xsi:type="USState">AK</unknown_element>
+		</element_of_any_type>
+	</shipTo>
+	<billTo>
+		<name>bill-to-name</name>
+		<element_of_any_type/>
+	</billTo>
+</purchaseOrder>
\ No newline at end of file

Added: xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1707/test.xsd
URL: http://svn.apache.org/viewvc/xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1707/test.xsd?rev=804226&view=auto
==============================================================================
--- xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1707/test.xsd (added)
+++ xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1707/test.xsd Fri Aug 14 13:44:26
2009
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<xsd:schema xmlns="http://www.openuri.org/mySchema" elementFormDefault="qualified" targetNamespace="http://www.openuri.org/mySchema"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+	<xsd:element name="purchaseOrder" type="PurchaseOrderType"/>
+	<xsd:complexType name="PurchaseOrderType">
+		<xsd:sequence>
+			<xsd:element name="shipTo" type="USAddress"/>
+			<xsd:element name="billTo" type="USAddress"/>
+		</xsd:sequence>
+	</xsd:complexType>
+	<xsd:complexType name="USAddress">
+		<xsd:sequence>
+			<xsd:element name="name" type="xsd:string"/>
+			<xsd:element name="element_of_any_type"/>
+		</xsd:sequence>
+		<!-- declaration of this attribute is necessary to reproduce -->
+		<xsd:attribute fixed="US" name="country" type="xsd:NMTOKEN"/>
+	</xsd:complexType>
+	<xsd:simpleType name="USState">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="AK"/>
+			<xsd:enumeration value="AL"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+</xsd:schema>
\ No newline at end of file

Modified: xerces/c/trunk/tests/src/XSTSHarness/regression/Xerces.testSet
URL: http://svn.apache.org/viewvc/xerces/c/trunk/tests/src/XSTSHarness/regression/Xerces.testSet?rev=804226&r1=804225&r2=804226&view=diff
==============================================================================
--- xerces/c/trunk/tests/src/XSTSHarness/regression/Xerces.testSet (original)
+++ xerces/c/trunk/tests/src/XSTSHarness/regression/Xerces.testSet Fri Aug 14 13:44:26 2009
@@ -433,6 +433,22 @@
 			<current status="accepted" date="2008-02-13"/>
 		</instanceTest>
 	</testGroup>
+	<testGroup name="XERCESC-1707">
+		<annotation>
+			<documentation>Processing of not-declared-element with "xsi:type" under anyType
element does not clear SchemaValidator::fXsiType</documentation>
+		</annotation>
+		<documentationReference xlink:href="https://issues.apache.org/jira/browse/XERCESC-1707"/>
+		<schemaTest name="XERCESC-1707">
+			<schemaDocument xlink:href="./XERCESC-1707/test.xsd"/>
+			<expected validity="valid"/>
+			<current status="accepted" date="2009-08-14"/>
+		</schemaTest>
+		<instanceTest name="XERCESC-1707-1">
+			<instanceDocument xlink:href="./XERCESC-1707/test.xml"/>
+			<expected validity="valid"/>
+			<current status="accepted" date="2009-08-14"/>
+		</instanceTest>
+	</testGroup>
 	<testGroup name="XERCESC-1714">
 		<annotation>
 			<documentation>xerces-c reports "Base type definition does not have any attributes"
for a valid complex type restriction</documentation>



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


Mime
View raw message