Chapter 1. Customizer's Guide for the DocBook DTD

[Prev]


1.4 Sample Customization

Example 1.4 shows the main customization layer for a sample variant of DocBook V2.3.Example 1-4: Main Customization Layer for Sample DocBook Variant

<!-- ...................................................................... -->
<!-- Sample customization of DocBook ...................................... -->
<!-- ...................................................................... -->
<!-- Entity customizations ................................................ -->
<!-- Module activations ................................................... -->
<!ENTITY % dbpool.redecl.module "INCLUDE">
<!-- Module replacements .................................................. -->
<!ENTITY % book.module "IGNORE">
<!ENTITY % bookbiblio.module "IGNORE">
<!ENTITY % appendix.module "IGNORE">
<!ENTITY % chapter.module "IGNORE">
<!ENTITY % part.module "IGNORE">
<!ENTITY % preface.module "IGNORE">
<!ENTITY % sect1.module "IGNORE">
<!ENTITY % sect2.module "IGNORE">
<!ENTITY % sect3.module "IGNORE">
<!ENTITY % sect4.module "IGNORE">
<!ENTITY % sect5.module "IGNORE">
<!ENTITY % abstract.module "IGNORE">
<!ENTITY % figure.module "IGNORE">
<!ENTITY % informalequation.module "IGNORE">
<!ENTITY % inlineequation.module "IGNORE">
<!ENTITY % table.module "IGNORE">
<!ENTITY % informaltable.module "IGNORE">
<!ENTITY % xref.module "IGNORE">
<!-- Module removals ...................................................... -->
<!-- elm Many more could be removed, if desired.  Unless the presence
     of a removed element caused problems (as in the case of Equation,
     which contained InformalEquation, another removed element),
     only replaced modules were ignored. Some style sheets might have to 
     be stripped of some specifications for removed elements in order to 
     avoid warnings and errors. -->
<!ENTITY % equation.module "IGNORE">
<!-- Class customizations ................................................. -->
<!-- Remove FootnoteRef; add XRefnotitle -->
<!ENTITY % xref.char.class "XRef | XRefnotitle">
<!-- Remove Citation, Citetitle, CiteRefEntry, FirstTerm, Footnote, 
     Markup, SGMLTag -->
<!ENTITY % word.char.class "Abbrev | Acronym | Emphasis | ForeignPhrase
		| GlossTerm | Quote | Trademark | WordAsWord">
<!-- Remove Action, Classname, KeyCode, Optional, Property, StructField,
     StructName, Symbol, Token, Type; add CompoundKey, MenuTree,
     MouseAction -->
<!ENTITY % cptr.char.class "Application | Command | CompoundKey 
		| ComputerOutput | Filename | Function | Interface
		| KeyCap | KeySym | Literal |MenuTree | MouseAction
		| Parameter | Replaceable | SystemItem | UserInput">
<!-- Remove FormalPara, SimPara (which is more restrictive and should not
     be allowed everywhere) -->
<!ENTITY % para.class "Para">
<!-- Remove ScreenShot -->
<!ENTITY % linespecific.class "LiteralLayout | ProgramListing | Screen">
<!-- Remove BridgeHead, Comment, Highlights (the latter should not 
     generally be found throughout the document) -->
<!ENTITY % genobj.class "Anchor">
<!-- Remove Abstract and AuthorBlurb (which should not generally be
     found throughout the document) and Epigraph; see mixture 
     redeclaration module. -->
<!-- Remove synopses; see mixture redeclaration module. -->
<!-- Remove MsgSet, Sidebar -->
<!ENTITY % compound.class "Procedure">
<!-- Rename Table to FormalTable; remove Equation -->
<!ENTITY % formal.class "Example | Figure | FormalTable">
<!-- Rename InformalEquation to EquationDisplayed -->
<!ENTITY % informal.class "BlockQuote | EquationDisplayed | InformalExample
		| InformalTable | Graphic">
