Solved

Delete Node...

Posted on 2006-06-17
1
181 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 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

18 Experts available now in Live!

Get 1:1 Help Now