[XML-SIG] Printing "quite" pretty DOMs?
Dinu Gherman
gherman@darwin.in-berlin.de
Thu, 04 Jul 2002 13:04:38 +0200 (CEST)
Hi,
I'm printing DOM trees in some slightly embellished fashion.
In my case I'm using toprettyxml() and toxml() to get the
desired output, toxml() gives me something like this, say:
<DESC><PARA>foo</PARA><PARA>bar</PARA></DESC>
(not very pretty) while toprettyxml() gives me:
<DESC>
<PARA>
foo
</PARA>
<PARA>
bar
</PARA>
</DESC>
Now this is actually too pretty in my case! What I'd really
need is something between the cases above, namely:
<DESC>
<PARA>foo</PARA>
<PARA>bar</PARA>
</DESC>
i.e. with no extra whitespace added for text inside an ele-
ment. Has anybody already some snippet to do this or isn't
it that trivial, maybe?
Thanks,
Dinu