diff --git a/src/xercesc/validators/schema/TraverseSchema.cpp b/src/xercesc/validators/schema/TraverseSchema.cpp index 1cefe1093121038921fdfb8d12d5d2eee2170cd8..d1f4e4e56fc7c6eb1a2cf406ecc2b905fed38d46 100644 --- a/src/xercesc/validators/schema/TraverseSchema.cpp +++ b/src/xercesc/validators/schema/TraverseSchema.cpp @@ -3657,6 +3657,7 @@ void TraverseSchema::traverseSimpleContentDecl(const XMLCh* const typeName, throw TraverseSchema::InvalidComplexTypeInfo; } + NamespaceScopeManager nsMgr2(simpleContent, fSchemaInfo, this); // ----------------------------------------------------------------------- // The content should be either "restriction" or "extension" // ----------------------------------------------------------------------- @@ -4079,6 +4080,7 @@ void TraverseSchema::traverseComplexContentDecl(const XMLCh* const typeName, throw TraverseSchema::InvalidComplexTypeInfo; } + NamespaceScopeManager nsMgr2(complexContent, fSchemaInfo, this); // ----------------------------------------------------------------------- // The content should be either "restriction" or "extension" // ----------------------------------------------------------------------- diff --git a/tests/src/XSTSHarness/regression/XERCESC-1832/schema11.xsd b/tests/src/XSTSHarness/regression/XERCESC-1832/schema11.xsd new file mode 100644 index 0000000000000000000000000000000000000000..6a4bf38efca2f5fda090fabe18e84b00f0807454 --- /dev/null +++ b/tests/src/XSTSHarness/regression/XERCESC-1832/schema11.xsd @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="utf-8"?> +<xs:schema xmlns:tns="x" elementFormDefault="qualified" targetNamespace="x" xmlns:xs="http://www.w3.org/2001/XMLSchema"> + + <xs:complexType name="derivedC"> + <xs:complexContent mixed="false" xmlns:q2="http://www.w3.org/2001/XMLSchema"> + <xs:extension xmlns:q1="x" base="q1:baseC"> + <xs:sequence xmlns:q3="http://www.w3.org/2001/XMLSchema"> + <xs:element minOccurs="0" maxOccurs="1" name="c" type="q2:boolean"/> + <xs:element minOccurs="0" maxOccurs="1" name="d" type="q3:boolean"/> + </xs:sequence> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="baseC"> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="1" name="a" type="xs:string" /> + <xs:element minOccurs="0" maxOccurs="1" name="b" type="xs:string" /> + </xs:sequence> + </xs:complexType> + + <xs:simpleType name="baseS" xmlns:q6="http://www.w3.org/2001/XMLSchema"> + <q6:restriction xmlns:q4="http://www.w3.org/2001/XMLSchema" base="q4:string"> + <q5:length xmlns:q5="http://www.w3.org/2001/XMLSchema" value="3"/> + </q6:restriction> + </xs:simpleType> + + <xs:complexType name="derivedS"> + <q7:simpleContent xmlns:q7="http://www.w3.org/2001/XMLSchema"> + <xs:extension xmlns:q8="x" base="q8:baseS"> + <xs:attribute name="p" type="q7:string"/> + </xs:extension> + </q7:simpleContent> + </xs:complexType> +</xs:schema> \ No newline at end of file diff --git a/tests/src/XSTSHarness/regression/Xerces.testSet b/tests/src/XSTSHarness/regression/Xerces.testSet index 58440e7383184f9bc1f00a258531978975e9e0d7..bc03417096ff48b8a78ae00bd07b60abaad99d63 100644 --- a/tests/src/XSTSHarness/regression/Xerces.testSet +++ b/tests/src/XSTSHarness/regression/Xerces.testSet @@ -568,4 +568,15 @@ <current status="accepted" date="2008-07-17"/> </instanceTest> </testGroup> + <testGroup name="XERCESC-1832"> + <annotation> + <documentation>Namespace definitions attached to xs:extension/xs:restriction are not processed</documentation> + </annotation> + <documentationReference xlink:href="https://issues.apache.org/jira/browse/XERCESC-1832"/> + <schemaTest name="XERCESC-1832"> + <schemaDocument xlink:href="./XERCESC-1832/schema11.xsd"/> + <expected validity="valid"/> + <current status="accepted" date="2008-10-01"/> + </schemaTest> + </testGroup> </testSet>