473,699 Members | 2,311 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 2777
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
14418
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
1819
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
2412
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
1387
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
4538
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
1368
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
2637
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
2123
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
8685
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
9172
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
9032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8880
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6532
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
5869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4374
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...
0
4626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3054
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

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.