Converting XSD to VB Classes

Posts   
 
    
Fishy avatar
Fishy
User
Posts: 392
Joined: 15-Apr-2004
# Posted on: 05-Oct-2004 23:08:24   

Not sure if this is the right place to place this post but anyhow...

I can create an xsd file from my legacy (HP3000/Image) database. I can create a strongly-typed dataset from my xsd. Big deal – who cares. cry What I want to do is create my own vb code from the xsd using a template. Like a class for the table and a class to maintain a collection of the tables and maybe some data access routines to populate the class properties.

So, can I use your template engine for this type of stuff? (if so, how?)

If I can’t then what other products (free stuck_out_tongue_winking_eye or cheap simple_smile ) would you recommend?

Thanks,

Fishy

Edit: This was my 100th post stuck_out_tongue_winking_eye stuck_out_tongue_winking_eye Yippie!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39951
Joined: 17-Aug-2003
# Posted on: 06-Oct-2004 12:02:23   

Code generation is about the input you put into the engine. you have the xsd as input, so you need to find a code generator which can use that xsd to produce code. As an xsd is XML, you could use an XSL sheet and convert the XML into whatever you want to have as output.

Frans Bouma | Lead developer LLBLGen Pro
Fishy avatar
Fishy
User
Posts: 392
Joined: 15-Apr-2004
# Posted on: 06-Oct-2004 16:38:02   

I know next to nothing about XSL stylesheets or reading XML and reformating the output.

I did find a utility called XSDObjectGen from microsoft. It's a dll and allows you to use it as a "custom tool" in VS. The only problem is that I have not found a way to customize the output.

If anyone could throw me a frickin' bone on other utilities or give me a place on how to convert the XSD I would be eternally (well maybe not that long) gratefull.

Thanks,

Fishy

bertcord avatar
bertcord
User
Posts: 206
Joined: 01-Dec-2003
# Posted on: 07-Oct-2004 03:10:21   

you might want to check out this book

http://www.amazon.com/exec/obidos/tg/detail/-/1590591372/qid=1097111328/sr=8- 2/ref=pd_csp_2/102-8838197-3820909?v=glance&s=books&n=507846

I flipped through it at the book store and remember seeing some XSD generation stuff. You might be able to download the sample code and check it out

bert

Fishy avatar
Fishy
User
Posts: 392
Joined: 15-Apr-2004
# Posted on: 07-Oct-2004 07:12:29   

Thanks Bert, I'll check it out.

btw, congatulations to you and your wife. Nice picture too.

Devildog74
User
Posts: 719
Joined: 04-Feb-2004
# Posted on: 08-Oct-2004 19:38:03   

Ive got that book, but wasnt all that impressed.

Writing XSLT transforms is a real PITA.

XSD.exe will create classes based on your schema, but it is a bit buggy. Here is a beta release of a tool that might fit the bill as well http://www.codeproject.org/useritems/CodeXS.asp

Fishy avatar
Fishy
User
Posts: 392
Joined: 15-Apr-2004
# Posted on: 08-Oct-2004 20:49:25   

Funny you should post that. smile I just spent the last 10 minutes checking it out. Only problem is I can't figure out how to customize it. disappointed

I'm sorta doing my own thing using using an article by Kathleen Dollard and going thru her Code Generation book. It has a lot of examples and a ton of potential. Of course if Frans could modify llbl to work on any sql-92 standard db then the whole thing would be mute. wink

Thanks,

Fishy

Fishy avatar
Fishy
User
Posts: 392
Joined: 15-Apr-2004
# Posted on: 08-Oct-2004 20:54:24   

Devildog74 wrote:

Ive got that book, but wasnt all that impressed.

Maybe not but it is a starting point and this article helps: http://www.fawcette.com/vsm/2003%5F05/magazine/features/dollard/