Click here to Skip to main content
12,448,003 members (83,439 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

7K views
Posted

Delete an XML node using the node name

, 24 Aug 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
Can't you do the same thing without the need for a select statement?XElement xElement = XElement.Load(path);xElement.Elements ("Node").Remove();xElement.Save(path);

Can't you do the same thing without the need for a select statement?

XElement xElement = XElement.Load(path);
xElement.Elements ("Node").Remove();
xElement.Save(path);

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

George Swan
Student
Wales Wales
No Biography provided

You may also be interested in...

Pro
Pro

Comments and Discussions

 
GeneralYour code will remove all the "Node" elements, while Kim's c... Pin
KenBonny7-Sep-11 22:08
memberKenBonny7-Sep-11 22:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160811.3 | Last Updated 24 Aug 2011
Article Copyright 2011 by George Swan
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid