Re: removing nodes from xmldocument
From: e-mid (someone_at_somewhere)
Date: 07/01/04
- Next message: Chris Lovett: "[ANN] New XML Text Editor in Visual Studio"
- Previous message: Chris Lovett: "Re: Passing XML to webservice"
- In reply to: e-mid: "removing nodes from xmldocument"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 1 Jul 2004 09:53:13 +0300
thnkz all...
"e-mid" <someone@somewhere> wrote in message
news:u4XnM7rXEHA.1656@TK2MSFTNGP09.phx.gbl...
> Here is an xml structure. i want to remove <a> nodes that do not have any
> child. How can i do that in csharp?
> <root>
> <a>
> <b/>
> </a>
> <a/>
> <a/>
> <a>
> <c/>
> </a>
> </root>
>
> i tried following but it does not work:
>
> xmlNodeList l = xr.getElementsByTagName("a");
>
> foreach(XmlNode n in l)
> {
> if(n.HasChildNodes == false) xr.RemoveChild(n)
> }
>
>
- Next message: Chris Lovett: "[ANN] New XML Text Editor in Visual Studio"
- Previous message: Chris Lovett: "Re: Passing XML to webservice"
- In reply to: e-mid: "removing nodes from xmldocument"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|