This is the mail archive of the docbook@lists.oasis-open.org mailing list for the DocBook project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: marked section control/was: SUBDOC with SGML DocBook?


Hello Bernd,

On Fri, 29 Sep 2000, Bernd Kreimeier wrote:
> I maintain a couple of marked section categories, e.g.
> 
>   <!ENTITY % RFC "IGNORE"> <!-- Draft Only -->
>   <!-- more like these -->
<snip/>
> control the various marked section into a separate
> marks.sgml file that I could generate on the fly, e.g. 
> from a Makefile. 
<snip/>
>   document.sgml
>      <!DOCTYPE Book PUBLIC "-//GNOME//DTD DocBook PNG Variant V1.1//EN"[
>        <!ENTITY   Marks       system  "marks.sgml"  >
>        <!ENTITY   chap1       system  "chap1.sgml"  >
>        <!-- more -->
>      ]>        
<snip/>
> above I can get actual content in the document (&chap1;), but 
> there seems no way to place &Marks; properly, so I must be 
> trying to use the wrong mechanism.

As far as I understood you declare a bunch of parameter entities for later
use in conditional sections in a separate file called marks.sgml. As those
declarations are parameter and not normal (non-parameter) entities you
have to treat them different. Marks.sgml contains DTD declarations in
opposite to chap1.sgml which contains document parts. I tested the
following small example sgml-files against nsgmls:

marks.sgml:
<!ENTITY % RFC "INCLUDE"> <!-- Draft Only -->
<!-- more like these -->

chap1.sgml:
<chapter>
  <title>Conditional Chapter</title>
  <para>baz</para>
</chapter>

document.sgml:
<!DOCTYPE Book PUBLIC "-//Davenport//DTD DocBook V3.0//EN"[
  <!ENTITY % Marks       system  "marks.sgml"  >
  <!ENTITY   chap1       system  "chap1.sgml"  >
  <!-- more -->
  %Marks;
]>
<book>
  <chapter> <!-- just to make document valid in any case -->
    <title>foo</title>
    <para>bar</para>
  </chapter>
  <!-- following a conditional section -->
  <![%RFC;[
    &chap1;
  ]]>
</book>

As you can see, the param entity Marks is declared in the local section
of the DTD: "<!ENTITY % Marks system "marks.sgml"  >" and referenced
"%Marks;" to include the file marks.sgml. This has all to be done within a
DTD declaration. Then in the body of the document the declarations
from marks.sgml and the content from chap1.sgml can be referenced as shown
in the example for a conditional section.

Hope this helps.

Bye,
Steffen.


-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/E d- s++:- a-->?@ C(++++) ULC++++$ P+ L++(+++) E++>+++ W++(--) N+ !o
K? w O- M- V? PS+(++) PE(-) Y+ PGP>+++ t 5 X+++ R* tv(-) b+ DI++ D G>++ e
h* r- y? UF
------END GEEK CODE BLOCK------

  http://rupert.informatik.uni-stuttgart.de/~maiersn/
mailto:Steffen.Maier@studserv.uni-stuttgart.de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]