[jdom-interest] (no subject)

Jason Long jason at supernovasoftware.com
Thu Feb 26 21:14:47 PST 2004


      elt3.addContent(new CDATA(elt.getText()));
 
This works, but I got depreciation a warning and I only get the text
portions of the element.  How can I get the textual representation of
everything including tags like <br/>?
 
-----Original Message-----
From: jdom-interest-admin at jdom.org [mailto:jdom-interest-admin at jdom.org]
On Behalf Of Jason Long
Sent: Thursday, February 26, 2004 10:50 PM
To: JDOM
Subject: [jdom-interest] (no subject)
 
I am not sure I follow.
My code is as follows:
 
Element elt0 = new Element("story");
Element elt1 = (Element) xpath.selectSingleNode(docJDOM);
elt0.addContent(elt1.clone());
 
This is currently serialized as:
 
<story>
  <text>
       Test test test <br/>
       Test test test <br/>
       Test test test <br/>
  </text>
</story>
 
I need it to be as follows:
<![CDATA[".
> Use XMLOutputter.outputElementContent to output the element's content.
> Output "]]>".
 
This assumes you element doesn't contain any CDATA descendants, anything
else that might produce a "]]>" <story>
  <text><![CDATA[
       Test test test <br/>
       Test test test <br/>
       Test test test <br/>
        ]]>
  </text>
</story>
 
 
 
 
Jason Long - CEO and Chief Software Engineer
Supernova Software - supernovasoftware.com
BS Physics, MS Chemical Engineering 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20040226/c7a2888b/attachment.htm


More information about the jdom-interest mailing list