473,386 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

xsd.exe and XmlType?

I have a relatively simple xsd which I am turning into a class using
"xsd.exe". I then create a collection of these classes. I have run
into one minor problem. When serializing my collection, I would like
the names of the elements to be different from the class name as
generated by xsd.exe. I don't want to change the class name itself,
due to naming conventions. This is trivial to do after-the-fact by
adding the "XmlType" tag to the signature of the class. However, when
I regenerate from the xsd, the tag disappears. Is there some way of
putting the "XmlType" information into the xsd so that xsd.exe
maintains it? Alternatively, is there an easy way to rename the
elements when serializing?

Thanks!
Brad.
Nov 12 '05 #1
4 2752
Following is a detailed description on how to do that:

http://msdn.microsoft.com/library/de...classtopic.asp

"Bradley Plett" <pl****@hotmail.com> wrote in message
news:2l********************************@4ax.com...
I have a relatively simple xsd which I am turning into a class using
"xsd.exe". I then create a collection of these classes. I have run
into one minor problem. When serializing my collection, I would like
the names of the elements to be different from the class name as
generated by xsd.exe. I don't want to change the class name itself,
due to naming conventions. This is trivial to do after-the-fact by
adding the "XmlType" tag to the signature of the class. However, when
I regenerate from the xsd, the tag disappears. Is there some way of
putting the "XmlType" information into the xsd so that xsd.exe
maintains it? Alternatively, is there an easy way to rename the
elements when serializing?

Thanks!
Brad.

Nov 12 '05 #2
Following is a detailed description on how to do that:

http://msdn.microsoft.com/library/de...classtopic.asp

"Bradley Plett" <pl****@hotmail.com> wrote in message
news:2l********************************@4ax.com...
I have a relatively simple xsd which I am turning into a class using
"xsd.exe". I then create a collection of these classes. I have run
into one minor problem. When serializing my collection, I would like
the names of the elements to be different from the class name as
generated by xsd.exe. I don't want to change the class name itself,
due to naming conventions. This is trivial to do after-the-fact by
adding the "XmlType" tag to the signature of the class. However, when
I regenerate from the xsd, the tag disappears. Is there some way of
putting the "XmlType" information into the xsd so that xsd.exe
maintains it? Alternatively, is there an easy way to rename the
elements when serializing?

Thanks!
Brad.

Nov 12 '05 #3
I have been unable to make that sample work for a class that inherits
from a collection. Any further help or examples would be much
appreciated!

Thanks!
Brad.

On Fri, 4 Jun 2004 20:48:39 -0700, "Yan Leshinsky"
<ya**@online.microsoft.com> wrote:
Following is a detailed description on how to do that:

http://msdn.microsoft.com/library/de...classtopic.asp

"Bradley Plett" <pl****@hotmail.com> wrote in message
news:2l********************************@4ax.com.. .
I have a relatively simple xsd which I am turning into a class using
"xsd.exe". I then create a collection of these classes. I have run
into one minor problem. When serializing my collection, I would like
the names of the elements to be different from the class name as
generated by xsd.exe. I don't want to change the class name itself,
due to naming conventions. This is trivial to do after-the-fact by
adding the "XmlType" tag to the signature of the class. However, when
I regenerate from the xsd, the tag disappears. Is there some way of
putting the "XmlType" information into the xsd so that xsd.exe
maintains it? Alternatively, is there an easy way to rename the
elements when serializing?

Thanks!
Brad.


Nov 12 '05 #4
I have been unable to make that sample work for a class that inherits
from a collection. Any further help or examples would be much
appreciated!

Thanks!
Brad.

On Fri, 4 Jun 2004 20:48:39 -0700, "Yan Leshinsky"
<ya**@online.microsoft.com> wrote:
Following is a detailed description on how to do that:

http://msdn.microsoft.com/library/de...classtopic.asp

"Bradley Plett" <pl****@hotmail.com> wrote in message
news:2l********************************@4ax.com.. .
I have a relatively simple xsd which I am turning into a class using
"xsd.exe". I then create a collection of these classes. I have run
into one minor problem. When serializing my collection, I would like
the names of the elements to be different from the class name as
generated by xsd.exe. I don't want to change the class name itself,
due to naming conventions. This is trivial to do after-the-fact by
adding the "XmlType" tag to the signature of the class. However, when
I regenerate from the xsd, the tag disappears. Is there some way of
putting the "XmlType" information into the xsd so that xsd.exe
maintains it? Alternatively, is there an easy way to rename the
elements when serializing?

Thanks!
Brad.


Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: rabbit | last post by:
Hi all, I want to know, how can i insert the xml data using createXML() with CLOB in the xmltype column? I store the xml data at first in the clob column und want to import these data in the...
2
by: Abhinav | last post by:
Hi .. I have the following sort of xml (In an xmlType in the database ..) <or_group> <operand>a</operand> <operand> <and_group> <operand>b</operand>
0
by: Bradley Plett | last post by:
I have a relatively simple xsd which I am turning into a class using "xsd.exe". I then create a collection of these classes. I have run into one minor problem. When serializing my collection, I...
0
by: Daniel Lidström | last post by:
Hi, for what reason do I put XmlType and XmlRoot attributes on classes for XML serialization? I understand the reason for the top element, but not why it is sometimes put for child elements. ...
1
by: ChrisHarrington | last post by:
I load an XmlDocument which has an inline schema. I want to use XmlType property of XPathNavigator to get the type according to this inline schema. But XmlType is null for all nodes. I tried...
2
by: =?Utf-8?B?Tm9yZW1hYw==?= | last post by:
Hi. Using VS2005, .NET 2.0. I have an xml document that I want to go through and set the values on attributes of elements. The elements are complex types defined in my schema (xsd) files. ...
2
by: stepby | last post by:
Hi All, In the Oracle, there is a datatype called XMLTYPE. I would like to ask is it possible to get back the xml database by ASP ? What kinds of object can be used ? Thanks stepby
0
by: stepby | last post by:
Hi All, I am using the ASP as the server side language. I would like to ask how to retrieve the whole xml form the xmltype datatype in the database. I have found some SQL example to retrieve...
0
by: =?Utf-8?B?bW90eWxpaw==?= | last post by:
I want to expose my classes via web services in a different format. Using XmlAttributeAttribute and XmlElementAttribute works fine. But XmlType does not in all cases. If I have a class decl: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.