Greetings: Is there an easy way to surpress all whitespace output from DTML? Essentially, I have a situation where DTML is used for a crutch to do some simple logical things, but where most of the interesting stuff happens in external methods. There are a few lines of DTML that actually produce useful output, but I am getting a TON of whitespace before my interesting output that I need to surpress. Thanks for any replies, Bryan
Is there an easy way to surpress all whitespace output from DTML? Essentially, I have a situation where DTML is used for a crutch to do some simple logical things, but where most of the interesting stuff happens in external methods. There are a few lines of DTML that actually produce useful output, but I am getting a TON of whitespace before my interesting output that I need to surpress.
I also trying to solve this problem and the only way i've found is avoid whitespace between dtml tags. Like this: <dtml-in xxx><dtml-if comecondition><dtml-var somevariable></dtml-if></dtml-in> Of course, this is ugly solution because it makes code almost unreadable :(
On a related note (but curving off to a tanget), I always thought it would be quite good if there was a code compressor in Zope which could remove all useless whitespace to reduce the actual amount of data being sent in each page... There is something similar to this for Apache is there not? Unless it's inside a comment or a pre tag, are there many other situations where we need a new line character (or 2 spaces for that matter) The biggest cause of this is probably Dreamweaver formatted pages where the tags get indented with a whole lot of whitespace.
Hi Chris, Chris Beaven wrote:
On a related note (but curving off to a tanget), I always thought it would be quite good if there was a code compressor in Zope which could remove all useless whitespace to reduce the actual amount of data being sent in each page... There is something similar to this for Apache is there not?
There is a gzip/compress implemented in all recent Zopes, so if your browser supports it you can have your content compressed. This eliminated not only the whitespaces... Of course you can do this with Apache too. For the Problem above it would help a lot to skip DTML and use ZPT. ZPT makes it easyer to have good formated HTML source. Otoh, HTML is not primary meant for human eyes :)
Unless it's inside a comment or a pre tag, are there many other situations where we need a new line character (or 2 spaces for that matter) The biggest cause of this is probably Dreamweaver formatted pages where the tags get indented with a whole lot of whitespace.
You could define a method to reduce this at upload-time. Of course this would require to write a python product. Regards Tino
zoper@disturbance.dhs.org wrote at 2003-7-8 09:43 -0700:
Is there an easy way to surpress all whitespace output from DTML? Essentially, I have a situation where DTML is used for a crutch to do some simple logical things, but where most of the interesting stuff happens in external methods. There are a few lines of DTML that actually produce useful output, but I am getting a TON of whitespace before my interesting output that I need to surpress.
Do not use DTML for this. Use (internal) Python Scripts, instead. Dieter
participants (5)
-
Chris Beaven -
Dieter Maurer -
Sergey Volobuev -
Tino Wildenhain -
zoper@disturbance.dhs.org