[jdom-interest] How to use importNode in JDOM

Raju Mukherjee raju at noospherics.com
Sun Mar 2 10:43:49 PST 2003


Hi Brett,

I read you article in developer works on importing a childNode or Element from one document to another document using DOM.
http://www-106.ibm.com/developerworks/xml/library/x-tipmvdom.html

I wnat to do the same with JDOM. couldn't figure out how to do that.
This is what i am trying to do:

a) I have a template.xml

    <root>
        <element1>
            <child1/>
            <child2/>
        </element>
    </root>
b) I want to create a new xml from the template.xml . Also a outside process result will tell be how mant <element1> should the new document have under <root>
c) So if the outside process ask me to add 2 such <element1> child under the new xml file's <root>, I would have to take the template of <element1> from the "template.xml" and add that 2 times under <root> to get my new xml file.
---------------basically adding row to a database.

You have nicely show that using w3c.dom.Node....but how would I do it in JDOM.

Any help is appreciated.

Raju
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20030302/81a8bedb/attachment.htm


More information about the jdom-interest mailing list