Solved

Delete Node...

Posted on 2006-06-17
1
180 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 500 total points
ID: 16927188

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video discusses moving either the default database or any database to a new volume.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now