🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.sgml
Article #142

Re: HELP: STAGO space problem

#142
From: Erik Naggum
Date: Thu, 06 Aug 1992 01:50
58 lines
3911 bytes
SGML is among the very few markup languages that try to stay out of the
way of the author, and this can be seen in the small number of special
characters and character sequences which is treated as markup in an SGML
document.  (I assume the reference concrete syntax in the following
description.)  First, an author only needs to know that "<" and "&" can
be special.  Significantly, these are not national language characters
in any ISO character set (unlike the reverse solidus ("backslash") in
*roff and *TeX, and commercial at ("at-sign") in Scribe).  Second, "<?"
is always special, "<!" is special if followed by a name start character
(letter), "--" (comment delimiter), ">", or "[" (marked section), while
"<" and "</" are special only if followed by a name start character
(letter), "(" or ">".  Significantly, a "<" followed by white space or
digits is _not_ special, and an author is thus relieved of having to
remember silly ways to get around SGML in running text.  The "&" is
special if followed by a letter, or by "#" and a letter or digit, and is
otherwise just the ampersand.

To put it another way, a "<" is a STAGO only when followed by a letter
or ">" (TAGC).  The sequence "< " is not a STAGO, but the data
characters "<" and " ".  This means that "<" in "foo < bar" is data, as
should be expected, while in "foo<bar" it is treated as markup (and
potentially an error).

A good way to deal with these seemingly complicated rules, is to
consistently use space around "<" and "&", and this is a good habit to
get into regardless of whether you're using SGML or not, as it aids
readability very significantly where they are used as symbols.  Note,
also, that "<<" and "&&" are seen as one data character followed by a
potential markup character, so such strings can safely be used if a
space is left around them.

If something that claims to conform to ISO 8879 SGML reports an error
when it sees a "<" followed by a space, then its claim to conformance
and/or the error message is bogus.  Lots of things out there are
"SGML-like" in several aspects, but things like delimiter recognition is
important to get right to be "real" SGML.  It also is not difficult to
handle, it's only a tad unusual to programmer types that a character
isn't always special.  (Those who have to write in troff, LaTeX, or TeX
know that it can be a real pain that some characters are special all the
time, if only to produce an error of some kind, and have to be escaped,
sometimes several times, to become "themselves".)

It's not clear from your message what kind of application you're talking
about.  (I didn't find anything corresponding to the phrase "the
following application" in your message.)  Could you elaborate?

Hope this helped more than it confused.  See subclause 9.6 Delimiter
Recognition in ISO 8879 (pp 357ff in Goldfarb: The SGML Handbook, which
also talks about delimiter recognition in more readable language) for
the specifics.

Best regards,
</Erik>
--
Erik Naggum             |  ISO  8879 SGML     |      +47 295 0313
                        |  ISO 10744 HyTime   |
<erik@naggum.no>        |  ISO 10646 UCS      |      Memento, terrigena.
<enag@ifi.uio.no>       |  ISO  9899 C        |      Memento, vita brevis.
Technical Details
Message-ID: <23274B@erik.naggum.no>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!hermes.chpc.utexas.edu!news.utdallas.edu!corpgate!bnrgate!stl!uknet!mcsun!sunic!aun.uninett.no!nuug!ifi.uio.no!SGML
References: <1992Aug6.105115.1680@gp.co.nz>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!hermes.chpc.utexas.edu!news.utdallas.edu!corpgate!bnrgate!stl!uknet!mcsun!sunic!aun.uninett.no!nuug!ifi.uio.no!SGML
From: SGML@ifi.uio.no (Erik Naggum)
Newsgroups: comp.text.sgml
Subject: Re: HELP: STAGO space problem
Summary: "<" followed by a space is data, and is not recognized as
  markup, because if it were markup, it would only be an error.
Keywords: SGML delimiters-in-context
Message-ID: <23274B@erik.naggum.no>
Date: 6 Aug 92 01:50:20 GMT
References: <1992Aug6.105115.1680@gp.co.nz>
Organization: Department of Informatics, University of Oslo, Norway
Lines: 53