The Capacity Set
[Mirrored from: http://thok.let.rug.nl/~s0760412/hypertext/capacity.html]
In the capacity set, you specify the maximum size of your document.
Before we discuss the details, let us look at a simple example, which
explicitly states several capacities, leaving not mentioned ones
Following is a list of the standard's settings, and a short
explanation. Each item will mention the keyword of a capacity category
and the way it can be calculated. According to the standard, each
capacity is declared the value 35000.
- TOTALCAP is the grand total of individual capacity
- ENTCAP is calculated by multiplying NAMELEN, the maximum
length of an SGML name, by the number of entities.
- ENTCHCAP can be calculated by counting the characters of
- ELEMCAP can be obtainde by multiplying the number of
entities defined by NAMELEN.
- GRPCAP's value is found by counting the content tokens at
any level of a content model (where a data tag group is three tokens)
and multiplying that number by NAMELEN.
- EXGRPCAP is equal to the multiplication of NAMELEN by the
total of exclusion or inclusion exceptions group.
- EXNMCAP is multiplication of, once again, NAMELEN by a name
in an exclusion or inclusion exceptions group.
- ATTCAP is the sum of NAMELEN for each attribute defined
plus NAMELEN for each occurence (whether or not the attribute is
specified) in a link set declaration of an element type associated with
the definition, or, in an entity declaration, of a notation name
associated with the definition.
- ATTCHCAP is equal to counting each character of normalized
length of an attribute value defined as a default value, or explicitly
specified (not defaulted) in a link set declaration or data attribute
- By multiplying NAMELEN by the number of tokens defined in an
attribute value name group or name token group, you get the value of
- NOTCAP is equal to NAMELEN multiplied by the data content
- NOTCHCAP is the number of characters in notation
- IDCAP is established by calculating the value of the
multiplication of NAMELEN by number of ID attributes specified
- IDREFCAP is established by multiplying NAMELEN by the
number of IDREF attributes specified (explicitly or by default).
- MAPCAP is another multiplication of NAMELEN but now by the
total number of short reference maps declared, plus, for each map
declared, NAMELEN for each short reference delimiter in the concrete
syntax (whether or not the delimiter is in the map).
- Multiplying the number of link types or link sets defined by
NAMELEN gives you the value of LKSETCAP.
- And finally, you can calculate the value of LKNMCAP by
multiplying the total number of document types or elements in each link
type or link set declaration.
The above list is adapted from Goldfarb's
book on SGML (to be precise, figure 5 on page 367), I hope he does
not mind me quoting him not quite literally. I had to do this because I
myself do not quite understand each and every capacity category.
Finally, I have to mention the possibility of declaring the capacity
set by a public identifier. Your declaration would then be like the
following: CAPACITY PUBLIC public identifier. The public
identifier states which one will be used.
Well, for those of you who got this far, try the following part on
concrete syntax scope.