Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
    Bookmark Topic Watch Topic
  • New Topic

remove an element from xml(JDOM)

 
Soumya Madhu
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,
I want to remove an element from xml(JDOM).which method I should use?

I have tried removeChild(). It will remove only first element. So I tried removeContent(index). It also not worked.
Suppose the xml is shown below:

<table name="t1">
<fiellds>
<fielld name="f1"/>
<fielld name="f2"/>
<fielld name="f2"/>
</fiellds>
</table>

I want to remove the field with name f1 or f2 or f3 conditionally.
Anyone please hepl me?.

Regards
Soumya
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question to multiple forums: CarefullyChooseOneForum. Note that this forum is about XML certifications, which have nothing to do with your question.

Let's continue the discussion in this duplicate thread.
 
    Bookmark Topic Watch Topic
  • New Topic