Hi,
I'm trying to use JDOM to convert some letters into XML. I can get the structure for the XML header, author tag and the whole letter into a tag, i.e
<author>hogarth<ln>text of the letter</ln></author> but what I want to do is to have each line attached to a node like <author>hogarth<ln>line 1</ln><ln>line 2</ln>...& so on</author>. However I keep getting the error message:
org.jdom.IllegalAddException: The Content already has an existing parent "author"
at org.jdom.ContentList.add(ContentList.java:209)
at org.jdom.ContentList.add(ContentList.java:131)
at java.util.AbstractList.add(Unknown Source)
at org.jdom.Element.addContent(Element.java:811)
at uk.co.austgate.xml.jdbcXml.toDocument(jdbcXml.java:38)
My code is:
The code is called from a Data Access Object to turn the letter text into XML to be serialised to a
servlet. I'd be grateful for any suggestions or if i should be really be using something like SAX instead. Thanks in advance.
Iain