OdesÃlatel: Toby Dickenson <tdickenson@geminidataloggers.com> Soon after I started using Zope, I created a <dtml-unitws> tag that replaces blocks of whitespace with a single character. The code looks a little dated, but is still functional. Examle usage below, followed by code. I hope this helps.
<dtml-unitws> <dtml-in xxx> <dtml-if comecondition> <dtml-var somevariable> </dtml-if> </dtml-in> </dtml-unitws>
It is fantastic idea and i dont know why it is not in zope distro. If you put start tag into header and end tag into footer documents, it could minimize your code at minimal level. But sometimes you want to have absolutelly NO space except you define between tags. So if somebody will extend this to ignore CR/LF and spaces from line beginning, publish your script here please.
from string import split, strip, join, replace import DocumentTemplate.DT_Util from DocumentTemplate.DT_String import String
class UnitWhitespaceTag: """ Removes redundant whitespace (not very conservatively) """
Where may I place this script and what is his name? lib/python/Products/unitws/__init__.py ?? Thanks, JL.