Re: i'm sure the answer's here somewhere
Lennart Staflin <[email protected]>
| Newsgroups | gmane.emacs.psgml.user |
|---|---|
| Message-ID | <[email protected]> |
On onsdag, september 25, 2002, at 07:28 , Robert P. J. Day wrote:
>
> just getting rolling with PSGML, and i'm curious -- i'm starting
> to create a manual for which the man page will do little more than
> refer to a DOCTYPE and include entities for the chapters.
>
> but if one does this, one does not have additional DOCTYPE
> statements in the included entities. so how do you validate
> against a DTD if there's not DTD listed in the actual text file?
>
> like i said, i'm sure it's obvious, i just didn't see it yet.
>
The short answer is that you can only validate a whole document and not
a part of it in separation.
You will notice that DOCTYPE specifies the top level element and if your
part contains one whole element (like your chapter) then you can
construct a DOCTYPE with that element as top level element and prepend
that to your part file. For nsgmls you can put the doctype in a separate
file and give both files to nsgmls.
BUT: SGML has some context sensitive aspects, a chapter inside a Book
element is not necessary identical to a chapter in some other context.
IIRC it is inclusions, exclusions and short references that is context
sensitive. They are sort of inherited from the context. A DTD might be
designed to work with selected elements at top level, and might not work
well with other elements.
PSGML can edit these part files and establish the context if you set up
a buffer local variable 'sgml-parent-document'. You can do that using
Emacs' local variable section in a comment at the end of the file:
<!--
Local Variables:
sgml-parent-document:("mybook.sgml" "BOOK" "CHAPTER")
End:
-->
Where "CHAPTER" (case is significant) is the top element in the file and
"BOOK" provides context.
//Lennart
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf