Trying to delete a node via linq to xml but don't seem to be creating my query just right.
My xml looks like this:
<Index><Document> <FriendlyName>test</FriendlyName> <ID>f1eb6439-56dc-4f8a-a02a-c97706646643</ID> <Post>True</Post> <Department>Clearance</Department> <Category>Information</Category> <Audience></Audience> <Link Type="Page" Target=""><![CDATA]></Link> <Keywords></Keywords> </Document></Index>
I know the ID that i want and is stored in variable myID
Now I need to search my xml & find the entry that matches myID
Then delete the entire Document element & all child nodes.
Here's what I've been playing with but it's just not quite there.
myxmldoc.Elements("Document").Where(s => s.Element("ID").Value == myID).Remove();
Thanks ahead for the help!
View Complete Post