473,734 Members | 2,824 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2782
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.c om...
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.c om...
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.mi crosoft.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.mi crosoft.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
14422
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 xmltype column in another table. But i get always the error message: java.sql.SQLException: ORA-00600: internal error code, arguments: , , , , , , , ORA-06512: in "SYS.XMLTYPE", line 0
2
1822
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
377
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 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...
0
2416
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. -- Daniel
1
1389
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 loading the documenting from an XmlValidatingReader to see if that made any difference but it did not. Any suggestions? Thanks Chris
2
4539
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. I can iterate the document and get my XmlType and XmlBaseType values just fine. However, as soon as I call SetValue to write to an attribute, the
2
1370
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
2639
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 specific information in the xmltype datatype. SELECT a.col1.extract('//TABLE_NAME').getStringVal() as hello FROM tab1 a And I would like to ask how to retrieve the whole xml and store in what kinds of object in ASP.
0
2129
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: public class InternalFoo {} the schema generated is just fine for public internalFoo. But if I have a
0
8946
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9449
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.