[jdom-interest] retrieving the children of an element as text

Fabrizio Lippolis fabrizio.lippolis at aurigainformatica.it
Tue Sep 12 08:10:34 PDT 2006


Hi,

I have an element and I want to retrieve a String which contains the 
children of my element including their text. For example if I have 
mainelement in this way

<mainelement>
	<one>one</one>
	<two>two</two>
</mainelement>

then I want to get

<one>one</one>
<two>two</two>

I should also respect the formatting so that if I have

<mainelement>
	<one>one</one><two>two</two>
</mainelement>

I should get

<one>one</one><two>two</two>

Any suggestion please?

Best regards,
Fabrizio



More information about the jdom-interest mailing list