[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SGML question
- To: Gerard Beekmans <>
- Subject: Re: SGML question
- Date: 15 May 2000 08:58:24 -0300
- In-Reply-To: Gerard Beekmans's message of "Sat, 13 May 2000 16:01:33 -0400"
- Resent-Date: Mon, 15 May 2000 07:58:52 -0400 (EDT)
- Resent-Message-ID: <GsnCGC.A.G8E.oZ-H5@murphy>
- User-Agent: Gnus/5.0806 (Gnus v5.8.6) Emacs/20.4
Gerard Beekmans <firstname.lastname@example.org> writes:
> Suppose I have the following entity:
> <!ENTITY chapter1 SYSTEM "textblock.sgml">
> Chapter 1 of the book calls this file with a &textblock;
> Chapter 2 also uses this block but that block needs to be modified a bit
> (it's the installation of the same program, but a different procedure
> for a different platform. It has an extra paragraph or two).
> To avoid copy/pasting it literally I want to use &textblock; in both
> files (chapter1.sgml and chapter2.sgml) but when it's called in
> chapter2.sgml it should have an extra paragraph. Can I mark a section in
> the textblock.sgml file which is only displayed when the calling file is
> chapter2.sgml or when called with an extra parameter or something like
> If not, then I just have to split up textblock.sgml in two files
> textblock1.sgml and textblock2.sgml. In chapter1 I include the files
> and in chapter2.sgml
> <para>Here a few extra lines</para>
> The latter option isn't too bad to do, but I'd prefer to enable a
> Anybody got some suggestions how to proceed? thanks in advance.
I have. Sorry for quoting all the message but I think it's interesting
for archiving purposes.
In your main file:
<!doctype .... >
<!entity % chap2extra "IGNORE">
In "textblock.sgml" do this:
(now the paragraph that will be shown in chapter2)
<para>This paragraph will be shown only if chap2extra's value is
At the beginning of your chap2.sgml, put:
<!entity % chap2extra "INCLUDE">
And the extra paragraph will be there.
Another solution is to include parts of SGML documents, based on their
IDs. IIRC, you need to:
<!entity partialchap1 SYSTEM "chapter1.sgml#thisid">
and this element and all it's child elements will be included at your
document. This is good for documentation reuse (I imagine a file with
lots of licenses --- actualized by your legal department --- and you
only choose which license you'll be using).
If you have any problems, please write me and I can try helping you.
Departamento de Publicações
Publishing Department Conectiva S.A.
To UNSUBSCRIBE, email to email@example.com
with a subject of "unsubscribe". Trouble? Contact firstname.lastname@example.org
- From: Gerard Beekmans <email@example.com>