I want to build up a String from an XML-file in Java, using JDOM2. The XML-file snippet what I want to process looks like the following:
...
<title>
usefuldatapart1
<span profile="id1"> optionaldata1 </span>
<span profile="id2"> optionaldata2 </span>
<span profile="id3"> optionaldata3 </span>
usefuldatapart2
</title>
...
The element 'title' contains useful textual content for me separated into several parts with inner Elements, and if any of the profiles turn active I have to insert the content of the inner Element amongst the right parts (only one can be active at a time but in this case it's not important).
Is there any elegant way to get the Element text back as an array of Strings for further operations?
Or if I get this on a wrong way how could I do it properly?
(Currently suffering with Element's 'getText' and 'getContent' methods, and the basics of 'XMLOutputter')
Thanks for any help!