472,982 Members | 1,770 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How to covert c# class to xml schema?

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
3 24507
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: diadia | last post by:
when i write two classes as follow . compiler tell me that i can't access private number from other class but if types of two classes are the same it don't have error message ? why? class...
2
by: PeterW | last post by:
I have an xml file from which I want to generate an xsd schema and at a later stage a cs class. The xml file has a mix of defined namespaces and also an empty namespace. These are defined as...
13
by: Ray Z | last post by:
So far, I get the idea that if I want to use both the unmanaged and managed memory, I can not avoid memory copy. But I DO need to avoid it. I get a idea that maybe I could use "union" to convert...
3
by: Crirus | last post by:
Hello I need a tool to design a class schema and relationship between multiple classes Thanks, Crirus
0
by: Andrew Brook | last post by:
Hi everyone, I've been going through an article i found on MSDN (http://msdn.microsoft.com/msdnmag/issues/02/12/WebServicesDesign/) concerning designing the messages for a webservice in a schema...
6
by: Calros Lo | last post by:
Dear all: I develop a programe that need when I get a string , such as "123" or "ABC",if I get string "123" and the system will help me to create new string "124" , if I get string "ABC" and the...
1
by: Miguel Isidoro | last post by:
I generated a .cs class from a .xsd schema using the xsd.exe tool from Visual Studio 2005 and noticed that is generating duplicate class declarations. This happens because of my schema structure. I...
4
by: R. Nachtsturm | last post by:
Hi, Question (in short): can i somehow use the namespace tag to define that a class in its own file is actually the subclass (namespace wise) of another class? Explanation: for example, if I...
1
rajiv07
by: rajiv07 | last post by:
Hi to all I have some problem to use DBIx::Class package My::Schema; use base qw/DBIx::Class::Schema::Loader/; __PACKAGE__->loader_options( debug => 1, );
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

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.