From b2525e0cb0a100457e6b19ebde27b84fee969350 Mon Sep 17 00:00:00 2001 From: Atsushi Eno Date: Tue, 8 Feb 2011 18:31:49 +0900 Subject: [PATCH] For complexType simpleContent restriction, fill attributes from base type. Part of bugfix #595947. --- .../System.XML/System.Xml.Schema/XmlSchemaComplexType.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexType.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexType.cs index 9ee6609a6a0..d53928f8df6 100644 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexType.cs +++ b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexType.cs @@ -857,11 +857,12 @@ namespace System.Xml.Schema } // complexType/simpleContent/restriction if (scr != null) { - // Attributes - baseAnyAttribute = baseComplexType != null ? baseComplexType.AttributeWildcard : null; - + // attributes localAnyAttribute = scr.AnyAttribute; - if (localAnyAttribute != null && baseAnyAttribute != null) + this.attributeWildcard = localAnyAttribute; + if (baseComplexType != null) + baseAnyAttribute = baseComplexType.AttributeWildcard; + if (baseAnyAttribute != null && localAnyAttribute != null) // 1.3 attribute wildcard subset. (=> 3.10.6) localAnyAttribute.ValidateWildcardSubset (baseAnyAttribute, h, schema); // 3.4.6 :: 5.1. Beware that There is an errata for 5.1!! @@ -872,6 +873,11 @@ namespace System.Xml.Schema errorCount += XmlSchemaUtil.ValidateAttributesResolved ( this.attributeUses, h, schema, scr.Attributes, scr.AnyAttribute, ref attributeWildcard, null, false); + foreach (DictionaryEntry entry in baseComplexType.AttributeUses) { + XmlSchemaAttribute attr = (XmlSchemaAttribute) entry.Value; + if (attributeUses [attr.QualifiedName] == null) + XmlSchemaUtil.AddToTable (attributeUses, attr, attr.QualifiedName, h); + } } // Common process of AttributeWildcard. -- 2.11.4.GIT