You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Devon <De...@darksideproductions.net> on 2002/11/20 01:29:57 UTC

RE: Formatting the HTML before sending it to the browser...

I noticed the same problem. Velocity seems to lack the facility for
delimiting velocity code from html (like php's <??>) and also lacks
methods for inserting literal html into a document from within velocity
code (php's echo 'blah'). - or is there away? -dcb

-----Original Message-----
From: Rodrigo Reyes [mailto:rodrigo@instaservi.com]
Sent: Tuesday, November 19, 2002 12:11 PM
To: velocity-user@jakarta.apache.org
Subject: Formating the HTML before sending it to the browser...


Hi
    Is there any way to have the HTML formatted before it is sent to the
browser? Velocity "wrecks" the code, making very hard to understand it
at
debigging time. Is there anyway to have the extra spaces and tabs erased
from every generated HTML once a system developing stage has finished?
Thanx...

Rodrigo



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


How about using JTidy to clean up the mess?

Posted by Rodrigo Reyes <ro...@instaservi.com>.
Hi
    First of all, thanks Claude for your class. I will start using is soon
:)
    I am not a Velocity developer, still I think it would be easy to have
the HTML output organized by some kind of library like JTidy and then sent
to the browser. That could help at template debugging time.

Rodrigo



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Formatting the HTML before sending it to the browser...

Posted by Claude Brisson <cl...@savoirweb.com>.
Don't forget the difference between a templating language and a scripting language...

php, as javascript, is a scripting language
velocity is a templating language

back to the tabs and extra space problem... it is a real concern, that I hope will be addressed in future released.

You can try to use this little TrimWriter I wrote, that solved my formatting problems.
It is really a quick and dirty coded class, but it works and can help someone.
It removes \t and replace \n\n by \n.
To use it, just redirect velocity output towards a "new TrimWriter(original writer)."

CloD

----- Original Message ----- 
From: "Devon" <De...@darksideproductions.net>
To: "Velocity Users List" <ve...@jakarta.apache.org>
Sent: mercredi 20 novembre 2002 01:29
Subject: RE: Formatting the HTML before sending it to the browser...


I noticed the same problem. Velocity seems to lack the facility for
delimiting velocity code from html (like php's <??>) and also lacks
methods for inserting literal html into a document from within velocity
code (php's echo 'blah'). - or is there away? -dcb

-----Original Message-----
From: Rodrigo Reyes [mailto:rodrigo@instaservi.com]
Sent: Tuesday, November 19, 2002 12:11 PM
To: velocity-user@jakarta.apache.org
Subject: Formating the HTML before sending it to the browser...


Hi
    Is there any way to have the HTML formatted before it is sent to the
browser? Velocity "wrecks" the code, making very hard to understand it
at
debigging time. Is there anyway to have the extra spaces and tabs erased
from every generated HTML once a system developing stage has finished?
Thanx...

Rodrigo



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>