<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=ks_c_5601-1987" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18813"></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=717143721-12082009><FONT color=#0000ff
size=2 face=Arial>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.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=717143721-12082009><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=717143721-12082009><!-- Converted from text/plain format -->
<P><FONT size=2>Regards,<BR><BR>Michael Kay<BR><A
href="http://www.saxonica.com/">http://www.saxonica.com/</A><BR><A
href="http://twitter.com/michaelhkay">http://twitter.com/michaelhkay</A>
</FONT></P></SPAN></DIV><BR>
<BLOCKQUOTE
style="BORDER-LEFT: #0000ff 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> jdom-interest-bounces@jdom.org
[mailto:jdom-interest-bounces@jdom.org] <B>On Behalf Of
</B>?..Vishu..?<BR><B>Sent:</B> 12 August 2009 17:40<BR><B>To:</B> Grzegorz
Kaczor<BR><B>Cc:</B> jdom-interest@jdom.org<BR><B>Subject:</B> Re:
[jdom-interest] Deleting node name:<BR></FONT><BR></DIV>
<DIV></DIV>Hi <SPAN>Grzegorz
Kaczor</SPAN>,<BR>
Thank you very much for ur concern. But the point is my sample xml file is
like this:<BR><BR><FONT style="FONT-FAMILY: verdana,sans-serif"
face=tahoma,sans-serif><DOCUMENT><BR> <SECTION><BR>
<TOPOLOGY><BR>
<PRNPROC><BR>
<!-- THIS IS A
COMMENT--><BR>
<declation><BR>
<declationsname>
<BR>
<word>X</word><BR>
</declationsname><BR>
</declation><BR>
<declation><BR>
<declationname><BR>
<word>Y</word><BR>
</declationname><BR>
</declation></FONT><BR><BR>I would like to remove the <word> tag
and replace the contents to <declationname> tag.<BR>Thanking
You<BR><BR>Regards<BR>Kashi V Sagiri<BR
style="FONT-FAMILY: verdana,sans-serif">
<DIV class=gmail_quote>On Wed, Aug 12, 2009 at 4:11 PM, Grzegorz Kaczor <SPAN
dir=ltr><<A
href="mailto:grzegorz.kaczor@gmail.com">grzegorz.kaczor@gmail.com</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>Hello,
<DIV class=im><BR><BR>
<DIV class=gmail_quote>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV>Hi,</DIV>
<DIV> 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</DIV></BLOCKQUOTE></DIV><BR></DIV>For example like that:<BR><BR>String
xmlString2 =
"<input><int><a>aaa</a><b>bbb</b></int></input>";<BR>
<BR>Document doc = new SAXBuilder().build(new
StringReader(xmlString2));<BR><BR>Element rootEl =
doc.getRootElement();<BR> <BR>Element
intEl =
rootEl.getChild("int");<BR>rootEl.removeContent(intEl);<BR>rootEl.addContent(intEl.removeContent());<BR>
<BR>new XMLOutputter().output(doc, System.out);<BR><BR>I
get: <BR><?xml version="1.0"
encoding="UTF-8"?><BR><input><a>aaa</a><b>bbb</b></input><BR><BR>Regards,<BR><FONT
color=#888888>Grzegorz</FONT>
<DIV>
<DIV></DIV>
<DIV class=h5><BR clear=all><BR>-- <BR>To be a man is, precisely, to be
responsible.<BR></DIV></DIV></BLOCKQUOTE></DIV><BR><BR clear=all><BR>-- <BR>$
VISHU $<BR></BLOCKQUOTE></BODY></HTML>