On 30 May 2009, at 00:41, botunge wrote:
Hi
Thanks for the reply.. It works great.
Good to see it worked as I expected.
The problem now, is that i have 2 to choose from.. :)
<snip />
Any thoughs on performance of One vs. Two.
If you can send the SAX events directly to FOTreeBuilder, that would
probably perform slightly better, since you avoid the roundtrip via
DOM. It depends a bit on the parser, and for small fragments the
difference will likely be minimal.
One is elements in elements, while the second can inline elements in
text,
e.g.
One <block>text<leader/></block>, but no text can be placed after
the leader
tag ends within the block.
Two <block>text<leader/>text again</block> is possible since i control
defaultHandler.characters..
Am i missing something, or is two also possible in one using
createElementsNS...
Should be possible, if I understand the question correctly:
Document newDoc = docBuilder.newDocument();
newDoc.setDocumentURI(FO_NAMESPACE);
Element root = newDoc.createElementNS(FO_NAMESPACE, "block");
Element leader = newDoc.createElementNS(FO_NAMESPACE, "leader");
Text text = newDoc.createTextNode("text");
root.appendChild(text);
root.appendChild(leader);
text = newDoc.createTextNode("text again");
root.appendChild(text);
Regards
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org