Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Blank Lines In Generated HTML Pages
jamesk
Any templated generated pages i build are created with blank lines in place of the iw_tags and iw_perl tags in my code.
Does anyone know of a way of removing all blank lines from the default output buffer.
I am getting large files and would like to compress the source code where possible
thanks in advance
Find more posts tagged with
Comments
Migrateduser
Odds are, your blank lines are caused by carriage returns you are putting into your TPL file at the beginnings and ends of your <iw_****> tags. For instance:
<p>some HTML</p>
<iw_perl><![CDATA[
#...lots of Perl here
]]></iw_perl>
<p>more HTML...</p>
The above will cause a blank line (or two) in the output stream, whereas
<p>some HTML</p><iw_perl><![CDATA[
#...lots of Perl here
]]></iw_perl><p>more HTML...</p>
The above won't. The first is easier to read in the code, but sometimes it's better to squash things together.
bw
Bob Walden [bob.walden@interwoven.com]
Interwoven Education Group
IM: Yahoo, MSN bob_walden
jamesk
ok thanks for reply.
ive realised that the tags are causing the blank lines. I just wanted to know if there was a way of removing them automatically before the page is generated. I really dont want to make my code unreadable just to solve this.
thanks again
bagman
I've been wanting to do the same thing. I end up with a lot of blank lines at the beginning of my generated pages and some XHTML validators don't like it.
I'm not sure, but I think you can kick off a script after the generation to rewrite the generated page stripping out the blank lines. Or, call the script when submitting to staging.
Mark
pradeep1
You can use the "iw_ostream" tag in the TPL and write the output to a buffer. You can then do a find and replace of all blank lines(and even some fancy formatting) before you write the buffer to the output file. It works very well.
gzevin
or.. if it annoys you guys so much, you could remove the \n form your .tpl in the editore of your choice - I did it a few times. The code will becomes unreadable, but I did it when the coding was done
)
Greg Zevin
Independent Interwoven Consultant/Architect
Sydney, AU