<!-- Rename InlineEquation to Equation Inline; add EquationSimpleInline -->
<!-- elm Still want synop.class in here? -->
<!ENTITY % inlineobj.char.class "InlineGraphic | EquationInline
		|EquationSimpleInline">
<!-- Add special terms -->
<!ENTITY % specialinteractiveterms.class "SpecialModule | SpecialTool">
<!ENTITY % specialbatchterms.class "SpecialKeyword | SpecialParameter 
		| SpecialParamValue">
<!ENTITY % local.inline.char.class "| %specialinteractiveterms.class; 
		| %specialbatchterms.class;">
<!-- Attribute customizations ............................................. -->
<!-- Remove all but ID -->
<!ENTITY % common.attrib
		"id		ID		#IMPLIED">
<!-- Restrict to just two token values; set default explicitly. -->
<!ENTITY % mark.attrib
		"Mark		(Bullet|Dash)	Bullet">
<!ENTITY % onlinedisplay.attrib
		"OnlineDisplay	(hide|reveal)	reveal">
<!-- Add ArborText formatting attributes.
     Add online and print filenames.
     Remove Notation and Entityref attributes. -->
<!ENTITY % graphic.attrib
	"Fileref-print	CDATA		#REQUIRED
	Fileref-online	CDATA		#REQUIRED
	%onlinedisplay.attrib;
	SrcCredit	CDATA		#IMPLIED
	processor	CDATA		#REQUIRED
	magnification	NUMBER		#IMPLIED
	horzoffsetamt	CDATA		#IMPLIED
	horzoffsetpct	CDATA		#IMPLIED
	vertoffsetamt	CDATA		#IMPLIED
	vertoffsetpct	CDATA		#IMPLIED
	cropheight	CDATA		#IMPLIED
	cropwidth	CDATA		#IMPLIED
	cropllxcoord	CDATA		#IMPLIED
	cropllycoord	CDATA		#IMPLIED
	scalefit	NUMBER		#IMPLIED
	scalefitheight	CDATA		#IMPLIED
	scalefitwidth	CDATA		#IMPLIED"
>
<!-- Content model customizations ......................................... -->
<!-- Remove DocInfo -->
<!ENTITY % bookcomponent.title.content "Title, TitleAbbrev?">
<!-- Customizations with tricky positioning ............................... -->
<!-- See the file rdbpool.mod. -->
<!-- ...................................................................... -->
<!-- Original DTD ......................................................... -->
<!ENTITY % orig-docbook PUBLIC "-//Davenport//DTD DocBook V2.3//EN">
%orig-docbook;
<!-- ...................................................................... -->
<!-- New/replaced markup .................................................. -->
<!-- Book ................................................................. -->
<!--   Remove Title. Depend on the Title in BookBiblio.
       Make BookInfo, ToC mandatory.
       Remove LoT.
       Require exactly one Preface.
       Remove Reference. (Put this back if we ever want man pages.)
       Remove Article. -->
<!ELEMENT Book - - (BookInfo, ToC, Preface, Part+, (%appendix.class;)*, 
		Glossary?, Bibliography?, (%index.class;)*) +(%ubiq.mix;)>
<!ATTLIST Book
	%common.attrib;
	FPI		CDATA		#IMPLIED
	%label.attrib;
>
<!-- BookBiblio ........................................................... -->
<!--   Make Title and TitleAbbrev required.
       Make AuthorGroup optional. -->
<!ELEMENT BookBiblio - - (Title, TitleAbbrev, Subtitle?, Edition?,
		AuthorGroup?, ((ISBN, VolumeNum?) | (ISSN, VolumeNum?,
		IssueNum?, PageNums?))?, InvPartNumber?, ProductNumber?,
		ProductName?, PubsNumber?, ReleaseInfo?, PubDate*, Publisher*,
		Copyright?, SeriesInfo?, Abstract*, ConfGroup*, (ContractNum |
		ContractSponsor)*, PrintHistory?, RevHistory?) -(%ubiq.mix;)>
