JDOM and appending a child element


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: JDOM and appending a child element

  1. #1
    David Rancour Guest

    JDOM and appending a child element


    OK...I must be high or something...

    I am writing a webservice which utilizes JDOM and don't see how to append
    a newly created node to an existing node in a JDOM document object. What
    is going on here? I just generated the api docs for JDOM and searched for
    an 'appendChild' method but I just don't see it anywhere!

    When using JDOM how do I append a new node to an existing node in a JDOM
    document? I'm afraid that using the 'setChildren' method will remove any
    existing child nodes on the node that I call 'setChildren' on.

    Any help would be great, thanks!!

    David Rancour

  2. #2
    Paul Clapham Guest

    Re: JDOM and appending a child element

    I don't have JDOM installed, but I did print out an intro to JDOM
    (http://www.ibiblio.org/xml/slides/xmlsig/jdom/JDOM.html). From the
    examples I saw in the first 15% of that document, I'd say you want the
    addContent(Element) method of the Element object.

    PC2

    "David Rancour" <david_rancour@hotmail.com> wrote in message
    news:3b680813$1@news.devx.com...
    >
    > OK...I must be high or something...
    >
    > I am writing a webservice which utilizes JDOM and don't see how to append
    > a newly created node to an existing node in a JDOM document object. What
    > is going on here? I just generated the api docs for JDOM and searched for
    > an 'appendChild' method but I just don't see it anywhere!
    >
    > When using JDOM how do I append a new node to an existing node in a JDOM
    > document? I'm afraid that using the 'setChildren' method will remove any
    > existing child nodes on the node that I call 'setChildren' on.
    >
    > Any help would be great, thanks!!
    >
    > David Rancour




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center