all groups > dotnet xml > february 2005 >
You're in the

dotnet xml

group:

XSDObjectGenerator issues



XSDObjectGenerator issues JTrigger
2/14/2005 10:59:39 AM
dotnet xml: I was trying to use the XSDObjectGenerator that is downloadable from the MS
website, and I am having issues. When I generate the objects
from the xsd file it places everything in 1 CS file. When I try to do a
build
on the file I get errors because it duplicates a bunch of classes. Am I
doing something wrong? Below is an example of classes that it duplicates.
It looks like one is supposed to inherit from the other, so do I have to
seperate these out into seperate files? If so, why is that not an option in
the XSDObjectGenerator? This thing generates over 25,000 lines of code from
this xsd file.

[XmlType(TypeName="TransportMeans",Namespace=Declarations.SchemaVersion),XmlRoot,Serializable]

[EditorBrowsable(EditorBrowsableState.Advanced)]

public class TransportMeans

{

[XmlElement(ElementName="TransportMeansCoded",IsNullable=false,Form=XmlSchemaForm.Qualified,Namespace=Declarations.SchemaVersion)]

[EditorBrowsable(EditorBrowsableState.Advanced)]

public TransportMeansCode __TransportMeansCoded;


[XmlIgnore]

[EditorBrowsable(EditorBrowsableState.Advanced)]

public bool __TransportMeansCodedSpecified;


[XmlIgnore]

public TransportMeansCode TransportMeansCoded

{

get { return __TransportMeansCoded; }

set { __TransportMeansCoded = value; __TransportMeansCodedSpecified =
true; }

}

[XmlElement(ElementName="TransportMeansCodedOther",IsNullable=false,Form=XmlSchemaForm.Qualified,DataType="string",Namespace=Declarations.SchemaVersion)]

[EditorBrowsable(EditorBrowsableState.Advanced)]

public string __TransportMeansCodedOther;


[XmlIgnore]

public string TransportMeansCodedOther

{

get { return __TransportMeansCodedOther; }

set { __TransportMeansCodedOther = value; }

}

public TransportMeans()

{

}

}









[XmlRoot(ElementName="TransportMeans",Namespace=Declarations.SchemaVersion,IsNullable=false),Serializable]

public class TransportMeans : TransportMeans

{

public TransportMeans() : base()

{

}

}



Thanks,
Jim



Re: XSDObjectGenerator issues Dino Chiesa [Microsoft]
2/14/2005 5:11:49 PM
Jim, I don't see any duplicate classes in that code snippet. . . Can you
elaborate on the problems you are seeing? -Dino



[quoted text, click to view]

Re: XSDObjectGenerator issues JTrigger
2/15/2005 7:15:08 AM
How do you not see duplicate class definitions? This time I put 3 rows of *
between the 2 class defenitions so you can see where the first one ends and
the second one begins better. I would have attached the file, but your
server will not let me. TransportMeans is declared twice. The second
declaration shows inheritance from the first declaration though. When I try
to compile I get the following error:

c:\documents and settings\fowlerjo\my documents\visual studio
projects\dellinterface\interfaceobjects\order.cs(31778,15): error CS0101:
The namespace 'EDS.DellInterface.xCBLObjects' already contains a definition
for 'TransportMeans'

c:\documents and settings\fowlerjo\my documents\visual studio
projects\dellinterface\interfaceobjects\order.cs(25400,15): (Related
location)



[quoted text, click to view]

Re: XSDObjectGenerator issues JTrigger
2/15/2005 2:12:26 PM
Here is the code from the xSD file that is used to generate the code.

<xsd:complexType name="TansportMeans">

<xsd:sequence>

<xsd:element name="TansportMeansCoded" type="TansportMeansCode"/>

<xsd:element minOccurs="0" name="TansportMeansCodedOther"
type="xsd:string"/>

</xsd:sequence>

</xsd:complexType>

<xsd:element name="TansportMeans" type="TansportMeans"/>


[quoted text, click to view]

Re: XSDObjectGenerator issues Dino Chiesa [Microsoft]
2/22/2005 12:16:34 AM
Ah, sorry, I didn't see the duplicates immediately.
About attachments, Others have sent attachments, I think? Maybe it is not
the ms server that is refusing.

As a workaround, can you not rename your ComplexType "TansportMeans" to
"CT_TansportMeans" or something similar?
-D

[quoted text, click to view]

AddThis Social Bookmark Button