Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Delete Node...

Posted on 2006-06-17
1
Medium Priority
?
188 Views
Last Modified: 2010-04-24
Hello

I have this file:

<?xml version="1.0" encoding="utf-8"?>
<Cocktails>
  <Cocktail Name="adsfds">
    <Klasse>Alkoholisch</Klasse>
    <Jahreszeit>ganzjährig</Jahreszeit>
    <Gelegenheit>Ganztägig</Gelegenheit>
    <Anleitung>
    </Anleitung>
  </Cocktail>
  <Cocktail Name="Test">
    <Klasse>Alkoholisch</Klasse>
    <Jahreszeit>ganzjährig</Jahreszeit>
    <Gelegenheit>Ganztägig</Gelegenheit>
    <Anleitung />
  </Cocktail>
  <Cocktail Name="sven">
    <Klasse>Alkoholisch</Klasse>
    <Jahreszeit>ganzjährig</Jahreszeit>
    <Gelegenheit>Ganztägig</Gelegenheit>
    <Anleitung>Hahaf</Anleitung>
  </Cocktail>
  <Cocktail Name="svend">
    <Klasse>Alkoholisch</Klasse>
    <Jahreszeit>ganzjährig</Jahreszeit>
    <Gelegenheit>Ganztägig</Gelegenheit>
    <Anleitung>Hahaf</Anleitung>
  </Cocktail>
</Cocktails>

How can I now delete the Cocktail Name "svend" with all subnodes?

Thanks

Sven
0
Comment
Question by:Ruttensoft
1 Comment
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 2000 total points
ID: 16927188

    Dim node As XmlNode = doc.SelectSingleNode("Cocktails/Cocktail[@Name='svend']")
    doc.documentElement.RemoveChild(node)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question