[jdom-interest] Deleting node name:

Michael Kay mike at saxonica.com
Wed Aug 12 14:39:24 PDT 2009

Can't you see, Vishu, that this is exactly equivalent to the problem that
Grzegorz solved for you? You pretty well only have to change the element
names. You seem to be asking for spoon-feeding here - I can't understand
why you still have difficulty, given the information you have been given.

Michael Kay


From: jdom-interest-bounces at jdom.org [mailto:jdom-interest-
bounces at jdom.org] On Behalf Of ?..Vishu..?
Sent: 12 August 2009 17:40
To: Grzegorz Kaczor
Cc: jdom-interest at jdom.org
Subject: Re: [jdom-interest] Deleting node name:

Hi  Grzegorz Kaczor,
                                 Thank you very much for ur concern. But
the point is my sample xml file is like this:

          <!-- THIS IS A COMMENT-->

I would like to remove the <word> tag and replace the contents to
<declationname> tag.
Thanking You

Kashi V Sagiri

On Wed, Aug 12, 2009 at 4:11 PM, Grzegorz Kaczor
<grzegorz.kaczor at gmail.com> wrote:


      Could you just brief me how will you do it? and also i have to remove
all the <int> tags from the document. Please reply as early as possible.
Thanking you

For example like that:

String xmlString2 = "<input><int><a>aaa</a><b>bbb</b></int></input>";
Document doc = new SAXBuilder().build(new StringReader(xmlString2));

Element rootEl = doc.getRootElement();
Element intEl = rootEl.getChild("int");
new XMLOutputter().output(doc, System.out);

I get: 
<?xml version="1.0" encoding="UTF-8"?>


To be a man is, precisely, to be responsible.

$  VISHU  $

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20090812/2aba09e4/attachment.htm

More information about the jdom-interest mailing list