473,326 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

xsd.exe: How to add base class to generated classes

I'd like to generate C# classes from an XML Schema file. All the generated
classes should provide a basic member function framework like Save() and a
basic member element like Dirty. Moreover, I'd like to have all the
generated class properties overwritten so that a write will set the Dirty
member to true (see example below).

Is this possible using xsd.exe? Or is there some other way? Or do I need to
write my own generator tool?

Thanks for enlightening me!

TIA,
Axel Dahmen
-----------------------------------------------------------
class GeneratedClass : BaseClass
{
private int member_;

public int Member {
get {return member_;}

// this function references base class members...
set {member_=value; State=Updated;}
}
}
/// This class will be provided in another file.
/// It provides basic funtionality common to all generated classes
class BaseClass
{
protected enum StateEnum {Inserted,Deleted,Updated,Clean};
protected State;

public virtual Save(); // uses Reflection to save derived classes
}
Nov 12 '05 #1
1 3427
Hi Axel

If your having problems with XSD.exe, then I suggest you look at Liquid
XML

http://www.liquid-technologies.com/

It supports C#, java, C++ & Visual Basic. It also supports more of the
XSD standard than xsd.exe, and may other the other tools out there.

Regards

Simon

Axel Dahmen wrote:
I'd like to generate C# classes from an XML Schema file. All the generated
classes should provide a basic member function framework like Save() and a
basic member element like Dirty. Moreover, I'd like to have all the
generated class properties overwritten so that a write will set the Dirty
member to true (see example below).

Is this possible using xsd.exe? Or is there some other way? Or do I need to
write my own generator tool?

Thanks for enlightening me!

TIA,
Axel Dahmen
-----------------------------------------------------------
class GeneratedClass : BaseClass
{
private int member_;

public int Member {
get {return member_;}

// this function references base class members...
set {member_=value; State=Updated;}
}
}
/// This class will be provided in another file.
/// It provides basic funtionality common to all generated classes
class BaseClass
{
protected enum StateEnum {Inserted,Deleted,Updated,Clean};
protected State;

public virtual Save(); // uses Reflection to save derived classes
}


Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Marek | last post by:
Actually, the very first question I should ask is "does it make sense at all?". For 2 days I've been trying to generate C# classes using XML schema and xsd.exe tool. So far the results are not...
0
by: keith bannister via .NET 247 | last post by:
(Type your message here) -------------------------------- From: keith bannister Hi, I'm new to .net (as of last week) but here goes. I want to serialize/deserialize a file the conforms...
5
by: Keith Bannister | last post by:
I'm new to .net so here goes. I'm tying to deserialize a class that is associated with an XML schema. I created the C# class with xsd.exe as below: xsd.exe /c /n:somenamespace...
3
by: Bobby | last post by:
I have a schema and have used XSDObjectGen.exe to create a set of classes that represent the schema. What is the best way to fill xsdobjectgen.exe generated classes with data? I want to create...
5
by: Benne Smith | last post by:
Hi, I have three enviroments; a development, a testing and a production enviroment. I'm making a big application (.exe), which uses alot of different webservices. I don't use the webservices...
9
by: Developer | last post by:
Hi, How can one tell wsdl.exe/VS.NET web service proxy generatioon to to put on imported classes? For example, i fin your web service you use a class: class Data { }
1
by: Axel Dahmen | last post by:
I'd like to generate C# classes from an XML Schema file. All the generated classes should provide a basic member function framework like Save() and a basic member element like Dirty. Moreover, I'd...
26
by: nyathancha | last post by:
Hi, How Do I create an instance of a derived class from an instance of a base class, essentially wrapping up an existing base class with some additional functionality. The reason I need this is...
0
by: greenstone | last post by:
Hi, I am trying to figure out how to get XSD.EXE (when generating C# classes from an .xsd) to add the XmlArrayItemAttribute Deserization Annotations to my C# generated class output: My specific...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.