Solved

Delete Node...

Posted on 2006-06-17
1
184 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

740 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