Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / July 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Axel Dahmen - 11 Jul 2005 01:37 GMT
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
}
sprotty@hotmail.com - 28 Jul 2005 15:00 GMT
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

> 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
[quoted text clipped - 32 lines]
>   public virtual Save();    // uses Reflection to save derived classes
> }

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.