RE: [xml-dev] RE: Take 2 - How do you replace comments from XML?

From
Danny Ayers <>
To
Date
2003-03-06T13:08:10Z
ID
<>
Thread
RE: [xml-dev] RE: Take 2 - How do you replace comments from XML?
> Well assuming he knows what block he wants to remove he can place 
> the machine.config file in a DOM, XPath to the node that he wants 
> to remove & replace it. If he also wants to delete the preceding 
> node if it is a comment he can simply check if its preceding 
> sibling is a comment (and examine its text if necessary) then 
> remove it as well. 

The first assumption is the problem.

<appSettings>
	<!-- settings related to X -->
		<add key="a" value="1"/>
		<add key="b" value="2"/>
	<!-- settings related to Y -->
		<add key="c" value="3"/>
		<add key="d" value="4"/>
</appSettings>