473,327 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

XmlElement question

Hi,
I have and XmlElement from within an XmlDocument. I wish to RemoveAll() from
within the XmlElement plus itself. For example:

<Notes>
<Note id="n1">
<Info>A message</Info>
</Note>
<Note id="n2">
<Info>another message</Info>
</Note>
</Notes>

I wish to delete the node, Note with id="n1". I have assigned it to an
XmlElement, but i am unsure how to remove the element from the file.

Any help would be appreciated. Thank you in advance,

Tim.
Nov 12 '05 #1
6 1902


Timothy V wrote:

I have and XmlElement from within an XmlDocument. I wish to RemoveAll() from
within the XmlElement plus itself. For example:

<Notes>
<Note id="n1">
<Info>A message</Info>
</Note>
<Note id="n2">
<Info>another message</Info>
</Note>
</Notes>

I wish to delete the node, Note with id="n1". I have assigned it to an
XmlElement, but i am unsure how to remove the element from the file.


xmlElement.ParentNode.RemoveChild(xmlElement)

--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 12 '05 #2


Timothy V wrote:

I have and XmlElement from within an XmlDocument. I wish to RemoveAll() from
within the XmlElement plus itself. For example:

<Notes>
<Note id="n1">
<Info>A message</Info>
</Note>
<Note id="n2">
<Info>another message</Info>
</Note>
</Notes>

I wish to delete the node, Note with id="n1". I have assigned it to an
XmlElement, but i am unsure how to remove the element from the file.


xmlElement.ParentNode.RemoveChild(xmlElement)

--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 12 '05 #3

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 23/05/2004
Nov 12 '05 #4

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 23/05/2004
Nov 12 '05 #5
See: http://weblogs.asp.net/sonukapoor/articles/137700.aspx

Sonu Kapoor
Blog: http://weblogs.asp.net/sonukapoor/

-----Original Message-----
Hi,
I have and XmlElement from within an XmlDocument. I wish to RemoveAll() fromwithin the XmlElement plus itself. For example:

<Notes>
<Note id="n1">
<Info>A message</Info>
</Note>
<Note id="n2">
<Info>another message</Info>
</Note>
</Notes>

I wish to delete the node, Note with id="n1". I have assigned it to anXmlElement, but i am unsure how to remove the element from the file.
Any help would be appreciated. Thank you in advance,

Tim.
.

Nov 12 '05 #6
See: http://weblogs.asp.net/sonukapoor/articles/137700.aspx

Sonu Kapoor
Blog: http://weblogs.asp.net/sonukapoor/

-----Original Message-----
Hi,
I have and XmlElement from within an XmlDocument. I wish to RemoveAll() fromwithin the XmlElement plus itself. For example:

<Notes>
<Note id="n1">
<Info>A message</Info>
</Note>
<Note id="n2">
<Info>another message</Info>
</Note>
</Notes>

I wish to delete the node, Note with id="n1". I have assigned it to anXmlElement, but i am unsure how to remove the element from the file.
Any help would be appreciated. Thank you in advance,

Tim.
.

Nov 12 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Pluto | last post by:
What is the difference between XmlNode and XmlElement? I'm trying to implement the code at http://www.devx.com/dotnet/Article/11616/0/page/3 in C# and I'm getting an error at this line:...
0
by: Timothy V | last post by:
Hi, I have and XmlElement from within an XmlDocument. I wish to RemoveAll() from within the XmlElement plus itself. For example: <Notes> <Note id="n1"> <Info>A message</Info> </Note> <Note...
4
by: Steven.Xu | last post by:
Hello everyone. I have two instance of xml.xmldocument. One is XA another is XB. XA has a child node XA1. XA1 has many attributes and child nodes. Now I want to copy XA1 to XB with all of it's...
2
by: Compic | last post by:
Hi! I have this class: public class StoredItemElement : XmlElement { protected internal StoredItemElement(string prefix, string localName, string namespaceUri, XmlDocument doc) :...
2
by: Anirudh | last post by:
Hi, i wanted to know if there is any way to convert an object to XMlText to XMLElement. Thanks in advance.
1
by: andrej | last post by:
hi, ich habe eine anwendung, welche ein xml document erstellt. um festzustellen, ob ein element bereits vorhanden ist, verwende ich die funktion selectsinglenode( ....) diese funktion...
0
by: ryanr | last post by:
I've run into a problem with a recursive algorithm. Basically, it grabs a tree, and creates premutations based off it. For example: Suppose you have you sell shoes in two colors (Black,...
1
by: funkymp | last post by:
im trying to create a user interface that allows a user to upload there own mixes which are then added to a itunes podcast. basically, my problem is. when it updates the podcast.xml file, i need...
4
by: Varangian | last post by:
Hello something I want to ask...... why on earth you cannot inherit from XmlElement???? .... or you can but XmlElement constructor is protected or private and so you cannot define an empty...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.