You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Apache Wiki <wi...@apache.org> on 2006/11/22 12:32:44 UTC

[Jakarta-velocity Wiki] Update of "VelocityWhitespaceGobbling" by Paul Loy

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jakarta-velocity Wiki" for change notification.

The following page has been changed by Paul Loy:
http://wiki.apache.org/jakarta-velocity/VelocityWhitespaceGobbling

------------------------------------------------------------------------------
  ==== Alternatives and Workarounds ====
  
   * JTidy
-  * VelocityWhitespaceTruncatedByLineComment (Use a Velocity comment to artificially end a line)
+  * VelocityWhitespaceTruncatedByLineComment (Use a Velocity comment to artificially end a line, but doesn't remove leading or trailing spaces, tabs, etc.)
+ 
+ ==== Discussion of JTidy as a Workaround ====
+ 
+ I have looked into using JTidy as a workaround and it's quite promising. But we have to remember a few things before we all embrace the JTidyness.
+ 
+  * JTidy is only for HTML and XHTML (up to XHTML 1.0, not yet XHTML 1.1) so it can't be used for other documents and, in particular, text documents where whitespace does not get gobbled by the parser.
+  * JTidy is buggy and at times does not create W3C compliant code even if your original code is W3C compliant.
+  * As JTidy can add, remove or move elements in your HTML you don't have direct control over the end result. So you can't just roll this out to all your HTML output in one go. This is the same argument as the one against whitespace gobbling in Velocity -- you would have to test evey single page (template) to make sure that nothing funny has happened.
+  * The more steps you have before you output adds more complexity, more maintaining and more debugging.
+ 
+ All these points are quite compelling reasons not to use JTidy.
  
  ==== Democracy in Action (aka Democracy Inaction) ====
  
@@ -35, +46 @@

  
   * For Gobbling As Usual
    * everyone who has read this and not voted! (yes, this is a guilt trip)
+   * Paul Andrew Loy (paul ART keteracel DOT com) -- for consistency with current templates but would want the option for new templates to use gobble all or structured as long as it was consistent
   * For Gobbling All Whitespace
    * (no votes yet)
   * For Gobbling No Whitespace

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org