XML technologies / DocBook / Customizing DocBook / Removing elements / Removing an inline element

(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)

Inline elements appear in body text and elsewhere, such as in title, subtitle, etc. Removing one requires more code in DocBook 4 than in DocBook 5.

Customizing DocBook 4

For DocBook 4, proceed as follows:

Procedure: Removing database in DocBook 4

  1. Disabling %database.module;
    Disable the database element using IGNORE and the parameter entity %database.module;:

<!ENTITY % database.module "IGNORE">

This declaration disables the element and all its attributes.

  1. Where does database occur?
    Search the files *.mod and *.dtd of the DocBookDTD for every occurrence of the element, here database):

<!-- dbpoolx.mod --> 
<!ENTITY % tech.char.class "...|guisubmenu|database|interface..."> 

  1. Redefining element and entity declarations
    Remove the element from the element and entity declarations you found. Your customization file looks like this:

<!ENTITY % database.module "IGNORE"> 
<!ENTITY % local.tech.char.class ""> 
<!ENTITY % tech.char.class 
     "action|application 
     |classname|methodname|interfacename|exceptionname 
     |ooclass|oointerface|ooexception 
     |command|computeroutput 
     |email|envar|errorcode|errorname|errortype|errortext 
     |filename|function|guibutton|guiicon|guilabel|guimenu 
     |guimenuitem|guisubmenu|hardware|interface|keycap 
     |keycode|keycombo|keysym|literal|constant|markup 
     |medialabel|menuchoice|mousebutton|option|optional 
     |parameter|prompt|property|replaceable|returnvalue 
     |sgmltag|structfield|structname|symbol|systemitem|token 
     |type|userinput|varname 
     %local.tech.char.class;"> 
<!ENTITY % DocBookDTD PUBLIC 
   "-//OASIS//DTD DocBook XML V4.5//EN" 
   "http://www.docbook.org/xml/4.5/docbookx.dtd"> 
%DocBookDTD;

In the original file dbpoolx.mod the parameter entity tech.char.class also contains a line with %ebnf.inline.hook;, which includes the EBNF module. It was omitted here for simplicity.

  1. Using the customization file
    Use the customization file instead of the original DocBook file (see Validating with a DocBook 4 customization file).

Customizing DocBook 5

DocBook 5 requires very few lines in your customization file:

<include href="docbook.rng">    
    <define name="db.database">
        <notAllowed/>
    </define>
</include>

include "docbook.rnc" {
   db.database = notAllowed
}

  

back to top