[Htmlparser-user] Adding elements to the html
Brought to you by:
derrickoswald
|
From: Joel <jo...@ha...> - 2007-01-10 20:02:49
|
I want to wrap text string with a span tag. I've tried the folowing, but
I'm running into a problem, that the tag's children aren't being displayed.
//New <span key="x">some text here</span>
TagNode toCreate = new Span();
toCreate.setAttribute("key", getKey(str), '"');
NodeList nl = new NodeList();
nl.add(new TextNode(str));
toCreate.setChildren(nl);
System.out.println(toCreate.toHtml());
This ends up showing <span key="x"> without the text node and end tag,
what am I doing wrong?
Joel
|