[
Lists Home |
Date Index |
Thread Index
]
- To: Bill de hÓra <bill@dehora.net>
- 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?)
- From: "Dare Obasanjo" <dareo@microsoft.com>
- Date: Thu, 6 Mar 2003 05:48:24 -0800
- Cc: "Alaric B. Snell" <alaric@alaric-snell.com>,"Rick Jelliffe" <ricko@allette.com.au>,<xml-dev@lists.xml.org>
- Thread-index: AcLj4Oo5vl47y/z3RBqSmtlWGb85swABdb+3
- Thread-topic: [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:bill@dehora.net]
Sent: Thu 3/6/2003 5:04 AM
To: Dare Obasanjo
Cc: Alaric B. Snell; Rick Jelliffe; xml-dev@lists.xml.org
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
|