[jdom-interest] [OT] HTML in XML

Eric VERGNAUD eric.vergnaud at wanadoo.fr
Thu Apr 22 07:01:07 PDT 2004


le 22/04/04 12:37, Per Norrman à pernorrman at telia.com a écrit :

> Hi,
> 
> Two alternatives:
> 
>   String html = "<p>This is html with <br> a break and &.</p>";
> 
>   Element escape = new Element("fake");
>   escape.setContent(new Text(html));
>   new XMLOutputter().output(escape, System.out);
> 
>   System.out.println();
>   Element cdata = new Element("fake");
>   cdata.setContent(new CDATA(html));
>   new XMLOutputter().output(cdata, System.out);
> 
> There is no magic, you don't have to do anything special.
> 
> /pmn

Hi and thanks to all for these answers.

Will the above work automagically when the resulting xml document is parsed
by JDOM ?

Eric




More information about the jdom-interest mailing list