httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (David Robinson)
Subject Re: #echo and (none)...
Date Tue, 21 Nov 1995 19:20:00 GMT
>        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,

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;

  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'


View raw message