xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Sabu" <Joe.S...@dothill.com>
Subject Re: XML- deleting xml tags using DOM
Date Wed, 20 Sep 2000 13:58:31 GMT
You could, using DOM, traverse right upto the parent of the Node you want to
delete, and call removeChild(node_to_be_removed)

Gor e.g., if you want to remove the bookmark b1,

Elem  e = doc.getElementbyId("b1");
Node parent = (Node)e.getParentNode();

Hope it helps. BTW, this is the way it is in XML4J, I think it's the same in
Xerces too.
Joe Sabu
----- Original Message -----
From: "Priya Pinto" <itfresher@rediffmail.com>
To: <general@xml.apache.org>
Sent: Wednesday, September 20, 2000 8:22 AM
Subject: XML- deleting xml tags using DOM


Could some one help me! I'm working on using an XML file as database and
have been successful in creating a file and also in recalling the file and
adding new records.

The next stage is to be able to delete a particular record and am currently
stuck with this!

If possible could u send me an example?

Here's my xml file:

<?xml version="1.0" ?><?xml:stylesheet type="text/xsl"
<bookmarks Autonumber="2">
<bm id="b1">
<description>A search engine</description>
<bm id="b2">
<description>Auction site</description>

I could also post the code I've been working with if required.


Get Your Free Email At, http://www.rediffmail.com

For fabulous shopping deals visit:

In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org

View raw message