sample SGMLish formatting style sheet from Lector (long)
John Price-Wilkin <jpw@sansfoy.lib.virginia.edu>
Date: Wed, 27 Oct 93 08:23:54 -0400
From: John Price-Wilkin <jpw@sansfoy.lib.virginia.edu>
Message-id: <9310271223.AA05491@sansfoy.lib.virginia.edu>
To: www-talk@nxoc01.cern.ch
Subject: sample SGMLish formatting style sheet from Lector (long)
Reply-To: jpw@virginia.edu
Open Text's Lector, an X-Windows browser for tagged text, uses an sgml-ish
display specification language. I'm including in this an extract from the
spec file we use for our Old English collection, and there's not as much
variety in this as is possible with Lector, but perhaps it will give some
inspiration in the process of creating a stylesheet language.
# Spec file for Old English Corpus
# Font declarations; we used the OED fonts that Open Text created because
# of their better rendering of characters such as thorn.
<Font>
<Name>-oed-times-medium-r-normal--18-*</Name>
<Family>Times</Family>
<Type>Roman</Type>
<Size>18</Size>
</Font>
<Font>
<Name>-oed-times-medium-r-normal--14-*</Name>
<Family>Times</Family>
<Type>Roman</Type>
<Size>14</Size>
</Font>
<Font>
<Name>-oed-times-bold-r-normal--18-*</Name>
<Family>Times</Family>
<Type>Bold</Type>
<Size>18</Size>
</Font>
<Font>
<Name>-oed-times-bold-r-normal--14-*</Name>
<Family>Times</Family>
<Type>Bold</Type>
<Size>14</Size>
</Font>
<Font>
<Name>-oed-times-medium-i-normal--18-*</Name>
<Family>Times</Family>
<Type>Italic</Type>
<Size>18</Size>
</Font>
<Font>
<Name>-oed-times-medium-i-normal--14-*</Name>
<Family>Times</Family>
<Type>Italic</Type>
<Size>14</Size>
</Font>
# Formats; at this point follows a series of <Spec></Spec> declarations
# which are then rendered, under Lector, as menu options for viewing
# the text in various ways. I've removed all but what we call "Standard".
# Other views typically included a shift of font to something smaller or
# larger, a view of the tagged text, sometimes both formatted (according
# to the rules declared in "Standard") and unformatted, and skeleton
# views where most elements except structural headers such as chapter
# titles are turned on.
<Spec>
<Name>Standard</Name>
<PrUndef>off</PrUndef>
<PrText>on</PrText>
<PrTag>off</PrTag>
<Family>Times</Family>
<Type>Roman</Type>
<Size>18</Size>
<Tabs>3 6 9 14 15 18 21 24 27 30 33 36 39 42 45</Tabs>
# when output is fed from PatMotif to Lector, the searched-for
# term is tagged by PatMotif with <MATCH></MATCH>; this next
# little bit highlights the match
<Tag>
<Name>MATCH</Name>
<Highlight>on</Highlight>
<PrText>on</PrText>
</Tag>
<Tag>
<Name>/MATCH</Name>
<Highlight>off</Highlight>
</Tag>
# rendering entity references; in this collection, stripped
# down references such as &t; (rather than þ) are used
<Tag><Name>t</Name><String>&254.</String><Syntax>&;</Syntax></Tag>
<Tag><Name>T</Name><String>&222.</String><Syntax>&;</Syntax></Tag>
<Tag><Name>A</Name><String>&198.</String><Syntax>&;</Syntax></Tag>
<Tag><Name>a</Name><String>&230.</String><Syntax>&;</Syntax></Tag>
<Tag><Name>amp</Name><String>&38.</String><Syntax>&;</Syntax></Tag>
<Tag><Name>Y</Name><String>&51.</String><Syntax>&;</Syntax></Tag>
<Tag><Name>y</Name><String>&51.</String><Syntax>&;</Syntax></Tag>
<Tag><Name>D</Name><String>&208.</String><Syntax>&;</Syntax></Tag>
<Tag><Name>d</Name><String>&240.</String><Syntax>&;</Syntax></Tag>
<Tag><Name>E</Name><String>E</String><Syntax>&;</Syntax></Tag>
<Tag><Name>e</Name><String>e</String><Syntax>&;</Syntax></Tag>
# Generic structural and typographic information
<Tag> <Name>Work</Name>
<Attribute><Name>n</Name><PrVal>on</PrVal>
<BlankLines>1</BlankLines>
<Size>18</Size>
</Attribute>
<PrText>on</PrText><PrTag>off</PrTag> </Tag>
<Tag> <Name>/Work</Name><Restore>Work</Restore></Tag>
# Bib Stuff for title page
<Tag><Name>extent.statement</Name><PrText>on</PrText>
<BlankLines>0</BlankLines></Tag>
<Tag>
<Name>title</Name><PrText>on</PrText><PrTag>off</PrTag>
<BlankLines>0</BlankLines></Tag>
<Tag><Name>publication.statement</Name><PrText>on</PrText>
<BlankLines>0</BlankLines></Tag>
<Tag><Name>citn</Name><PrText>on</PrText>
<BlankLines>0</BlankLines><PrTag>off</PrTag></Tag>
<Tag><Name>/citn</Name><Restore>citn</Restore></Tag>
<Tag><Name>reference.system</Name>
<PrText>on</PrText><BlankLines>0</BlankLines>
<PrTag>off</PrTag></Tag>
<Tag> <Name>/reference.system</Name>
<Restore>reference.system</Restore></Tag>
<Tag> <Name>text.category</Name>
<Attribute><Name>def</Name><PrVal>on</PrVal>
<PreString>Category: </PreString><BlankLines>1</BlankLines>
<Size>18</Size>
</Attribute>
<PrText>on</PrText><PrTag>off</PrTag> </Tag>
<Tag><Name>/text.category</Name>
<Restore>text.category</Restore></Tag>
<Tag> <Name>TEXT</Name>
<PrText>on</PrText><PrTag>off</PrTag> </Tag>
<Tag> <Name>/TEXT</Name><Restore>TEXT</Restore></Tag>
<Tag> <Name>body</Name>
<Attribute><Name>n</Name><PrVal>on</PrVal>
<PreString> </PreString><BlankLines>1</BlankLines>
<Size>18</Size>
</Attribute>
<PrText>on</PrText><PrTag>off</PrTag> </Tag>
<Tag> <Name>/body</Name><Restore>body</Restore></Tag>
<Tag><Name>s</Name>
<BlankLines>0</BlankLines>
<Attribute><Name>n</Name><PrVal>on</PrVal>
<PreString> </PreString><PostString> </PostString>
</Attribute>
</Tag>
<Tag><Name>/s</Name><Restore>s</Restore></Tag>
<Tag><Name>foreign</Name><Type>Italic</Type></Tag>
<Tag><Name>/foreign</Name><Restore>foreign</Restore></Tag>
</Spec>