Mailing List Archive

#echo and (none)...
mod_include.c, handle_echo() works so that a comment like:

the value of FOOBAR is <!--#echo var="FOOBAR" -->

will actually print out:

the value of FOOBAR is (none)

where the '(none)' is hard coded, and indicates that FOOBAR has not been
set. I've not noticed this behaviour before (I mean, I've never tried
printing out a var that I didn't know to be really there) and I wonder
how helpful it really is. As it stands we can't play the trick:

<!--#echo var="HEADER" -->
blah, blah, blah....
<!--#echo var="FOOTER" -->

which only includes the values of $HEADER, $FOOTER if they've been
defined and otherwise prints "", it's a bit like a contitional include.
This example might let you define server-wide headers and footers for
your pages, albeit in a slightly crusty way.

Does anyone *rely* on the '(none)' value being printed if the var is unset?

Just curious,
Ay.
Re: #echo and (none)... [ In reply to ]
On Tue, 21 Nov 1995, David Robinson wrote:
> Maybe instead we should use the existing SGML syntax for entities, i.e.
> &{name}; includes the text identified by {name}. Entities could be defined
> in the config files, or maybe also in the document itself;
>
> e.g.
> srm.conf/.htaccess:
> Entity footer "my footer"
> Entity header System "head.shtml"
> or xxx.shtml:
> <!ENTITY footer "my footer">
> <!ENTITY header SYSTEM "head.shtml"
> &header; &footer;
>
> Would output the contents of head.shtml followed by `my footer'

So essentially you're asking us to do browser developer's work for them.
:) I can't wait until an HTML browser comes along which will understand
<!ENTITY> references - sigh. I guess in the short term, that's an
interesting idea.

Brian

--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
brian@organic.com brian@hyperreal.com http://www.[hyperreal,organic].com/
Re: #echo and (none)... [ In reply to ]
> the value of FOOBAR is <!--#echo var="FOOBAR" -->
>
>will actually print out:
>
> the value of FOOBAR is (none)
>
>where the '(none)' is hard coded, and indicates that FOOBAR has not been
>set. I've not noticed this behaviour before (I mean, I've never tried
>printing out a var that I didn't know to be really there) and I wonder
>how helpful it really is. As it stands we can't play the trick:
>
> <!--#echo var="HEADER" -->
> blah, blah, blah....
> <!--#echo var="FOOTER" -->
>
>which only includes the values of $HEADER, $FOOTER if they've been
>defined and otherwise prints "", it's a bit like a contitional include.
>This example might let you define server-wide headers and footers for
>your pages, albeit in a slightly crusty way.
>
>Does anyone *rely* on the '(none)' value being printed if the var is unset?
>
>Just curious,
>Ay.

Maybe instead we should use the existing SGML syntax for entities, i.e.
&{name}; includes the text identified by {name}. Entities could be defined
in the config files, or maybe also in the document itself;

e.g.
srm.conf/.htaccess:
Entity footer "my footer"
Entity header System "head.shtml"
or xxx.shtml:
<!ENTITY footer "my footer">
<!ENTITY header SYSTEM "head.shtml"
&header; &footer;

Would output the contents of head.shtml followed by `my footer'

David.