473,320 Members | 1,946 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,320 software developers and data experts.

xsd serialization and .net names of duplicate elements

I have a schema that goes something like this:

<xs:element name="account">
<xs:complexType>
<xs:sequeuence>
<xs:element name="accountid" type="xs:string"/>
<xs:element name="account" type="xs:string"/>
<xs:sequeuence>
</xs:complexType>
</xs:element>

When xsd generates a class for it, the end result is that the local
account element is named something like account1:

public partial class account
{

public string accountid { get; set; }

[System.Xml.Serialization.XmlElementAttribute("acco unt")]
public string account1 { get; set; }

}

In this case, the local account element represents the name of the
account and it is straight from the database column name. I would
rather not rename the element if possible. Is there a way to make it
not generate names like account1? There shouldn't be any issues with
either the schema nor the class with the property name being account.
So it seems like an internal issue of xsd tool (XmlCodeExporter
perhaps?)

If possible, I'd rather not massage it through SchemaImporterExtension,
etc. So if it can be achieved by a change in the schema - except for
renaming the element itself, that would be the best. Also this pattern
may repeat since in the database, there is no restriction that says the
table name and a column name cannot be identical. I am trying to find
a way to avoid this (account1) situation.

Thanks
Jiho

Jul 19 '06 #1
0 1046

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

Similar topics

16
by: Bob Rock | last post by:
Hello, when serializing an array of elements of a class Classname using XmlSerializer.Serialize() I get an XML like the following: <?xml version="1.0"> <ArrayOfClassname> ....... ..........
0
by: HakonB | last post by:
Hi all I get an exception when trying to deserialize a simple configuration file using XML Serialization. The very long stacktrace can be seen at the bottom of this message. I've see other...
3
by: AVL | last post by:
Hi, I'm new to .net. I need some info on serialization. What is serialization? Why do we need it? Why objects need to be serialized if they need to be stored in session or viewstate?
0
by: bharathreddy | last post by:
Before going to that i want to say few thing on serialization : Serialization is the process of converting an object into a form that can be readily transported. For example, you can serialize an...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.