abstract classes and xsd.exe 2.0

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
hello.<br/>
I created all the c# classes with xsd.exe 2.0xxxx of an xsd(ifc a architectural schema).<br/>
The problem is that i have a lot of definition that are marked as abstract, but in the generated class are not abstract:<br/>
<br/>
<xs:element name="uos" type="ex:uos" abstract="true"/><br/>
<xs:complexType name="uos <br/>
<xs:attribute name="id" type="xs:ID" use="required"/><br/>
<xs:attribute name="express" type="ex:Seq-anyURI" use="optional"/><br/>
<xs:attribute name="configuration" type="ex:Seq-anyURI" use="optional"/><br/>
<xs:attribute name="schemaLocation" type="ex:Seq-anyURI" use="optional"/><br/>
<xs:attribute name="edo" type="xs:anyURI" use="optional"/><br/>
<xs:attribute name="description" type="xs:string" use="optional"/><br/>
</xs:complexType><br/>
<br/>
[System.Xml.Serialization.XmlIncludeAttribute(typeof(uos1))]<br/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]<br/>
[System.SerializableAttribute()]<br/>
[System.Diagnostics.DebuggerStepThroughAttribute()]<br/>
[System.ComponentModel.DesignerCategoryAttribute("code")]<br/>
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:iso.org:standard:10303:part(28):version(2):xmlschema:common")]<br/>
public partial class uos {<br/>
<br/>
private string idField;<br/>
<br/>
private string[] expressField;<br/>
<br/>
private string[] configurationField;<br/>
<br/>
private string[] schemaLocationField;<br/>
<br/>
private string edoField;<br/>
<br/>
private string descriptionField;<br/>
<br/>
/// <remarks/><br/>
[System.Xml.Serialization.XmlAttributeAttribute(DataType="ID")]<br/>
public string id {<br/>
get {<br/>
return this.idField;<br/>
}<br/>
set {<br/>
this.idField = value;<br/>
}<br/>
}<br/>
<br/>
/// <remarks/><br/>
[System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")]<br/>
public string[] express {<br/>
get {<br/>
return this.expressField;<br/>
}<br/>
set {<br/>
this.expressField = value;<br/>
}<br/>
}<br/>
<br/>
/// <remarks/><br/>
[System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")]<br/>
public string[] configuration {<br/>
get {<br/>
return this.configurationField;<br/>
}<br/>
set {<br/>
this.configurationField = value;<br/>
}<br/>
}<br/>
<br/>
/// <remarks/><br/>
[System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")]<br/>
public string[] schemaLocation {<br/>
get {<br/>
return this.schemaLocationField;<br/>
}<br/>
set {<br/>
this.schemaLocationField = value;<br/>
}<br/>
}<br/>
<br/>
/// <remarks/><br/>
[System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")]<br/>
public string edo {<br/>
get {<br/>
return this.edoField;<br/>
}<br/>
set {<br/>
this.edoField = value;<br/>
}<br/>
}<br/>
<br/>
/// <remarks/><br/>
[System.Xml.Serialization.XmlAttributeAttribute()]<br/>
public string description {<br/>
get {<br/>
return this.descriptionField;<br/>
}<br/>
set {<br/>
this.descriptionField = value;<br/>
}<br/>
}<br/>
}<br/>
and when i deserialize a xml data file i get this error :<br/>
"Validation Error: The element urn:iso.org:standard:10303:part(28):version(2):xmlschema:common:uos is abstract or the type of element is abstract."<br/>
<br/>
what is that i wrong?<br/>
thanks

View the full article
 
Back
Top