[jdom-interest] transform --> w3c.Node --> JDOM.Document

Jason Hunter jhunter at collab.net
Thu Apr 5 17:38:50 PDT 2001

GDL Gary Lodge wrote:
> Probably there is a some frickin easy answer that i for the life of me
> cannot find. I feel like I'm standing in front of the pantry looking for a
> can of soup but can see nothing but campbells.
> What I would like to do is hold the result of a transformation for further
> work. I found a way to hold it in a domResult. I can turn that into a
> w3c.Node. But from there I am in a pickle looking for a way to move that to
> JDOM so I can cook. Is there an easy way someone has already come up with?
> I appreciate any comments. Thanks.
>                     //transform xml. Store it in a domresult
>             transformer.transform(new DOMSource(xmldoc),domResult);
>                     //push the result into a new w3c.Node
>             org.w3c.dom.Node node = domResult.getNode();
>         //empty can of soup??? Or full?

Use JDOMResult in your transform to catch the result as JDOM.  That's
your best approach.  See the jdom-contrib module.  Also see the FAQ.

If all you want to do is convert DOM to JDOM you can use DOMBuilder.


More information about the jdom-interest mailing list