473,472 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 3472
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: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.