Re: xsd.exe generated classnames?



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."
>


.



Relevant Pages

  • Re: xsd.exe generated classnames?
    ... >> Hi Bill, ... I understand that you need to know how to specify the ... The following is a schema ... >> Kevin Yu ...
    (microsoft.public.dotnet.xml)
  • Re: Pub 2007 hard coding references
    ... It isn't usually necessary to specify this, and if it is the entry should be ... Bill S. ... I'm currently publishing directly to the ftp site. ...
    (microsoft.public.publisher.webdesign)
  • Re: xsd and parameter
    ... That's going to be tricky with a mapping schema and XPath approach. ... parent category I specify is returned, ... > One of my problems is that the category tree is recursive (category under ... if my parent category is found on treelevel ...
    (microsoft.public.sqlserver.xml)
  • Re: Schema extension
    ... trying to stay away from modifying the schema if at all possible. ... Brian ... "nitin" wrote: ...
    (microsoft.public.win2000.active_directory)
  • Re: why hierarchy?
    ... please specify specific data for the above. ... user doesn't design a schema. ... Bob Lewis ...
    (comp.databases.theory)

Quantcast