all groups > dotnet xml > february 2005 >
You're in the dotnet xml group:
XSDObjectGenerator issues
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
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] "JTrigger" <jtrigger@nospam.nospam> wrote in message news:OvqfbdsEFHA.3120@TK2MSFTNGP12.phx.gbl... >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 > > > >
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] "Dino Chiesa [Microsoft]" <dinoch@online.microsoft.com> wrote in message news:uAjuvIuEFHA.624@TK2MSFTNGP15.phx.gbl... > Jim, I don't see any duplicate classes in that code snippet. . . Can you > elaborate on the problems you are seeing? -Dino > > > > "JTrigger" <jtrigger@nospam.nospam> wrote in message > news:OvqfbdsEFHA.3120@TK2MSFTNGP12.phx.gbl... >>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 >> >> >> >> > >
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] "JTrigger" <jtrigger@nospam.nospam> wrote in message news:OLa4WF3EFHA.3376@TK2MSFTNGP12.phx.gbl... > 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) > > > > "Dino Chiesa [Microsoft]" <dinoch@online.microsoft.com> wrote in message > news:uAjuvIuEFHA.624@TK2MSFTNGP15.phx.gbl... >> Jim, I don't see any duplicate classes in that code snippet. . . Can >> you elaborate on the problems you are seeing? -Dino >> >> >> >> "JTrigger" <jtrigger@nospam.nospam> wrote in message >> news:OvqfbdsEFHA.3120@TK2MSFTNGP12.phx.gbl... >>>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 >>> >>> >>> >>> >> >> > >
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] "JTrigger" <jtrigger@nospam.nospam> wrote in message news:uoK%23wt6EFHA.2600@TK2MSFTNGP09.phx.gbl... > 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"/> > > > "JTrigger" <jtrigger@nospam.nospam> wrote in message > news:OLa4WF3EFHA.3376@TK2MSFTNGP12.phx.gbl... >> 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) >> >> >> >> "Dino Chiesa [Microsoft]" <dinoch@online.microsoft.com> wrote in message >> news:uAjuvIuEFHA.624@TK2MSFTNGP15.phx.gbl... >>> Jim, I don't see any duplicate classes in that code snippet. . . Can >>> you elaborate on the problems you are seeing? -Dino >>> >>> >>> >>> "JTrigger" <jtrigger@nospam.nospam> wrote in message >>> news:OvqfbdsEFHA.3120@TK2MSFTNGP12.phx.gbl... >>>>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 >>>> >>>> >>>> >>>> >>> >>> >> >> > >
Don't see what you're looking for? Try a search.
|
|
|