By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,680 Members | 1,890 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,680 IT Pros & Developers. It's quick & easy.

How to covert c# class to xml schema?

P: n/a
Hi Everyone,

In .Net we have XmlSerializer to convert c# class to xml, or vice versa. Do
we have any APIs to convert c# class to XSD?

Thanks in advance,
Cindy
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
There is an application, xsd.exe, that comes with .net. It is written in
..net. Part of this application takes XML and converts it to a schema. I'm
not sure what class it is that does this, but you could get reflector
(http://www.aisto.com/roeder/dotnet/) and decompile the app to find out.
From there you could take your C# Class serialize it to XML then use the
classes from XSD.exe and create a schema out of it.

I'm not sure if there is a way to take the class directly from C# to XSD,
but this is one possibility that should work.

--
Thanks
Wayne Sepega
Jacksonville, Fl

"When a man sits with a pretty girl for an hour, it seems like a minute. But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein
"Cindy Liu" <Ci******@discussions.microsoft.com> wrote in message
news:4D**********************************@microsof t.com...
Hi Everyone,

In .Net we have XmlSerializer to convert c# class to xml, or vice versa. Do we have any APIs to convert c# class to XSD?

Thanks in advance,
Cindy

Nov 12 '05 #2

P: n/a
Thanks, I'll try to see if it works.
Cindy

"Wayne" wrote:
There is an application, xsd.exe, that comes with .net. It is written in
..net. Part of this application takes XML and converts it to a schema. I'm
not sure what class it is that does this, but you could get reflector
(http://www.aisto.com/roeder/dotnet/) and decompile the app to find out.
From there you could take your C# Class serialize it to XML then use the
classes from XSD.exe and create a schema out of it.

I'm not sure if there is a way to take the class directly from C# to XSD,
but this is one possibility that should work.

--
Thanks
Wayne Sepega
Jacksonville, Fl

"When a man sits with a pretty girl for an hour, it seems like a minute. But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein
"Cindy Liu" <Ci******@discussions.microsoft.com> wrote in message
news:4D**********************************@microsof t.com...
Hi Everyone,

In .Net we have XmlSerializer to convert c# class to xml, or vice versa.

Do
we have any APIs to convert c# class to XSD?

Thanks in advance,
Cindy


Nov 12 '05 #3

P: n/a
You may also want to look at the XML Schema inference tool on GotDotNet
[0].

XSD.exe has a number of limitations, for example it can only infer a
schema from a single instance document.

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

[0] http://apps.gotdotnet.com/xmltools/xsdinference/

-----Original Message-----
From: Cindy Liu [mailto:Ci******@discussions.microsoft.com]
Posted At: Friday, September 24, 2004 12:09 PM
Posted To: microsoft.public.dotnet.xml
Conversation: How to covert c# class to xml schema?
Subject: Re: How to covert c# class to xml schema?

Thanks, I'll try to see if it works.
Cindy

"Wayne" wrote:
There is an application, xsd.exe, that comes with .net. It is written in ..net. Part of this application takes XML and converts it to a schema.
I'm
not sure what class it is that does this, but you could get
reflector (http://www.aisto.com/roeder/dotnet/) and decompile the app to find out. From there you could take your C# Class serialize it to XML then use the classes from XSD.exe and create a schema out of it.

I'm not sure if there is a way to take the class directly from C# to

XSD,
but this is one possibility that should work.

--
Thanks
Wayne Sepega
Jacksonville, Fl

"When a man sits with a pretty girl for an hour, it seems like a minute. But
let him sit on a hot stove for a minute and it's longer than any

hour. That's relativity." - Albert Einstein
"Cindy Liu" <Ci******@discussions.microsoft.com> wrote in message
news:4D**********************************@microsof t.com...
Hi Everyone,

In .Net we have XmlSerializer to convert c# class to xml, or vice

versa.
Do
we have any APIs to convert c# class to XSD?

Thanks in advance,
Cindy



Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.