<!ATTLIST BookBiblio %common.attrib;>
<!-- Appendix ............................................................. -->
<!--   Remove DocInfo, TitleAbbrev; add Abstract, Highlights -->
<!ELEMENT Appendix - - (Title, Abstract, Highlights?, (%sect1.content;)) 
		+(%ubiq.mix;)>
<!ATTLIST Appendix
	%common.attrib;
	%label.attrib;
>
<!-- Chapter .............................................................. -->
<!--   Remove DocInfo, Index, Glossary, Bibliography.
       Replace sect1.content with more specific markup, i.e.
       Abstract, Highlights?, Sect1+. -->
<!ELEMENT Chapter - - ((%bookcomponent.title.content;), Abstract?, 
		Highlights?, Sect1+) +(%ubiq.mix;)>
<!-- Part ................................................................. -->
<!--   Remove DocInfo, make PartIntro mandatory.
       Use chapter.class instead of partcontent.mix as content model.
       Add SpecialKeySection as alternative to chapter. -->
<!ELEMENT Part - - ((%bookcomponent.title.content;), PartIntro, 
		((%chapter.class)+ | SpecialKeySection+)) +(%ubiq.mix;)>
<!ATTLIST Part
	%common.attrib;
	%label.attrib;
>
<!-- Preface .............................................................. -->
<!--   Remove DocInfo, TitleAbbrev -->
<!ELEMENT Preface - - (Title, (%sect1.content;)) +(%ubiq.mix;)>
<!ATTLIST Preface %common.attrib;>
<!-- Sect1 through Sect5 .................................................. -->
<!--   Remove nav.class.
       Remove all RefEntries (put back if we ever need man pages).
       Add HelpTopic with and without "see also" references. -->
<!-- elm Did you mean to override RefEntries in the real sect1.class
     too (which gets used in Preface)? -->
<!ENTITY % helptopic.content 
		"HelpTopicWithRefs | 
			( (HelpTopicNoRefs, (%divcomponent.mix;)+) 
			| ((%bookcomponent.title.content;), 
				(Abstract | (%divcomponent.mix;)+)))">
<!ELEMENT Sect1 - - ((%helptopic.content;), Sect2*) +(%ubiq.mix;)>
<!ATTLIST Sect1
	%common.attrib;
	%label.attrib;
	Renderas	(Sect2
			|Sect3
			|Sect4
			|Sect5)		#IMPLIED
>
<!ELEMENT Sect2 - - ((%helptopic.content;), Sect3*) +(%ubiq.mix;)>
<!ATTLIST Sect2
	%common.attrib;
	%label.attrib;
	Renderas	(Sect1
			|Sect3
			|Sect4
			|Sect5)		#IMPLIED
>
<!ELEMENT Sect3 - - ((%helptopic.content;), Sect4*) +(%ubiq.mix;)>
<!ATTLIST Sect3
	%common.attrib;
	%label.attrib;
	Renderas	(Sect1
			|Sect2
			|Sect4
			|Sect5)		#IMPLIED
>
<!ELEMENT Sect4 - - ((%helptopic.content;), Sect5*) +(%ubiq.mix;)>
<!ATTLIST Sect4
	%common.attrib;
	%label.attrib;
	Renderas	(Sect1
			|Sect2
			|Sect3
			|Sect5)		#IMPLIED
>
<!ELEMENT Sect5 - - ((%helptopic.content;))>
<!ATTLIST Sect5
	%common.attrib;
	%label.attrib;
	Renderas	(Sect1
			|Sect2
			|Sect3
			|Sect4)		#IMPLIED
>
<!-- HelpTopics ........................................................... -->
<!ELEMENT HelpTopicWithRefs - - ((%bookcomponent.title.content;), HelpText,
		SeeAlsoSections)>
