Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Apache SSI is dumping whitespace all over my HTML

8 views
Skip to first unread message

William Entriken

unread,
Feb 21, 2013, 5:29:52 PM2/21/13
to
I am trying to use SSI for includes and to set some variables, but it is dumping whitespace all over my HTML. Is it possible to avoid this?

HTML FILE:
<!--#set var="header-title" value="Help - Frequently Asked Questions - FAQ" -->
<!--#set var="header-description" value="Answers to common questions about ..." -->
<!--#include virtual="includes/header-basic.htm" -->

INCLUDE FILE:
<!--#if expr="" -->
Variables:
header-title
header-description
<!--#endif -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" />
<head>
...

RENDERED HTML:



<!DOCTYPE... (output starts here after several blank lines)


But I would like to squeeze the whitespace out of the rendered HTML. Is this possible? Also, I used hexdump to confirm I do not have UTF8 BOM in my file.


Thank you,
William Entriken

Ivan Shmakov

unread,
Feb 22, 2013, 4:20:55 AM2/22/13
to
>>>>> William Entriken <fulld...@gmail.com> writes:

[Cross-posting to news:alt.apache.configuration.]

> I am trying to use SSI for includes and to set some variables, but it
> is dumping whitespace all over my HTML. Is it possible to avoid
> this?

> HTML FILE:

> <!--#set var="header-title" value="Help - Frequently Asked Questions - FAQ" -->
> <!--#set var="header-description" value="Answers to common questions about ..." -->
> <!--#include virtual="includes/header-basic.htm" -->

My suggestion would be to try it as follows instead:

<!--#set var="header-title" value="Help - Frequently Asked Questions - FAQ"
--><!--#set var="header-description" value="Answers to common questions about ..."
--><!--#include virtual="includes/header-basic.htm" -->

[...]

--
FSF associate member #7257

William Entriken

unread,
Feb 22, 2013, 2:07:08 PM2/22/13
to
Thank you.

Also, I found a behavior (undocumented?) that allows multiple sets at once:

<!--#set
var="header-title" value="Help - Frequently Asked Questions - FAQ"
var="header-description" value="Answers to common questions..."
--><!--#include virtual="includes/header-basic.htm" -->


0 new messages