XML technologies / DocBook / Customizing DocBook / Extending DocBook 5 / Extending DocBook with MathML and SVG
(Excerpt from "DocBook-XML: Medienneutrales und plattformunabhängiges Publizieren" by Thomas Schraitle)
To use MathML and SVG together, combine the steps from the previous sections and create a customization file (for example, dbsvg-mathml.svg) containing both. The following example shows the result.
Example: Customization file for DocBook with SVG and MathML
<?xml version="1.0"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
<include href="docbook.rng">
<define name="db._any.svg">
<externalRef href="svg11.rng"/>
</define>
<define name="db._any.mml">
<externalRef href="mathml2.rng"/>
</define>
<define name="db._any">
<element>
<anyName>
<except>
<nsName ns="http://docbook.org/ns/docbook"/>
<nsName ns="http://www.w3.org/1999/xhtml"/>
<nsName ns="http://www.w3.org/2000/svg"/>
<nsName ns="http://www.w3.org/1998/Math/MathML"/>
</except>
</anyName>
<zeroOrMore>
<choice>
<attribute>
<anyName/>
</attribute>
<text/>
<ref name="db._any"/>
</choice>
</zeroOrMore>
</element>
</define>
</include>
</grammar>default namespace db = "http://docbook.org/ns/docbook"
namespace svg = "http://www.w3.org/2000/svg"
namespace mml = "http://www.w3.org/1998/Math/MathML"
namespace html = "http://www.w3.org/1999/xhtml"
include "docbook.rnc" {
db._any.svg = external "svg11.rnc"
db._any.mml = external "mathml2.rnc"
db._any =
element * - (db:* | html:* | svg:* | mml:*) {
(attribute * { text }
| text
| db._any)*
}
}
Copyright © 2009 Millin Verlag
You may print the online version for your private use.
Otherwise, this chapter from "DocBook-XML: Medienneutrales und plattformunabhängiges Publizieren" is subject to the same provisions as the printed edition: the work, including all its parts, is protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
Millin Verlag, Siebengebirgsring 36, 53797 Lohmar, info(at)millin.de
back to top