SGML: TEI P3 DTD and RulesBuilder or mkrls

TEI P3 DTD and RulesBuilder or mkrls

From owner-tei-l@LISTSERV.UIC.EDU Tue Jun 17 11:05:00 1997
Date:      Tue, 17 Jun 1997 10:34:19 CDT
Reply-To:  lee@SQ.COM
Sender:    "TEI (Text Encoding Initiative) public discussion list"
              <TEI-L@LISTSERV.UIC.EDU>
From:      lee@SQ.COM
Subject:   Re: Problems with DIV2 tags
To:        TEI-L@LISTSERV.UIC.EDU

 -----------------------------------------------------------------------

Lou Burnard <lou.burnard@computing-services.oxford.ac.uk> wrote:
[...]

> I don't believe RulesBuilder or FrameMaker will handle DTD subsets in
> the way you want. The solution I generally recommend people is to
> pre-process the dtd into a single non-indirected (?!) form with a tool
> such as Richard Light's dtd normaliser.
> ftp://ota.ox.ac.uk/pub/ota/TEI/software/normdtd1.exe

For use with RulesBuilder or mkrls (the batch version of Rulesbuilder),
you can do the following:

(1) take the subset from your document -- except the actual DOCTYPE
    line, e.g.
        <!DOCTYPE TEI.P2 PUBLIC ..... [
            all this bit
        ]>
    and put it in a file I shall call Priscilla.dtd

(2) append to this the following two lines:
    <!Entity % Priscilla.rest PUBLIC ......>
    %Priscilla.rest;

    where the ..... are the same as the DOCTYPE line in your DTD.

(3) compile Priscilla.dtd, using the TEI sgml declaration file,
    giving rulesBuilder the same DOCTYPE element that you've got on
    your DOCTYPE line in the instance (TEI.P2 in my case),
    and the PUBLIC and SYSTEM identifiers from the same DOCTYPE line.
    Call the rules file teip3.rls (for example)

    If there are errors about undefined elements, define them by
    appending to the bottom of Priscilla.dtd -- for example, if
        "Element ANKLE is referenced but not defined"
    you'd add
        <!Element Ankle - - (#PCDATA)>
    at the end of Priscilla.dtd, after the %Priscilla.rest; line.

        Brief But Pedantic Explanation:

        These elements are perfectly legal in SGML, as long as they are
        not actually used in the document, but only referenced in the DTD.
        Unfortunately, since Author/Editor doesn't know which elements
        you're going to insert, RulesBuilder disallows this construct,
        so we have to define the elements, in case you insert them by
        mistake later, with rules checking turned off.

(4) import the instance into Author/Editor using yur new rules file.

    If there are errors, you may have to delete the contents of the
    prolog -- from the [ up to the matching ] -- being careful to leave
    the closing > in place, so your DOCTYPE declaration ends up as a
    single line,
        <!DOCTYPE TEI.P2 PUBLIC .....>

    You'll only have to do this if
    (a) you include other files or DTD fragments in the prolog;
    (b) you define SGML elements in the prolog;
    (c) the wind is howling and the moon is full.


Lee

--
Liam Quin, lee@sq.com         | lq-text freely available Unix text retrieval
Senior Technical Consultant   | FAQs: Metafont fonts, OPEN LOOK UI, OpenWindows
SoftQuad Inc. +1 416 544-9000 | xfonttool (Unix xfontsel in XView)
http://www.softquad.com/      | the barefoot programmer