W3C home > Mailing lists > Public > www-style@w3.org > August 1997

Re: Context Selectors and SGML

From: Paul Prescod <papresco@technologist.com>
Date: Mon, 18 Aug 1997 18:00:28 -0400
Message-ID: <33F8C5FC.B24D99F1@technologist.com>
To: www-style@w3.org
Neil St.Laurent wrote:
> I find it kind of interesting that CSS let's one distinguish
> presentation based on this type of context model and that SGML itself
> doesn't make any distinction above a single level of context -- ie:

This is not true for a couple of reasons. First, there is the SGML
inclusions/exclusions feature that allows you to express some context
sensitivity. This is used for INPUT in FORM in HTML. 

Second, you have to think carefully of the difference between a markup
language and the applications that are built upon that markup language.
If SGML "did not allow context distinctions" then HTML and CSS, which
are built on top of SGML could not make those distinctions. In fact,
context sensitivity is SGML's "claim to fame". Context sensitivity is a
major part of what we mean when we talk about a "structured markup
language" unlike something like, say, LaTeX which does not really
maintain information about nesting. SGML tools constantly depend on
context distinctions. DSSSL has an entire language (Standard Document
Query Language) dedicated to making context distinctions.

Third, there is the SGML LINK feature which is highly context-sensitive
but seldom used because context sensitivity in a markup language just
isn't as useful as you might think it is. You need the context
sensitivity in TOOLS not the markup language. I haven't yet seen a
persusasive case of markup that required complicated context sensitivity
(in, e.g. content model choice or attribute value choice).

> Now I suppose this could have gone to the html list as well, but are
> there any markup languages that truly distinguish content based on
> context -- this would help solve problems like <INPUT> outside of a
> <FORM>.

Please describe the problem and how context-sensitivity would help.
> It'd also sort of allow things such as:
> Property: display
> Value: variant
> Where it's variant such that if an inline element is allowed then
> it's inline, otherwise it's block-level.
> This would provide a better quoting mechanism, consider:
> <P>And then Bert said <Q>Inline quoting would be good</Q>, but Chris
> was quick to retort:</P>
> <!-- note we're at block-level now-->
> <Q>I can't image the headache that would give to the browser
> implementators!</Q>

This is simple to implement in SGML+DSSSL. You are ascribing a
shortcoming of CSS (if in fact it is one) to SGML.

 Paul Prescod
Received on Monday, 18 August 1997 17:59:57 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:44 UTC