Merge XmlNodelist

Can someone give me a solution to combine xmlNodelists into one list.

+6
xmlnodelist
source share
1 answer

I would use the LINQ .Concat method. The problem is that the XmlNodeList is IEnumerable as opposed to IEnumerable< XmlNode > . So you should call .Cast< XmlNode > on XmlNodeLists .

For example:

  var List = nodesoriginal.Cast<XmlNode>().Concat<XmlNode>(nodesupdate.Cast<XmlNode>()); 
+7
source share

All Articles