[Mono-bugs] [Bug 79474][Nor] New - xsd generates classes that derive from sealed class

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Sep 22 14:13:56 EDT 2006

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by martin.voelkle at gmail.com.


--- shadow/79474	2006-09-22 14:13:56.000000000 -0400
+++ shadow/79474.tmp.31984	2006-09-22 14:13:56.000000000 -0400
@@ -0,0 +1,82 @@
+Bug#: 79474
+Product: Mono: Compilers
+Version: 1.1
+OS Details: Ubuntu dapper
+Status: NEW   
+Priority: Normal
+Component: XSD
+AssignedTo: atsushi at ximian.com                            
+ReportedBy: martin.voelkle at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: xsd generates classes that derive from sealed class
+Description of Problem:
+If a complexType extends a type that restricts string, xsd will generate ,
+it can happen that the generated class.
+Steps to reproduce the problem:
+1. Create file bug.xsd:
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+targetNamespace="http://example.com/ns" xmlns:ns="http://example.com/ns"
+elementFormDefault="qualified" attributeFormDefault="unqualified">
+	<simpleType name="string30">
+		<restriction base="string">
+			<maxLength value="30"/>
+		</restriction>
+	</simpleType>
+	<element name="element">
+		<complexType>
+			<simpleContent>
+				<extension base="ns:string30">
+					<attribute name="attribute" type="string"/>
+				</extension>
+			</simpleContent>
+		</complexType>
+	</element>
+2. run xsd:
+xsd bug.xsd /classes
+3. compile the generated classes:
+mcs /t:library bug.cs
+Actual Results:
+&#65279;bug.cs(19,18): error CS0509: `Schemas.element': cannot derive from sealed
+class `string'
+/usr/lib/mono/1.0/mscorlib.dll: `string', name of symbol related to
+previous error
+&#65279;Compilation failed: 1 error(s), 0 warnings
+Expected Results:
+How often does this happen? 
+Additional Information:
+xsd should generate a Value field, like when the type extends string directly:
+<extension base="string">
+public string Value;
+There might be other ways to extend string indirectly that could trigger
+this bug, but I'm no xsd guru.

More information about the mono-bugs mailing list