[jdom-interest] [Fwd: STRING----->LIST]

Bradley S. Huffman hip at a.cs.okstate.edu
Sat Dec 28 08:01:50 PST 2002


> I have a string of elements like:
> String stringelements = <a>texta</a><b>textb</b><c>textc</c>.
> I would like to add this elements to another element called root.
> Ho can do this?(the problem is that i have a string and not a list of element to add with addContent...)

First wrap a bogus element around the string to ensure there is only
one root element (AFAIK none of the SAX parsers will parse fragments of
XML). Then run it through SAXBuidler, and do a getContent
on the root element of the resulting document. 

Brad



More information about the jdom-interest mailing list