RE: [xml-dev] On the promotion and demotion of information items (was Re: [xml-dev] RE: Take 2 - How do you replace comments from XML?)

From
Dare Obasanjo <>
To
Bill de hÓra <>
Date
2003-03-06T13:48:24Z
ID
<>
Thread
RE: [xml-dev] On the promotion and demotion of information items (was Re: [xml-dev] RE: Take 2 - How do you replace comments from XML?)
using System; 
using System.Xml; 
 
public class Test{
  public static void Main(string[] args){
 
    XmlDocument doc = new XmlDocument(); 
    doc.Load("config.xml"); 
    XmlNode curr = doc.SelectSingleNode("//comment()[contains(.,'Start xxxx.Net')]");
    XmlNode parent = curr.ParentNode, deleted;
    
    do{       
      deleted = curr;
      curr    = curr.NextSibling;
      parent.RemoveChild(deleted); 
      
    }while((deleted.NodeType != XmlNodeType.Comment) || 
    (!deleted.Value.Equals(" End xxxx.Net "))); 
 
      Console.WriteLine(doc.OuterXml);
  }
}

________________________________

From: Bill de hÓra [mailto:]
Sent: Thu 3/6/2003 5:04 AM
To: Dare Obasanjo
Cc: Alaric B. Snell; Rick Jelliffe; 
Subject: Re: [xml-dev] On the promotion and demotion of information items (was Re: [xml-dev] RE: Take 2 - How do you replace comments from XML?)



Like I said, if you have useful advice on processing this file, I'm
sure the OP would like to hear it (I certainly would). 

Bill de hÓra