excess space in html


Is there any way to remove the excess space that is generated on the published html code in Rhythmyx 6.5.2?



Does your Template source code include a lot of white space? If so, try removing that. Velocity includes any whitespace from the Template in the output HTML.


It’d be nice if the output of the publisher was passed through an HTML tidy parser. Perhaps a Publisher plug-in is in order.

Actually, you want to build an assembly plugin, not a publisher plugin.

Subclass PSVelocityAssembler and override the assembleSingle() method. You can then “fix up” the results any way that you like.


I think this should be something that is standard. We have also noticed this problem. There is no point in having redundant space in file, however, for debugging and readability it is nice to have space where appropriate. Can this add this to the next release?

One other point I should make here, is that most of the “excess” whitespace comes from Velocity macros.

There has been considerable debate within the Velocity community about whether macros should reproduce whitespace. Right now, it seems that the “preserve whitespace” camp is winning.

One of the bad things about trying to follow web standards is that sometimes they make decisions we don’t like.

One of the best ways to mitigate the problem is to use ## at the end of each line in your macro. This tells Velocity that the rest of the line is a comment. Here’s the “field” macro:

#macro(field $fieldname)##
#startAAField($fieldname "")##
#if ($sys.part.render)##

Hi Dave,

Bummer about the whitespace thing. Perhaps you should point them to some of our websites where half of the files uploaded have 1/4 of the file as white space!

I think we will use the ## as suggested. Any reduction is better than nothing.



Dave gave a good example and explanation of the problem at http://forum.percussion.com/showpost.php?p=841&postcount=6

Also, what you may want to try is have your macros as one-liners (much like system macros).

We are upgrading from 6.0 to 6.5.2 and it appears to me that white space is handled much better now.