[jdom-interest] Creating element

Jason Hunter jhunter at servlets.com
Wed Aug 27 13:55:46 PDT 2003

String content is string content.  If you add a string to an element it 
stays a string.  If you want it as elements: you SAXBuilder against it, 
get the produced content, and use that content.


Cassio Prazeres wrote:

> Sorry about duplicates.
> I can create a JDOM element passing a content text?
> example:
> I want create a element <body> whith the content:
> <p>The advent of the Web as a new publishing media where news may be 
> presented as a multimedia and interactive document and the 
> digitalization of content are imposing changes in the current models for 
> producing journalistic content.</p>
> <p>These changes look for a rationalization in the way journalists 
> compose their material (possibly a multimedia document), mainly when the 
> same news must be presented trough different communication media and be 
> available for retrieving by tools oriented by metadata, markup and 
> hyperlinks established over contents.</p>
> <p>The aims of this paper are to present and to discuss some problems 
> and solutions related to the authoring of hypermedia/multimedia news. 
> Issues like multimedia news content production (Multimedia Journalism), 
> news content production for publishing in multiple media (Journalism for 
> Multiple Media), preserving semantic of news content and establishing 
> hyperlinks among news are discussed in the paper.</p>
> <p>A model to represent and manage news, based on markup languages, is 
> presented, together with a tool designed to minimize possible resistance 
> journalists may offer to these changes.</p>
> i try:
>     String s = [text above]
>     Element root = new Element("body");
>     root.addContent(s);
>     document = new Document();
>     document.setRootElement(root);
> the tags <p> need to be elements too. The code above dont work. Anybody 
> have a suggestion???
> Thanks and sorry about my wrong English.

More information about the jdom-interest mailing list