This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Re: Problem with XML PrettyPrinter and Node toString in general

No replies
normen.mueller
Joined: 2008-10-31,
User offline. Last seen 3 years 8 weeks ago.

He Ronald,

On Nov 13, 2008, at 7:55 PM, Ronald Steinhau wrote:
> A node is converted to by both toString and the
> PrettyPrinter. I think this is wrong and in an eclipse plugin.xml
> file it may even cause trouble (an extension point is sometimes not
> recognized when not using the short form - although I think this
> should be seen as an eclipse bug).Anyway, for the PrettyPrinter I
> changed line 175-177 (final 2.7.2 sources) to
> if (childrenAreLeaves(node) && fits(test)) {
> makeBox(ind, leafTag(node))
> } else {
> and than it worked for me. If the resp. committer thinks this is
> correct, I hope it will find its way into the source. And even
> better, toString should be corrected in the same manner.
>
> Ronald Steinhau

I incorporated your change, namespace declarations are lost, though.
For example:

var xml = ()
println(new MyPrettyPrinter(220,2).format(xml))

The output is

Do you have any suggestions?

Cheers,
--
Normen Müller

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland