The people defining what was called a Standard Generalized Markup Language,
SGML, they took over the pointy-bracket notation and actually used it within
documents themselves. It leads back into computer science principles in so many
many ways and there has been so much confusion. So I suppose you could say what
this episode is about is: SGML, HTML, XML -- what's the difference?
Or are they all the same? No! They're not all the same.
Way back in the late 1970s, early 1980s, a team at IBM
led by a man called Charles Goldfarb -- who was trained as a lawyer -- came up with the
idea that it would be really useful to be able to put tags into documents to
say what the component parts of the document were, like for paragraph
which is now so familiar to us from HTML as
and they came up with this whole
notation for tags -- that's what it comes down to. It was a tagset notation. People
who see the advantage of this -- particularly if you had a huge
collection of documents that were just crying out to be structured -- and there
are quite a few of those. It could be marriage records, it could be
specifications of stuff owned by the Department of Defense and indeed some of
the earliest users ofp this tagset technology, and SGML, was the Department
of Defense and a thing called the Text Encoding Initiative and they were just
going to tag up everything in the world, that they could see, with a suitable tag set,
to make it easier to access and to locate what you wanted if it was in a
big database. So that was the overall idea of it but in order to show you how
this SGML worked let's start straight away with something very simple. Here is
a sample memo. There is a 'To'
part - it's been sent to Tony Blair. This is way back in the early years of this
century around about the time of the Iraq war, I think, is this fictitious memo. It is from the White
House. The message is as follows and it says: "The President says; 'Thanks for your support!' "
Simple as that. So there's a 'To' and a 'From' and a 'Body' - a message body. Now as computer
scientists we realize straight away that even if it's just a sequence you can
still present it as a left-to-right structure within a tree. So here's a
structured tree representation
of what we've just informally written down. The whole thing - look at the top - is
a Memo. And when you look below, in the tree it says: "Ah! obviously a Memo is a
sequence of a 'To' part followed by a 'From' part, followed by a 'Body' part. Great!"
Within the 'To' part there's just some text, It says "Tony Blair". The 'From' part - more text
it's from "The White House". 'Body' part
- I've deliberately made this a little bit more complicated. I've said that the 'Body' part
can be, if you like, just a single paragraph - a and within the there
could be arbitrary mixtures of plain text
"The president says" or marked quotations because what I'm going to do is to say
that thing that was in quotes is an example of a quotation, so that if in
future Sean were to say to me: "Go through all our memos and dig out the bits
that are quotations, or quoted speech", then because it's tagged and marked it's so much
easier to pick out, of course. From that tree, then, how does that translate into
SGML notation? Don't panic it's very, very similar to what you're now familiar with
as XML notation. Right! Here is a tag that says this whole thing is a Memo and
this is where it begins. The tag - it's to Tony Blair, but being a good boy I must
remember to end the tag. the White House, end of the part. Here comes
the . Now I typeset the thing,
previously, as the word "Message" but this is just to illustrate that if you're
crawling all over this spec. with a typesetting engine
you could take the decision that every time I see the word 'Body' as a tag, I
actually put out the typeset thing saying 'Message'. I could have said 'Body' but
the tags themselves can trigger typesetting and stylistic decisions, if
that's what you want to do. So here we come then: here's the body of the Memo
and, like I said, it's got to be a paragraph denoted with a .
Here's the free text that I'm allowed: "The President says", and here is the nested
quote inside the paragraph, denoted with a tag: "Thank you for your support!" end
of quote, end of paragraph, end of Memo. Now some of you,
eagle-eyed, will immediately be dashing to the Comments on this video, right now,
hold on!, and will say: "You missed out the tag !". To which the answer is: "Yes
SGML allowed you to do that so long as you warned it, in the spec. that goes behind
this -- of the legal tags. If you said "I will optionally make be omittable",
then the biblical handbook here says:
"You may specify that you want certain end-tags to be omittable, provided that
doing so will not lead to ambiguity". And therein lies a complete nest of vipers.
But in this particular case it's all right, you could put in and replace .
Why did they do this? Well, in Charles Goldfarb's era you have got to remember
disk space was massively expensive and -- this sounds stupid but it isn't -- every
single saved end-tag all added up to so many hundred kilobytes that you didn't
need because it could be assumed and safely replaced you hoped. So, you know, they
were not off their heads, they were trying to save disk space.
Here's where we have to try and choose our words very carefully and say what
you're allowed to say and what youre not allowed to say, in terms of building
out of this SGML technology. So let me begin with the bedrock and when I
say SGML technology don't forget what I mean. It's basically -- SGML
is like specifying the 'punctuation'. It's saying have any tag you like but the
'punctuation' around it is pointed brackets. So here's our bedrock. On top of this, using
SGML notation I've devised a MEMO language. So remember, the right way to say this is
that MEMO is an *application* of SGML. In other words it "uses the technology of".
You must NOT say that "MEMO is a subset of SGML", because they're different things. SGML
is a meta-notation; MEMO is a specific tagset. And just to tell you
I wasn't alone, way before me, in the 1980s there was an
initiative within the US Department of Defense and I think it was to do with
requisition and stores and stuff like this. I've even forgotten what the acronym
refers to now. CALS was one of the earliest applications, very big, of
SGML. They thought it was great. Being able to tag things with what they are and what they mean. There was also a more
scholarly initiative, called the Text Encoding Initiative [TEI]. I mean one can
imagine there's no end of literature ... "Is this an example of the early-medieval
subjunctive?" You tag it up to say "Yes it is". Everything was hunky dory. Document
professionals thought this was wonderful. When computer scientists shouted at them
basically saying "You shouldn't have allowed omitted end-tags. You've no idea the grief
you will get into"
The answer, I think, to that is: if you're careful, and if you take advice, you
can avoid the grief. But in a closed world of document professionals, where very
few people see the markup, this is all right. Then in the early 1990s
Oh boy! did something happen that really blew it all wide open and
led to a much wider adoption of SGML. A certain Tim Berners-Lee came along, in
the early 1990s -- I think it was about 1992 when it was first revealed to an
unsuspecting world, and Tim said: "I like this SGML and for these Web pages, rather
than invent my own tagging meta-notation, I'll use the pointed-bracket notation of SGML".
But it was massively, massively successful. "Yeah, it's great!, Pointy-bracket notation! Specify our pages! Get 'em all out there!" Well, the weaknesses in HTML, first of all
because it didn't have a document type definition to say what was optionally
omissible and what wasn't, Tim had a certain view about .... well, for example "end of para"
Even nowadays, in an XML-compliant browser, it's not going to refuse to show
your page because you go from to another
without formally closing off the first para. It just says: "Oh! I've hit another ; I'm already
in the middle of a . I think I'd better close off the one I'm doing. Go into
another one. Fine. But there were far worse problems than that and they really, really came
home to roost within the first 18 months. In 1994 there was a meeting -- I was there --
at Edinburgh, where all of this came out into the open. A full furious frank
discussion took place about what was wrong with HTML, could we ever put it
right? This has to be another story.