diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2005-12-01 07:46:45 +0300 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2005-12-01 07:46:45 +0300 |
commit | 906d303f7592c7fd8fd6bca6910b63edf8a1822a (patch) | |
tree | d22abe2e4cf1bbb5ddfc7121b73f4ea32ce0022f /mcs/class/System.XML | |
parent | 19e63723c2d50916e9fb978cba178aa00330ad76 (diff) |
2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
* XmlSchemaElement.cs : Fixed ambiguity detection logic so that
chameleon ##other (xs:any) does not block other "absent"
(empty targetNamespace) element. Fixed bug #76865.
* XmlSchemaTests.cs : added testcase for #76865.
svn path=/trunk/mcs/; revision=53746
Diffstat (limited to 'mcs/class/System.XML')
4 files changed, 18 insertions, 2 deletions
diff --git a/mcs/class/System.XML/System.Xml.Schema/ChangeLog b/mcs/class/System.XML/System.Xml.Schema/ChangeLog index 23b74efd651..39ab52fb8ac 100644 --- a/mcs/class/System.XML/System.Xml.Schema/ChangeLog +++ b/mcs/class/System.XML/System.Xml.Schema/ChangeLog @@ -1,3 +1,9 @@ +2005-12-01 Atsushi Enomoto <atsushi@ximian.com> + + * XmlSchemaElement.cs : Fixed ambiguity detection logic so that + chameleon ##other (xs:any) does not block other "absent" + (empty targetNamespace) element. Fixed bug #76865. + 2005-11-07 Atsushi Enomoto <atsushi@ximian.com> * XmlSchemaValidator.cs : added missing ValidateWhitespace and diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaElement.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaElement.cs index 90c698b8be8..1eaeb7bd400 100644 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaElement.cs +++ b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaElement.cs @@ -918,8 +918,7 @@ namespace System.Xml.Schema break;
}
} else {
- if (any.TargetNamespace.Length == 0 ||
- any.TargetNamespace != this.QualifiedName.Namespace)
+ if (any.TargetNamespace != this.QualifiedName.Namespace)
error (h, "Ambiguous element label which is contained by -any- particle with ##other value was detected: " + this.QualifiedName);
}
}
diff --git a/mcs/class/System.XML/Test/System.Xml.Schema/ChangeLog b/mcs/class/System.XML/Test/System.Xml.Schema/ChangeLog index 926a6bc40ea..545dc189a41 100644 --- a/mcs/class/System.XML/Test/System.Xml.Schema/ChangeLog +++ b/mcs/class/System.XML/Test/System.Xml.Schema/ChangeLog @@ -1,3 +1,7 @@ +2005-12-01 Atsushi Enomoto <atsushi@ximian.com> + + * XmlSchemaTests.cs : added testcase for #76865. + 2005-10-23 Atsushi Enomoto <atsushi@ximian.com> * XmlSchemaTests.cs : some namespace output strategy seems changed diff --git a/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaTests.cs b/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaTests.cs index 408adf16013..3e6c5b24368 100644 --- a/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaTests.cs +++ b/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaTests.cs @@ -304,5 +304,12 @@ namespace MonoTests.System.Xml XmlSchema xs = XmlSchema.Read (xtr, null); AssertEquals (XmlNodeType.EndElement, xtr.NodeType); } + + [Test] + public void AmbiguityDetectionOnChameleonAnyOther () + { + string xsd = @"<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'> <xs:complexType name='TestType'> <xs:sequence> <xs:any namespace='##other' minOccurs='0' /> <xs:element name='Item' /> </xs:sequence> </xs:complexType></xs:schema>"; + XmlSchema.Read (new XmlTextReader (xsd, XmlNodeType.Document, null), null); + } } } |