httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@ast.cam.ac.uk (David Robinson)
Subject Re: enhancement (fwd)
Date Fri, 01 Dec 1995 17:41:00 GMT
Dean wrote:
>It was me working on it, but I wasn't sure that you folks liked the
>way I did it.  I went with:
>
><if expr>
><elsif expr>
><else>
><endif>
>
>example:
>
><if supports=tables>
>    do something with a table
><else>
>    do something with <pre> </pre>
><endif>
>
>expr can have and, or, not, (, and ).
>
>The properties for 'supports=' are defined in the configuration file
>something like this:
>
>UserAgent /^Lynx/ no_images
>UserAgent #Mozilla/[1-9]# tables
>
>I'll respond to him anyhow and Bcc here.

Unfortunately, by using elements like this, you are invading HTML's element
name space. If only HTML had defined elements beginning x- to be for the
user's use...

Anyway, an SGML solution to this problem exists; multiple document
descriptions. You can have a document parsable using two separate
element descriptions, say HTML which describes the formatting, and
SPML which describes the server-parsed interpretation. These represent
two 'views' of the document, and need not correspond at all.

You then preceed the element name with the document type in parentheses.
e.g.

  <(spml)if accept="foo">
  <(html)h1>A foo
  <(spml)else>
  <(html)h1>An html
  </(spml)if>
  title</(html)h1>

i,e. the spml and html elements do not have to nest together.

If an element exists in both DTDs, then you can omit the type name.
So, if you notionally say that SPML contains all of HTML (of course, the
server doesn't have to parse the HTML tags), then you could have

  <(spml)if accept="foo"><h1>A foo title</h1>
  <(spml)else><h1>An html title</h1>
  </(spml)if>

This is actually more compact that <!--#if ... -->, and it's totally clear
where the extra tags go.

 David.

Mime
View raw message