JDOM copy element without content
843834Feb 12 2007 — edited Feb 13 2007Hi!
I like to copy an element X from an (input) JDOM document to become the root element of a new (output) JDOM document. I can do that. so far so good. Only the input JDOM I'm touching is quite lange and from the element to copy, the complete content (many other elements) gets copied aswell. But I need to copy just the start tag with it's attributes and the end tag. like:
Input JDOM
<Y>
<X abc="123" def="456">
<A xyz="234">
InhaltVonA
</A>
<B>
<C www="http"/>
</B>
</X>
</Y>
Output JDOM
<X abc="123" def="456">
</X>
How can I do that?
Cheers,
Marcello, Germany