Next Up Previous Contents
Next: 3.4 Markup minimisation
Up: 3.3 Defining entities
Previous: 3.3.1 Referring to text
[ID index][Keyword index]

3.3.2 Referring to files

A feature of SGML's portability is that it abstracts the notion of files: there are no `files' and `filenames' in the SGML world, only external entities which have public identifiers or system identifiers. You can refer to these external entities as follows:

<!DOCTYPE sun PUBLIC "-//Starlink//DTD Starlink SUN//EN" [
  <!ENTITY chapter1 SYSTEM 'chaptext/chapter1.text'>
  <!ENTITY fig1.eps SYSTEM 'figure1.eps' NDATA eps>
  <!ENTITY fig1.gif SYSTEM 'figure1.gif' NDATA gif89a>
  <!ENTITY sun199 
        PUBLIC "-//Starlink//DOCUMENT Summary SUN/199//EN" SUBDOC>
]>

There are four entities described here.

`chapter1' is a reference to the object with system identifier chaptext/chapter1.text. A system identifier can refer to an object in a wide variety of ways - it could be a database query, or system command - but in the present system, a system identifier is just a filename. When you refer to this entity by making the reference &chapter1; where you might otherwise type text, the SGML system would insert the contents of the specified file in the document at that point. This is a way of breaking your document up into a collection of smaller documents.

The two entities `fig1.eps' and `fig1.gif' are also references to the two files `figure1.eps' and `figure1.gif' - note the distinction between the entity name and the file name. These entity declarations have extra information, however, indicating that their notation is eps and gif87a respectively. The system currently recognises these notations, plus `jpeg'. You would refer to these entities in an attribute of a figurecontent element. For an overview of figure files, see Section 4.7, and for more details and the list of allowable notations, see the figurecontent documetation in Appendix C.1.33.

The last entity above is different in two ways. Firstly, it does not refer to a system identifier, but to a public identifier. The SGML system maps this identifier into a file using some internal database. Note that the reference to the DTD, "-//Starlink//DTD Starlink SUN//EN" is also a public identifier. Secondly, the keyword subdoc indicates that this entity is a subdocument entity - a complete SGML document which the SGML system will have to parse at some point. In this case, the entity sun199 has been declared so that it can be cross-referenced at some point. See Section 4.6 for details.


Next Up Previous Contents
Next: 3.4 Markup minimisation
Up: 3.3 Defining entities
Previous: 3.3.1 Referring to text
[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