TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jay Webster
NA
67
0
Delete Xml
Apr 17 2011 4:41 PM
Hi,
I have the above XML and code:
XML
<Library>
<Game id="1">
<Title>Game1</Title>
<Description>Test1</Description>
</Game>
<Game id="2">
<Title>Game2</Title>
<Description>Test2</Description>
</Game>
</Library>
Code
var deleteNode = doc.SelectSingleNode("//Library/Game[id='1']");
deleteNode.ParentNode.RemoveAll();
I want to remove the following:
<Game id="1">
<Title>Game1</Title>
<Description>Test1</Description>
</Game>
It should look like this after:
<Library>
<Game id="2">
<Title>Game2</Title>
<Description>Test2</Description>
</Game>
</Library>
The code doesnt seem to be working though :(
Jay
Reply
Answers (
2
)
LZ algorthims
SoS