This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
DocBook-XML and conditional sections
- To: docbook at lists dot oasis-open dot org
- Subject: DOCBOOK: DocBook-XML and conditional sections
- From: Stephane Bortzmeyer <bortzmeyer at debian dot org>
- Date: Tue, 28 Sep 1999 08:49:31 +0200
- cc: bortzmeyer at debian dot org
- Reply-To: docbook at lists dot oasis-open dot org
[Please Cc: me replies, the turnaround time of the list is a bit slow for me.]
My documentations in DocBook-XML begin to grow and I would like to
conditionalize them, for instance for different software versions. in SGML, I
would write:
<![ %version2.1 [
<para>This is for the version 2.1.</para>
]]>
<![ %version2.2 [
<para>This is for the version 2.2.</para>
]]>
Since conditional sections, in XML, can be used in the DTD only, what can I do?
1) A non-SGML solution: Using a preprocessor like M4. This will make
operations like validation more complicated and it will certainly confuse
Emacs' SGML mode.
2) A DocBook-customization solution: Creating new elements <version2.1> and
<version2.2> and write a custom stylesheet (I use DSSSL) which will
(process-children) or not, depending on a variable I give. The problem is that
I would like to have them in many places, because I want to "conditionalize"
entire sections, paragraphs, bits of paragraphs, etc. I tried to write a
custom DTD with such elements and it is far from obvious.
3) Adding an attribute to the elements I want to conditionalize (many!).
<sect2 id="booting" version="version2.2">
and customize the stylesheet to use it. I never added attributes in DocBook,
but it seems simple by defining local.common.attrib.
Advices? Experiences?