<!ATTLIST HelptopicWithRefs %idreq.attrib;>
<!ELEMENT HelpTopicNoRefs - - ((%bookcomponent.title.content;), HelpText)>
<!ATTLIST HelptopicNoRefs %idreq.attrib;>
<!ELEMENT HelpText - - ((%divcomponent.mix;)+)>
<!ATTLIST HelpText %common.attrib;>
<!ELEMENT SeeAlsoSections - - (ItemizedList)+>
<!ATTLIST SeeAlsoSections %common.attrib;>
<!-- Abstract ............................................................. -->
<!--   Remove Title. -->
<!ELEMENT Abstract - - (%para.class;)+>
<!ATTLIST Abstract %common.attrib;>
<!-- Figure ............................................................... -->
<!--   Remove TitleAbbrev.
       Only allow for a single graphical object within a Figure. -->
<!ELEMENT Figure - - (Title, (%figure.mix; | %link.char.class;))>
<!ATTLIST Figure
	%common.attrib;
	Float		%yesorno.attvals;	%no.attval;
	%label.attrib;
>
<!-- Equations ............................................................ -->
<!--   Remove the concept of formal and informal equations.
       Rename InformalEquation to EquationDisplayed.
       Rename InlineEquation to EquationInline.
       Use ArborText equation elements.
       Add EquationSimpleInline. -->
