From c4ba68eddd39d4b93e3ec845c0252f23ea35b789 Mon Sep 17 00:00:00 2001 From: Jirka Kosek Date: Tue, 20 Dec 2005 21:08:17 +0000 Subject: [PATCH] Added info about combining DocBook schema with MathML and SVG --- docbook/relaxng/docbook/howto/howto.xml | 220 ++++++++++++++++++++++++ 1 file changed, 220 insertions(+) diff --git a/docbook/relaxng/docbook/howto/howto.xml b/docbook/relaxng/docbook/howto/howto.xml index 0808cd9d4..9345906e2 100644 --- a/docbook/relaxng/docbook/howto/howto.xml +++ b/docbook/relaxng/docbook/howto/howto.xml @@ -964,6 +964,226 @@ one usable XSLT 2.0 processor. + +Schema customizations + + + +How can I extend DocBook schema with MathML elements? + + +Basic DocBook schema allows any elements from MathML namespace +to appear inside equation element. This means that you can +validate DocBook+MathML document, but MathML content will be ignored +during the validation. You will also not be able to use guided editing +for MathML content. +If you need strict validation of MathML content or guided +editing for MathML, you can easily extend the base DocBook schema with +a MathML schema. + +Extending the DocBook schema with MathML schema + +Download MathML RELAX NG schema from and unpack it +somewhere (e.g. into mathml subdirectory). + + +Create easy schema customization +dbmathml.rnc: +namespace html = "http://www.w3.org/1999/xhtml" +namespace mml = "http://www.w3.org/1998/Math/MathML" +namespace db = "http://docbook.org/ns/docbook" + +include "/path/to/docbook.rnc" { + db._any.mml = external "mathml/mathml2.rnc" + db._any = + element * - (db:* | html:* | mml:*) { + (attribute * { text } + | text + | db._any)* + } +} +Or alternatively you can use XML syntax of RELAX NG—dbmathml.rng: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + +Now use the customized schema (dbmathml.rnc +or dbmathml.rng) instead of the original +DocBook schema. + + + + + + + +How can I extend DocBook schema with SVG elements? + + +The situation is the same as with MathML support. You can use +any elements from the SVG namespace inside imageobject +element. + +Extending the DocBook schema with SVG schema + +Download SVG RELAX NG schema from and unpack it +somewhere (e.g. into svg subdirectory). + + +Create easy schema customization +dbsvg.rnc: +namespace html = "http://www.w3.org/1999/xhtml" +namespace db = "http://docbook.org/ns/docbook" +namespace svg = "http://www.w3.org/2000/svg" + +include "/path/to/docbook.rnc" { + db._any.svg = external "svg/svg11.rnc" + db._any = + element * - (db:* | html:* | svg:*) { + (attribute * { text } + | text + | db._any)* + } +} +Or alternatively you can use XML syntax of RELAX NG—dbsvg.rng: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + +Now use the customized schema (dbsvg.rnc +or dbsvg.rng) instead of the original +DocBook schema. + + + + + + + +Is it possible to use previous two customizations for MathML +and SVG together? + + +Yes, you can create a special schema customization that combines +both MathML and SVG with the DocBook schema. In compact syntax, merged +schema is: +namespace html = "http://www.w3.org/1999/xhtml" +namespace mml = "http://www.w3.org/1998/Math/MathML" +namespace db = "http://docbook.org/ns/docbook" +namespace svg = "http://www.w3.org/2000/svg" + +include "/path/to/docbook.rnc" { + db._any.mml = external "mahtml/mathml2.rnc" + db._any.svg = external "svg/svg11.rnc" + db._any = + element * - (db:* | html:* | mml:* | svg:*) { + (attribute * { text } + | text + | db._any)* + } +} +Or alternatively in full RELAX NG syntax: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + + + Tool specific problems -- 2.40.0