On Wed, 13 Jan 1993 18:13:34 CST Peter Flynn said:
>The TEI1.dtd file says:
>
><!ENTITY % ISOLat1 PUBLIC
> "ISO 8879-1986//ENTITIES Added Latin 1//EN" >
><!ENTITY % ISOLat2 PUBLIC
> "ISO 8879-1986//ENTITIES Added Latin 2//EN" >
>
>but when I run SGMLS over this, I get the following:
>
>curia% sgmls SGML.dec curia.dtd teih oengus.html
>sgmls: Error at /tlh/curia/dtds/TEI1.dtd, line 42 in declaration parameter 5:
> Could not find external parameter entity "ISOLat1"
>sgmls: Error at /tlh/curia/dtds/TEI1.dtd, line 44 in declaration parameter 5:
> Could not find external parameter entity "ISOLat2"
>
>I *do* have the required files:
>
>curia% ls -l ISOL*
>-rw-r--r-- 1 pflynn 4296 Dec 1 15:56 ISOLat1
>-rw-r--r-- 1 pflynn 7389 Dec 1 15:57 ISOLat2
>curia%
>
>but SGMLS is probably looking for them in some other directory, at a guess.
>Has anyone any clue as to where it's looking for them (or if it's looking for
>some other filename than `ISOLat1' or `ISOLat2')?
SGMLS is looking for them, all right, but it is using its default
search path for public entities. You need either to place them where
it will find them, or tell it where to look for them.
The short answer is: it's looking for them in one of the following
places (I won't swear to the upper or lower case, but I think this is
how it searches):
/usr/local/lib/sgml/iso_8879-1986/entities/added_latin_1
ISOLat1.vpe
ISOLat1.ppe
and if you want it to look instead only for ISOLat1 and ISOLat2 in the
current directory, you need to set an environment variable with the
name SGML_PATH and the value "%N". You can also do various very clever
things by setting SGML_PATH appropriately, once you understand the
description in the documentation of how its value is processed.
For the really dedicated reader, I append the long answer, as I worked
it out for myself a while ago, facing the same problem Peter is facing.
C. M. Sperberg-McQueen
------
Notes on sgmls handling of search for entities
1 Simple example
Set an environment variable called SGML_PATH to a value. For the
moment, let's assume you set it by saying something like this:
set SGML_PATH %S:%N.%X:%N.%V:%N.%C
The default path (at least on Unix systems) is noted below.
The SGML_PATH environment variable governs the search SGMLS performs for
public entities. Specifically, given declarations like these:
<!ENTITY % ISOLat1 PUBLIC
"ISO 8879-1986//ENTITIES Added Latin 1//EN//Local" >
<!ENTITY % ISOLat2 PUBLIC
"ISO 8879-1986//ENTITIES Added Latin 2//EN//Local" >
<!ENTITY % p2idmss
PUBLIC "-//TEI//ENTITIES Marked sects for TEI P2 IDs//EN"
'p2idlist.entities' >
SGMLS will ask the file system for a series of files, in an order
determined by the SGML_PATH value. The first one found by the file
system is the one used by SGMLS. For ISOLat1:
%S /* no search, no system id given */
%N.%X ISOLat1.vpe /* we are looking for a parameter entity
with a device-dependent version */
ISOLat1.ppe /* if we find no device-specific form,
we use the device-independent one */
%N.%V ISOLat1.LOCAL /* the device-specific form is called
LOCAL */
%N.%C ISOLat1.ENTITIES /* the public text class is
ENTITIES */
For ISOLat2, similarly, substituting ISOLat2 for ISOLat1. For the
other one:
%S p2idlist.entities /* system id */
%N.%X p2idmss.ppe /* no local version, only public */
%N.%V /* no search, no local version specified */
%N.%C p2idmss.ENTITIES /* the public text class is
ENTITIES */
This is as far as I understand things at present; certainly sgmls has
succeeded in picking up isolat1.local, isolat1.entities, isolat1.ppe,
p2idmss.entities, and p2idlist.entities, under appropriate conditions.
2 Tree-structured directories, a more complex example
In a system with tree-structured directories, of course, more of the
public identifier can be used to find stuff. The default path
search for the ISOLat1 would be, as I understand it:
/usr/local/lib/sgml/%O/%C/%T:%N.%X:%N.%D
or
/usr/local/lib/sgml/%O/%C/%T
gives one or the other of the following, I'm not
sure about the case mapping:
/usr/local/lib/sgml/iso_8879-1986/entities/added_latin_1
/usr/local/lib/sgml/ISO_8879-1986/entities/Added_Latin_1
%N.%X
gives ISOLat1.vpe, then ISOLat1.ppe
%N.%D
appears to give nothing (I don't think there is a
data content notation given here)
3 Overview of public identifiers and sgmls substitution fields
For the record, the overall structure of formal public identifiers
is:
pubid ::= owner '//' class ('-//')? desc '//' lang ('//' version)?
owner ::= 'ISO' data | '+//' data | '-//' data
class ::= CHARSET | ENTITIES | DTD | DOCUMENT | etc.
desc ::= data
lang ::= /* code from ISO 639 */
| 'ESC' n/n n/n
version ::= data
The components of the publid identifier are picked up by different
'substitution fields':
%P the entire public ID?
%O the owner name (minus the '+//' and '-//')
(%I, %R, and %U can be used to ensure that a search
pattern only succeeds for ISO owners, registered owners,
or unregistered owners; they expand to the empty string
in the appropriate case, and to null (failure) otherwise)
%C the class
%T the description of the public entity
%L the language code (EN, FR, etc. from ISO 639)
%E the character set escape sequence
%V the version descriptor
Various types of case folding and character substitution or character
deletion are performed, which should be described in the documentation
for the version of sgmls you are using (they are set at compile time,
and differ in the Unix, VMS, and DOS versions, to suit the operating
systems).
Still other substitution fields pick up other parts of the entity
declaration:
%D the entity's "data content notation". I am not sure, but believe
what is meant by this is the notation name given for an external
entity declared as being in a specific notation. In the
declaration <!ENTITY file3 system 'file3.tiff' NDATA tiff>
the name 'tiff' is the notation name.
%N the entity name (the name used in references to this entity)
%P the public identifier (the whole string, it appears)
%S the system identifier (i.e. in <!ENTITY foo system 'bar.doc'>
the string 'bar.doc')
%X a string chosen from a rather complex table, depending on
whether sgmls is searching for a data entity, subdocument entity,
general text entity, parameter entity, dtd, or lpd, and on
whether it is declared without a public identifier, with a
public identifier, with a device-dependent version string or
without one
%Y a string chosen from a simple table depending on whether sgmls is
searching for a subdoc entity, a data entity, a text entity,
a parameter entity, a dtd, or an lpd
%A causes the search to fail if the formal public identifier
contains an 'unavailable text' indicator
|