Re: xsd.exe generated classnames?
- From: "Bill Cohagan" <cohagan@xxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 20 May 2005 11:45:24 -0500
As I understand, you are suggesting that the way to change the (generated)
class name is to change the element name. My situation is that I cannot
change the element name, but would like to use a classname of my own
choosing. As I mentioned I can do this when generating a type *dataset* via
use of the codegen namespace attributes; however this approach seems not to
work when generating a class rather than a namespace.
So, is there a way to "override" the name generated for an element (or
attribute) when generating a class without actually modifying the
element/attribute name in the schema?
Thanks for the response.
Bill
"Kevin Yu [MSFT]" <v-kevy@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:5mke1SEXFHA.388@xxxxxxxxxxxxxxxxxxxxxxxx
> Hi Bill,
>
> First of all, I would like to confirm my understanding of your issue. From
> your description, I understand that you need to know how to specify the
> class name when generating class using xsd.exe. If there is any
> misunderstanding, please feel free to let me know.
>
> As far as I know, when generating a class using xsd.exe, we can specify
the
> name of top element to modify the class name. The following is a schema
> that produces a class named pubs. Change the name attribute in the top
> element will change the class name. <xs:element name="pubs">
>
> <?xml version="1.0" encoding="utf-8" ?>
> <xs:schema targetNamespace="http://tempuri.org/XSDSchema1.xsd"
> elementFormDefault="qualified"
> xmlns="http://tempuri.org/XSDSchema1.xsd"
> xmlns:mstns="http://tempuri.org/XSDSchema1.xsd"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:element name="pubs">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="publishers" />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
>
> HTH.
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>
.
- Follow-Ups:
- Re: xsd.exe generated classnames?
- From: Kevin Yu [MSFT]
- Re: xsd.exe generated classnames?
- References:
- xsd.exe generated classnames?
- From: Bill Cohagan
- RE: xsd.exe generated classnames?
- From: Kevin Yu [MSFT]
- xsd.exe generated classnames?
- Prev by Date: Re: Reading the value of an "xsi:type" attribute [unfortunate, but necessary cross-posting]
- Next by Date: Re: xsd.exe generated classnames?
- Previous by thread: RE: xsd.exe generated classnames?
- Next by thread: Re: xsd.exe generated classnames?
- Index(es):
Relevant Pages
|