Solved

Delete Node...

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

738 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