Friday, January 16, 2009

removing xml root

System.Xml.XmlDocument xmlDocument = new XmlDocument( );
string dataSectionMainLoan = string.Empty;
dataSectionMainLoan = @"";
xmlDocument.LoadXml( dataSectionMainLoan );
System.Xml.XmlElement root = xmlDocument.DocumentElement;
....load the xmlDocument here
//remove the artificial root
xmlDocument.ReplaceChild( xmlDocument.SelectSingleNode( "R/NextNode" ), xmlDocument.DocumentElement );

No comments:

Post a Comment