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

Serialization with ArrayList : element hiding

Hello,

I've trawled through many of the postings on this site but am still unable to find the right solution to removing the XML tag that is created when Serializing using an ArrayList. The structure that I'm trying to create is as follows :
<RootNode>
<Detail_level1>some attributes go here</Detail_level1>
<Series>
<Programme>details of the programme go here</Programme>
<Programme>details of the programme go here</Programme>
</Series>
<Series>
<Programme>details of the programme go here</Programme>
<Programme>details of the programme go here</Programme>
</Series>
</RootNode>

I've created a class 'SeriesProg' to contain a Series and Multiple Programmes and thus contains a class Series and an ArrayList of type Programme.
I then have an ArrayList of type SeriesProg which I assign an attribute of [XmlElement("SeriesProg",typeof(SeriesProg))] The arraylist is part of the RootNode class.

The resulting XML is all correct except for the 'SeriesProg' tag which I need to remove.

Many thanks for any advice that can be given.
Jul 20 '06 #1
1 1478
dotnet
22
why don'y u try with picking up all nodes in SeriesProg tag using

XmlNodeList objNodeList = objDoc.GetElementsByTagName("SeriesProg");

well whenever u serialize a class, classname is root node of the resulting xml.
Jul 28 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: steve | last post by:
I have the following two classes' the second derived from the first. Each time 'myclass' is added it adds an element. The second class is the same in, except it includes more methods. What I want...
3
by: Franz | last post by:
Let me describe the flow of my program first. 1. Deserialize data from xml file. 2. Addition of "PersonType" class to the AllPersonalData. 3. Serialize data back to the xml file. My question is...
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> ....... ..........
3
by: Ice | last post by:
All - I'm pretty comfortable with simple XML serialization of objects. However I observed something the other day and I wanted to know if I solved it the right way. Basically if I have a...
4
by: hs | last post by:
Hi I am serializing a dataset using a binary formatter as follows: IFormatter formater = new BinaryFormatter(); formatter.Serialize(stream, ds); // ds=DataSet, stream=MemoryStream .... DataSet...
3
by: Alexander | last post by:
When i store rule on PC with .NET.SP1 i cant restore them from PC without SP1. An i get this Error: System.Runtime.Serialization.SerializationException: Possible Version mismatch. Type...
5
by: George Ter-Saakov | last post by:
I have 2 classes one is document and another is collection of documents. When i am trying to use XmlSerializer to serialize class which has clsDcoumentIds member variable i am getting an exception...
4
by: martin.skarsaune | last post by:
We have some SOAP compatilibility issues with Visual Studio .NET. Procedure: 1. Add web reference by importing WSDL from an external system 2. Generate C# classes 3. Try to invoke the remote...
8
by: jamie | last post by:
Here's a class I'm working with public class BatchHeader { public string ScaleSite; public string FromScaleDate;
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
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
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...
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,...
0
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...
0
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...
0
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,...

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.