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

Best practices when implemented WriteXml()?

Should WriteXml include the tags that encompass the object? Take a
Phone class for example, should WriteXml() emit this:

<Phone>
<Description>text</Description>
<Number>1-222-333-1234</Number>
</Phone>

Or:

<Description>text</Description>
<Number>1-222-333-1234</Number>

Normally I would expect the former to be correct, but when ever
the .NET XmlSerializer serializes a class containing a Phone or
Collection<Phonethe <Phone></Phonetags are always doubled (I am
assuming because the name of the property is Phone, of because the
type of the generic is Phone. For example (the PhoneList property is a
Collection<Phone>):

<BusinessObject>
...
<PhoneList>
<Phone>
<Phone>
<Description>text</Description>
<Number>1-222-333-1234</Number>
</Phone>
</Phone>
</PhoneList>
</BusinessObject>

What is the proper way to deal with this?

Jun 15 '07 #1
0 972

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

Similar topics

136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
0
by: Thibaut | last post by:
Hi, What are the recommended practices on how to use the __crt_dll_initialize() and __crt_dll_terminate() calls described at http://support.microsoft.com/?id=814472 in order to circumvent the...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
8
by: Art | last post by:
Hi folks, I'm writing a traditional desktop app using VB.NET and am stumbling over what seems like a very basic question: My app does not need to be connected to a server or another computer....
0
by: David Helgason | last post by:
I think those best practices threads are a treat to follow (might even consider archiving some of them in a sort of best-practices faq), so here's one more. In coding an game asset server I want...
3
by: =?Utf-8?B?TWljaGFlbA==?= | last post by:
Hi, I have been developing using C# in ASP.Net for about a year now. And have been a programmer for about 10 years. I have learned many different things in .NET, but still when I look at sample...
8
by: Flavio | last post by:
Hi, Nowadays the addition of functionality to programs by means of plugins is very frequent. I want to know the opinions of experienced Python developers about the best practices when it...
1
by: =?Utf-8?B?R3JlZw==?= | last post by:
Are there any sample projects or web-sites out there that discuss best practices with regards to inserting, editing and deleting records in a database with VB.Net. I know how I can do all this, I...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.