From 440882d3b008674bff1a6fb4eb3301a82f7156c9 Mon Sep 17 00:00:00 2001 From: Norman Walsh Date: Fri, 2 Jun 2006 13:58:45 +0000 Subject: [PATCH] Allow svg:* and mml:* in imagedata. Removed svg:* as an /alternative/ to imagedata; that seems wrong: the alignment, scaling, etc. attributes are on imagedata. --- docbook/relaxng/docbook/src/mathml.rnc | 28 ++++++++++++++++++++++++++ docbook/relaxng/docbook/src/pool.rnc | 3 ++- docbook/relaxng/docbook/src/svg.rnc | 28 +++++++++++++++++++++++++- 3 files changed, 57 insertions(+), 2 deletions(-) diff --git a/docbook/relaxng/docbook/src/mathml.rnc b/docbook/relaxng/docbook/src/mathml.rnc index 83f54bb05..f61a6db3d 100644 --- a/docbook/relaxng/docbook/src/mathml.rnc +++ b/docbook/relaxng/docbook/src/mathml.rnc @@ -36,6 +36,34 @@ default namespace = "http://docbook.org/ns/docbook" db.equation.content |= db._any.mml+ +# Allow imagedata to contain MathML + +db.imagedata.mathml.role.attribute = attribute role { text } + +db.imagedata.mathml.attlist = + db.imagedata.mathml.role.attribute? + & db.common.attributes + & attribute format { "mathml" }? + & db.imagedata.align.attribute? + & db.imagedata.valign.attribute? + & db.imagedata.width.attribute? + & db.imagedata.contentwidth.attribute? + & db.imagedata.scalefit.attribute? + & db.imagedata.scale.attribute? + & db.imagedata.depth.attribute? + & db.imagedata.contentdepth.attribute? + +db.imagedata.mathml.info = db._info.title.forbidden + +db.imagedata.mathml = + element imagedata { + db.imagedata.attlist, + db.imagedata.info, + db._any.mml+ + } + +db.imageobject.content |= db.imagedata.mathml + [ db:refname [ "mml:*" ] db:refpurpose [ "Any element from the MathML namespace" ] diff --git a/docbook/relaxng/docbook/src/pool.rnc b/docbook/relaxng/docbook/src/pool.rnc index 6e645cd6b..45595d19f 100644 --- a/docbook/relaxng/docbook/src/pool.rnc +++ b/docbook/relaxng/docbook/src/pool.rnc @@ -2695,7 +2695,8 @@ div { db.imagedata = element imagedata { db.imagedata.attlist, - db.imagedata.info + db.imagedata.info, + empty } } diff --git a/docbook/relaxng/docbook/src/svg.rnc b/docbook/relaxng/docbook/src/svg.rnc index 915880789..50835d522 100644 --- a/docbook/relaxng/docbook/src/svg.rnc +++ b/docbook/relaxng/docbook/src/svg.rnc @@ -34,7 +34,33 @@ namespace s = "http://www.ascc.net/xml/schematron" namespace db = "http://docbook.org/ns/docbook" default namespace = "http://docbook.org/ns/docbook" -db.imageobject.content |= db._any.svg+ +db.imageobject.content |= db.imagedata.svg + +# Allow imagedata to contain SVG + +db.imagedata.svg.role.attribute = attribute role { text } + +db.imagedata.svg.attlist = + db.imagedata.svg.role.attribute? + & db.common.attributes + & attribute format { "svg" }? + & db.imagedata.align.attribute? + & db.imagedata.valign.attribute? + & db.imagedata.width.attribute? + & db.imagedata.contentwidth.attribute? + & db.imagedata.scalefit.attribute? + & db.imagedata.scale.attribute? + & db.imagedata.depth.attribute? + & db.imagedata.contentdepth.attribute? + +db.imagedata.svg.info = db._info.title.forbidden + +db.imagedata.svg = + element imagedata { + db.imagedata.attlist, + db.imagedata.info, + db._any.svg+ + } [ db:refname [ "svg:*" ] -- 2.40.0