Bug 220 - complexType extension another complexType with anyAttribute error
Summary: complexType extension another complexType with anyAttribute error
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.XML ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Martin Baulig
URL:
Depends on:
Blocks:
 
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:


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


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:
Status:
RESOLVED FIXED

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:
//1.4.2.2.2.2 => 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">
<complexContent>
<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"/>
</choice>
<anyAttribute namespace="http://www.w3.org/XML/1998/namespace"
processContents="lax"/>
</restriction>
</complexContent>
</complexType>
<complexType name="linkTypeWithOpenAttrs">
<complexContent>
<extension base="gen:linkType">
   <anyAttribute namespace="##other"/>
</extension>
</complexContent>
</complexType>
Comment 1 GuoHui Chen 2011-08-08 00:37:55 UTC
<complexType name="linkTypeWithOpenAttrs">
<complexContent>
<extension base="gen:linkType">
   <choice minOccurs="0" maxOccurs="unbounded">
   </choice>
   <anyAttribute namespace="##other"/>
</extension>
</complexContent>

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 (§2.2.3.2)) 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.