Next Up Previous Contents
Next: 3.2 Entity references
Up: 3 Marking up your document
Previous: 3 Marking up your document
[ID index][Keyword index]

3.1 Sample document, and overview

A sample SUN is illustrated in Figure 2.

<!DOCTYPE sun PUBLIC "-//Starlink//DTD Starlink SUN//EN">
<title>The Starlink SGML set
<author email='norman@astro.gla.ac.uk'
        webpage='http://www.astro.gla.ac.uk/users/norman'
        affiliation='University of Glasgow'
        id=ng
        >Norman Gray
<docnumber>1234
<history>
  <version number=0 date='21-APR-1999' author=ng>Initial version
</history>
<abstract>
  This is a sample SUN
</abstract>

<sect id=intro export>Introduction
<p>Starlink SUNs are easy to write.

Figure 2:

A simple sample SUN

Features to note:

<sun>
<docinfo>
<title>The Starlink SGML set</title>
<authorlist>
<author email="norman@astro.gla.ac.uk" webpage="http://www.astro.gla.ac.uk/users/norman" affiliation="University of Glasgow" id="ng">Norman Gray</author>
</authorlist>
<docnumber>1234</docnumber>
<history>
<version number="0" date="21-APR-1999" author="ng">
<px>Initial version</px>
</version>
</history>
</docinfo>
<docbody>
<abstract>
<px>This is a sample SUN</px>
</abstract>
<sect id="intro" export>
<subhead>
<title>Introduction</title>
</subhead>
<p>Starlink SUNs are easy to write.</p>
</sect>
</docbody>
</sun>

Figure 3:

A SUN document with all tags in place, the normalised version of the document in Figure 2.

In Figure 3, note that the actual content of the abstract element is one or more px elements (a slightly restricted variant of the standard p paragraph element), and that the sect element contains a subhead element, and contains the paragraphs which constitute it (note that this is a significant difference from HTML, where the heading elements hn contain only a section title). You will rarely have to be aware of these `hidden' tags when you are creating a document, but it will occasionally be useful to know that these tags are there somewhere, and that you're glad you don't have to type all of them. In fact, when I explain the document structure below, I will do it in terms of the elements which are `really' there.

`Markup minimisation', which is SGML's name for this, was introduced to SGML to make typing less onerous. Personally, I like this, since it seems to make the document look less cluttered, and so I have designed the DTD to support this quite extensively. The minimisation is completely optional, however, and you may insert all the tags if you prefer. SGML-aware editors (see Section 6.5) typically insert all tags. See also Section 3.4. XML omits this markup-minimisation feature.

You can see from Figure 3 that the `top-level' element of this document is sun. The top-level element of SSN documents is ssn, and similarly for the other Starlink document types (see Section 4.1). These different document types are broadly the same, but the SSN document type does not, by default, include elements for documenting programming code, and the MUD document type has a docdate element instead of a docnumber and a history. A particular document can re-enable such omitted features using the mechanism in Section 4.1. The SUN document type is the most general. The top-level sun element has only two `children', docinfo, which contains the document information such as its author, number, and so on, and docbody, which contains the actual content of the document.


Next Up Previous Contents
Next: 3.2 Entity references
Up: 3 Marking up your document
Previous: 3 Marking up your document
[ID index][Keyword index]
The Starlink SGML Set
Starlink System Note 70
Norman Gray, Mark Taylor
21 April 1999. Release DR-0.7-13. Last updated 24 August 2001