Serialization with ArrayList : element hiding

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nickpay
    New Member
    • Jul 2006
    • 1

    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>deta ils of the programme go here</Programme>
    <Programme>deta ils of the programme go here</Programme>
    </Series>
    <Series>
    <Programme>deta ils of the programme go here</Programme>
    <Programme>deta ils 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("Ser iesProg",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.
  • dotnet
    New Member
    • Jul 2006
    • 22

    #2
    why don'y u try with picking up all nodes in SeriesProg tag using

    XmlNodeList objNodeList = objDoc.GetEleme ntsByTagName("S eriesProg");

    well whenever u serialize a class, classname is root node of the resulting xml.

    Comment

    Working...