tags:

views:

38

answers:

2

i have a node <name></name> where i put name, now i want to put array of names there.

Thanks in advance

+2  A: 

If you must put ARRAY to this object you can use some syntax like:

<name>
 <element>X</element>
 <element>Y</element>
</name>

or use a some serialization to string and pack to it.

<name>X,Y</name>
Svisstack
A: 
XmlNode node = xdoc.SelectSingleNode(path);            

foreach(string x in val)
{
    XmlNode subNode = xdoc.CreateNode(XmlNodeType.Element, subNodeName, null);
    subNode.InnerText = x;
    node.AppendChild(subNode);
}

path is the path to the node in xml

taher chhabrawala