Bug 220 - complexType extension another complexType with anyAttribute error
Summary: complexType extension another complexType with anyAttribute error
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.XML ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Martin Baulig
Depends on:
Reported: 2011-08-07 23:50 UTC by GuoHui Chen
Modified: 2015-03-17 06:22 UTC (History)
3 users (show)

Tags: complexType
Is this bug a regression?: ---
Last known good build:

test code (7.85 KB, application/zip)
2011-08-07 23:50 UTC, GuoHui Chen

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description GuoHui Chen 2011-08-07 23:50:32 UTC
Created attachment 83 [details]
test code

I have checked the mono's XmlSchemaComplexType.cs line 958:
// => 3.9.6 Particle valid (Extension)
I think If extension complexType has no contentTypePartical == null, should not check this rule.

When XmlSchemaSet validate a complexType base on another complexType, raise
System.Xml.Schema.XmlSchemaException: Invalid complex content extension was
found. The schema like this:
<complexType name="linkType">
<restriction base="xl:extendedType">
<choice minOccurs="0" maxOccurs="unbounded">
<element ref="xl:title"/>
<element ref="xl:documentation"/>
<element ref="link:loc"/>
<element ref="gen:arc"/>
<element ref="xl:resource"/>
<anyAttribute namespace="http://www.w3.org/XML/1998/namespace"
<complexType name="linkTypeWithOpenAttrs">
<extension base="gen:linkType">
   <anyAttribute namespace="##other"/>
Comment 1 GuoHui Chen 2011-08-08 00:37:55 UTC
<complexType name="linkTypeWithOpenAttrs">
<extension base="gen:linkType">
   <choice minOccurs="0" maxOccurs="unbounded">
   <anyAttribute namespace="##other"/>

If write this, pass the test.
Comment 2 GuoHui Chen 2011-08-08 01:19:11 UTC
3.4.1 The Complex Type Definition Schema Component
A complex type definition schema component has the following properties:
{content type}
One of empty, a simple type definition or a pair consisting of a ·content model· (I.e. a Particle (§ and one of mixed, element-only.

I notice that the {content type} can be empty.
Comment 3 Atsushi Eno 2015-03-17 06:22:05 UTC
It works with the latest mono master (which imports referencesource and should be compatible with .NET).

Repro is of too much for single unit test. Not adding.