[jdom-interest] Need help removing

Jeff Ellman cb_elvis at hotmail.com
Wed May 22 10:10:20 PDT 2002


Here’s my dilemma.  I need to be able to delete and element and it’s 
children.  The element that I want to delete will be identified by value 
given to one of its child elements.

Here’s a sample of an XML document that I pretty much have to work with:

<calendar>
  <!-- year attribute cannot be blank -->
  <year num="">
    <!-- month attribute cannot be blank -->
    <month num="">
      <event>
        <!-- Date value cannot be blank -->
        <date></date>
        <meetingName></meetingName>
      </event>
    </month>
  </year>
</calendar>

Here’s another look at the XML document in application:

<calendar>
  <!-- year attribute cannot be blank -->
  <year num="2001">
    <!-- month attribute cannot be blank -->
    <month num="12">
      <event>
        <!-- Date value cannot be blank -->
        <date>12</date>
        <meetingName>Meeting 1</meetingName>
      </event>
      <!-- I want to delete this next event element and it's children -->
      <event>
        <!-- Date value cannot be blank -->
        <date>12</date>
        <meetingName>Remove event with this meetingName</meetingName>
      </event>
    </month>
  </year>
</calendar>

How do I remove the even element based upon that event’s meetingName?  Any 
help in this matter would be greatly appreciated.  Thanks!

Sincerely,
Elvis


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx




More information about the jdom-interest mailing list