httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <>
Subject conditional html
Date Thu, 12 Oct 1995 16:26:00 GMT
My conditional html code is 'finished' and we're testing it now.  After I'm
satisfied it's working fine I'm willing to release it.  However I'm not
sure it'll match everyone's expectations here.  I made some design choices
that were driven by local concerns.

The code doesn't use flex (I found myself using too many states).  It
only uses bison for parsing the expressions.  It does include a new
scanner that should be more efficient than the old find_string -- but I
don't have profiling information on it yet.

Just for interest sake:  I profiled our servers (before the rewrite) and 
the top 3 routines in order were _encrypt, find_string, and rputc.
Unfortunately there's no gprof for IRIX, so this is just flat profile

Included below is some rough documentation.


<title>Conditional HTML</title>
<p>Conditional HTML constructs allow the author to issue different documents
according to the browser used.
The following tags may be placed anywhere within a document:
    <li> &lt;if <i>conditional-expr</i>&gt;
    <li> &lt;elsif <i>conditional-expr</i>&gt;
    <li> &lt;else&gt;
    <li> &lt;endif&gt;
<p>A <i>conditional-expr</i> can use the logical operators <tt>and</tt>,
<tt>or</tt>, and <tt>not</tt>.  Parentheses <tt>(</tt>,
and <tt>)</tt>
may be used for grouping.  The actual terms presently have only one
A <i>property</i> is one of the following:
<p>For example:
    &lt;p&gt;This paragraph will always be present.
    &lt;if supports=tables&gt;
	&lt;p&gt;This paragraph will only be present on browsers supporting
	&lt;p&gt;This paragraph will only be present on browsers which do
	not support tables.

    &lt;if supports=tables and supports=forms&gt;
	&lt;p&gt;Text for browsers supporting both forms and tables.

<h3>Declaring Properties of Browsers</h3>

<p>The properties of a browser are declared in the <tt>httpd.conf</tt> file
used to boot the webserver.  The configuration tag is <tt>UserAgent</tt>
and has the following format:
    UserAgent /regexp/ property1 property2 ...
<p>The <tt>UserAgent</tt> tag can be placed in the global section (for all
servers) or in a particular virtual server section.  The <tt>User-Agent</tt>
header is matched against the <tt>UserAgent</tt> tags in the order
given.  The <tt>/</tt> characters can be replaced by any matching character.
For example:
    UserAgent '^Mozilla/1' tables forms jpeginline images backgrounds
    UserAgent #^Mozilla/2# tables forms jpeginline images backgrounds java
    UserAgent :^Lynx: forms
<p>The regular expressions available correspond to
<a href="">basic
POSIX regular expressions</a>.

<h3>CGI Support</h3>
The environment variable <TT>BROWSER_SUPPORTS</TT> is set to the list of
properties for the user agent.

View raw message