velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Colson" <>
Subject RE: requesting some visual improvment to parsing output
Date Tue, 27 Nov 2001 15:45:36 GMT
With apologies to Christoph as I can't recall the exact details of his
previous proposal (and I'm too lazy/busy to search right now), I'd like to
just mention an alternative used in another system that I thought worked ok.
This isn't meant to be a recommendation or proposal - just one more way it
could be done. ;-)

Newlines/spaces were included in the parsed template output.
(If you typed it, the engine expected that meant you wanted it.)

For sections where extra whitespace is not desired (for example, a chunk of
commands like in Christoph's dump.vm) a directive is inserted to turn off
extraneous output.

Pseudo Example: space.vm
     This line
     has  #if($foo)$foo#end
     important whitespace.
## Stuff happens here and we want to gobble all whitespace
  #if( $type.startsWith("java.lang.") )
     #if( $type == "java.lang.String" )
         #set( $out = "String Thingy" )
         #out ("Thing is of type $out.<BR>")
<PRE>  $type   =$out</PRE>
Note how an explicit output directive also exists so that chunks of
formatted code can still print output.

As I said, this is just a different option - not an endorsement.

BTW - didn't want to tell above, lest some of you might ignore on principle,
but the 'system' was Cold Fusion. ;-)

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message