<!ELEMENT EquationDisplayed - - (fd)>
<!ATTLIST EquationDisplayed %common.attrib;>
<!ELEMENT EquationInline - - (f)>
<!ATTLIST EquationInline %common.attrib;>
<!ELEMENT EquationSimpleInline - - (Base, (Superscript | Subscript)?)>
<!ATTLIST EquationSimpleInline %common.attrib;>
<!ELEMENT Base - - (#PCDATA)>
<!ATTLIST Base %common.attrib;>
<!ENTITY % atimath PUBLIC "-//ArborText//ELEMENTS Math Equation Structures//EN">
%atimath;
<!-- Tables ............................................................... -->
<!--   Rename Table to FormalTable.
       Use ArborText tables instead of CALS tables.
       Restrict Entry content. -->
<!ENTITY % tblcon "%para.class;">
<!ELEMENT FormalTable - - ((%formalobject.title.content;), Table)
		-(FormalTable|InformalTable)>
<!ATTLIST FormalTable
	%common.attrib;
	%onlinedisplay.attrib;
>
<!ELEMENT InformalTable - - (Table) -(FormalTable|InformalTable)>
<!ATTLIST InformalTable
	%common.attrib;
	%onlinedisplay.attrib;
>
<!ENTITY % atitable PUBLIC "-//ArborText//ELEMENTS Table Structures//EN">
%atitable;
<!-- XRefs ................................................................ -->
<!--   Added Title attribute so that title can be display automatically
       in some cases. -->
<!-- elm Why XRefnotitle? Does Title attrib make sense on it? -->
<!ELEMENT XRef - O EMPTY>
<!ATTLIST XRef
	%common.attrib;
	Endterm		IDREF			#IMPLIED
	Linkend		IDREF			#REQUIRED
	Title		(Display|NoDisplay)	NoDisplay
>
<!ELEMENT XRefnotitle - O EMPTY>
<!ATTLIST XRefnotitle
	%common.attrib;
	Endterm		IDREF			#IMPLIED
	Linkend		IDREF			#REQUIRED
	Title		(Display|NoDisplay)	NoDisplay
>
<!-- MouseAction, CompoundKey, MenuTree ................................... -->
<!--   Tagging examples:
       <CompoundKey> <KeySym>Meta</> <KeyCap>x</> </>
       <CompoundKey> <KeySym>Ctrl</> <MouseAction>Click</> </> or
       <MouseAction>Double-click</> 
       <MouseAction>Drag</> -->
<!ELEMENT MouseAction - - (#PCDATA)>
<!ATTLIST MouseAction %common.attrib;>
<!ELEMENT CompoundKey - - (KeySym, (MouseAction | KeyCap | KeySym))>
<!ATTLIST CompoundKey %common.attrib;>
<!--   Tagging example:
       <menutree><interface class=Menu>File</>
                 <interface class=MenuItem>Save</> </> -->
<!ELEMENT MenuTree - - (Interface, Interface+)>
<!ATTLIST MenuTree %common.attrib;>
<!-- Special elements ..................................................... -->
<!-- Note: This portion of the DTD could be greatly simplified if there
     were a way to count how many parameters there are. Certainly this could 
     be done as a postprocessing exercise, and the author could leave such 
     information blank (except for CustomText). -->
<!ELEMENT SpecialKeySection - - (KeySectionTitle, Para*, SeeUsageSections,
		SeeAlsoSections?, ParamsRequired?, ParamsCustom*,
		(ParamsOptional, ParamsCustom*)?, (DataDesc)*) +(%ubiq.mix;)>
<!ATTLIST SpecialKeySection
            %common.attrib;
	    fileref		CDATA	#REQUIRED
>
<!ELEMENT KeySectionTitle - - (SpecialKeyword, KeywordDef)>
<!ATTLIST KeySectionTitle
            %common.attrib;
>
<!ELEMENT KeywordDef - - ((%para.char.mix;)+)>
<!ATTLIST KeywordDef
            %common.attrib;
>
<!ELEMENT SeeUsageSections - - (ItemizedList)+>
<!ATTLIST SeeUsageSections
                %common.attrib;
>
<!-- Parameters
       ParamsRequired and ParamsOptional could have been combined into
       just Params, with an attribute like usage=required|optional.
       However, it is likely that most people would forget to set
       the attribute, or be confused by it, so it seemed reasonable
       to have two different wrapper elements. Furthermore, the order
       is important; required parameters should come first.
-->
<!-- ParamsRequired
       Attribute HowManyRequiredParams allows automatic generation
       of the text "The following parameter(s) is/are required",
       or allows the author to override with custom text if necessary. -->
<!ELEMENT ParamsRequired - - (SimPara?, ParamList)>
<!ATTLIST ParamsRequired
            %common.attrib;
            HowManyRequiredParams   (1|MoreThanOne|CustomText)  MoreThanOne
>
<!-- ParamsOptional
       Attribute HowManyOptionalParams allows automatic generation
       of the text "The following parameter(s) is/are optional",
       or allows the author to override with custom text if necessary.-->
<!ELEMENT ParamsOptional - - (SimPara?, ParamList)>
<!ATTLIST ParamsOptional
            %common.attrib;
            HowManyOptionalParams   (1|MoreThanOne|CustomText)  MoreThanOne
>
<!ELEMENT ParamsCustom - - (Title, SimPara?, ParamList)>
<!ATTLIST ParamsCustom %common.attrib;>
<!ELEMENT ParamList - - (ParamListEntry+) >
<!ATTLIST ParamList %common.attrib;>
<!ELEMENT ParamListEntry - - (SpecialParameter, ListItem) >
<!ATTLIST ParamListEntry %common.attrib;>
<!ELEMENT DataDesc - - (Title, DataLine+)>
<!ATTLIST DataDesc %common.attrib;>
<!ELEMENT DataLine - - (SimPara?, EntryList, (SimPara, EntryList)*,
                       RepeatInstruction?, Para*) >
<!ATTLIST DataLine %common.attrib;>
<!ELEMENT EntryList - - (Entry+)>
<!ATTLIST EntryList %common.attrib;>
<!ELEMENT Entry - - (Para+)>
<!ATTLIST Entry
           %common.attrib;
           Format           (Alpha|Float|Integer)    Float
>
<!ELEMENT RepeatInstruction - - (SimPara)>
<!ATTLIST RepeatInstruction %common.attrib;>
<!ELEMENT (%specialinteractiveterms.class;|%specialbatchterms.class;) - -
		(#PCDATA)>
<!ATTLIST (%specialinteractiveterms.class;|%specialbatchterms.class;)
	%common.attrib;>
<!-- End of sample customization of DocBook ............................... -->
<!-- ...................................................................... -->

Example 1.5 shows the redeclaration module for this sample variant.Example 1-5: rdbpool.mod Redeclaration Module for Sample DocBook Variant

<!-- ...................................................................... -->
<!-- Sample customizations that reference existing entities ............... -->
<!-- ...................................................................... -->
<!-- Remove BeginPage -->
<!ENTITY % ubiq.mix "%ndxterm.class;">
<!-- ...................................................................... -->
<!-- Restrict to just computer terms -->
<!ENTITY % screen.content "LineAnnotation | %cptr.char.class;">
<!-- ...................................................................... -->
<!-- Remove all synopses and descriptive objects from all block-level 
     mixtures. -->
<!ENTITY % local.divcomponent.mix "">
<!ENTITY % divcomponent.mix
		"%list.class;		|%admon.class;
		|%linespecific.class;
		|%para.class;		|%informal.class;
		|%formal.class;		|%compound.class;
		|%genobj.class;
		%local.divcomponent.mix;">
<!ENTITY % local.refcomponent.mix "">
<!ENTITY % refcomponent.mix
		"%list.class;		|%admon.class;
		|%linespecific.class;
		|%para.class;		|%informal.class;
		|%formal.class;		|%compound.class;
		|%genobj.class;
		%local.refcomponent.mix;">
<!ENTITY % local.indexdivcomponent.mix "">
<!ENTITY % indexdivcomponent.mix
		"ItemizedList|OrderedList|VariableList
		|%linespecific.class;
		|%para.class;		|%informal.class;
		|Anchor
		|%link.char.class;
		%local.indexdivcomponent.mix;">

<!ENTITY % local.component.mix "">
<!ENTITY % component.mix
		"%list.class;		|%admon.class;
		|%linespecific.class;
		|%para.class;		|%informal.class;
		|%formal.class;		|%compound.class;
		|%genobj.class;
		%local.component.mix;">
<!ENTITY % local.sidebar.mix "">
<!ENTITY % sidebar.mix
		"%list.class;		|%admon.class;
		|%linespecific.class;
		|%para.class;		|%informal.class;
		|%formal.class;		|Procedure
		|%genobj.class;
		%local.sidebar.mix;">
<!ENTITY % local.footnote.mix "">
<!ENTITY % footnote.mix
		"%list.class;
		|%linespecific.class;
		|%para.class;		|%informal.class;
		%local.footnote.mix;">
<!ENTITY % local.example.mix "">
<!ENTITY % example.mix
		"%list.class;
		|%linespecific.class;
		|%para.class;		|%informal.class;
		%local.example.mix;">
<!ENTITY % local.admon.mix "">
<!ENTITY % admon.mix
		"%list.class;
		|%linespecific.class;
		|%para.class;		|%informal.class;
		|%formal.class;		|Procedure|Sidebar
		|Anchor|BridgeHead|Comment
		%local.admon.mix;">
<!ENTITY % local.figure.mix "">
<!ENTITY % figure.mix
		"%linespecific.class;
					|%informal.class;
		%local.figure.mix;">
<!ENTITY % local.glossdef.mix "">
<!ENTITY % glossdef.mix
		"%list.class;
		|%linespecific.class;
		|%para.class;		|%informal.class;
		|Comment
		%local.glossdef.mix;">
<!-- End of sample customizations that reference existing entities ........ -->
<!-- ...................................................................... -->


[Prev] Customization Specifics
[Customizer's Home] [Davenport Group Home]