]> granicus.if.org Git - docbook-dsssl/commitdiff
Added mathphrase and termdef
authorNorman Walsh <ndw@nwalsh.com>
Sat, 2 Apr 2005 22:29:43 +0000 (22:29 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Sat, 2 Apr 2005 22:29:43 +0000 (22:29 +0000)
docbook/relaxng/src/docbook.rnc
docbook/relaxng/src/math.rnc [new file with mode: 0644]
docbook/relaxng/src/pool.rnc

index 6ff8921b090fa96b271679f07aedf9d77e186cf8..93ed47238f30cc4e861d0e7bea47c42c99dbd726 100644 (file)
@@ -43,6 +43,7 @@ include "calstbl.rnc"
 include "htmltbl.rnc"
 include "msgset.rnc"
 include "qandaset.rnc"
+include "math.rnc"
 include "mathml.rnc"
 include "svg.rnc"
 include "htmlform.rnc"
diff --git a/docbook/relaxng/src/math.rnc b/docbook/relaxng/src/math.rnc
new file mode 100644 (file)
index 0000000..ae139dc
--- /dev/null
@@ -0,0 +1,132 @@
+# This file is part of DocBook NG: The "IPA" Release.
+
+# This schema is a "work-in-progress". It validates a DocBook-like grammar that
+# may, in some incarnation, form the basis for DocBook V.next. Or it may not.
+# At the moment, it's just an exploration by Norm. It has utterly no normative
+# value at all.
+#
+# Author: Norman Walsh, <ndw@nwalsh.com>
+# Source: Derived from DocBook XML V4.3
+# Release: $Id$
+#
+
+namespace ctrl = "http://nwalsh.com/xmlns/schema-control/"
+namespace rng  = "http://relaxng.org/ns/structure/1.0"
+namespace s = "http://www.ascc.net/xml/schematron"
+namespace db = "http://docbook.org/docbook-ng"
+default namespace = "http://docbook.org/docbook-ng"
+
+# TEI: formula
+
+db.math.inlines = db.inlineequation
+
+db.math.blocks =
+   db.equation
+ | db.informalequation
+
+db.domain.inlines |= db.math.inlines
+
+db.nopara.blocks |= db.math.blocks
+
+# ======================================================================
+
+db.equation.content = (db.mediaobject+ | db.mathphrase+)
+
+# ======================================================================
+
+[
+   db:refname [ "equation" ]
+   db:refpurpose [ "A displayed mathematical equation" ]
+]
+div {
+
+   db.equation.role.attribute = attribute role { text }
+
+   db.equation.attlist =
+      db.equation.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & attribute label { text }?
+    & db.pgwide.attribute?
+    & db.floatstyle.attribute?
+    & db.float.attribute?
+
+   db.equation.info = db._info.title.onlyreq
+
+   db.equation =
+      element equation {
+         db.equation.attlist,
+         db.equation.info,
+         db.equation.content
+      }
+}
+
+# ======================================================================
+
+[
+   db:refname [ "informalequation" ]
+   db:refpurpose [ "A displayed mathematical equation without a title" ]
+]
+div {
+
+   db.informalequation.role.attribute = attribute role { text }
+
+   db.informalequation.attlist =
+      db.informalequation.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+
+   db.informalequation.info = db._info.title.forbidden
+
+   db.informalequation =
+      element informalequation {
+         db.informalequation.attlist,
+         db.informalequation.info,
+         db.equation.content
+      }
+}
+
+# ======================================================================
+
+[
+   db:refname [ "inlineequation" ]
+   db:refpurpose [ "A mathematical equation or expression occurring inline" ]
+]
+div {
+
+   db.inlineequation.role.attribute = attribute role { text }
+
+   db.inlineequation.attlist =
+      db.inlineequation.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+
+   db.inlineequation =
+      element inlineequation {
+         db.inlineequation.attlist,
+         db.equation.content
+      }
+}
+
+# ======================================================================
+
+[
+   db:refname [ "mathphrase" ]
+   db:refpurpose [ "A mathematical phrase, an expression that can be represented with ordinary text and a small amount of markup" ]
+]
+div {
+
+   db.mathphrase.role.attribute = attribute role { text }
+
+   db.mathphrase.attlist =
+      db.mathphrase.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+
+   db.mathphrase =
+      element mathphrase {
+         db.mathphrase.attlist,
+         (db._text | db.ubiq.inlines | db._emphasis)*
+      }
+}
+
index a1ade8d5cebbce64a6fc47b11abf8843f3dca13a..0b4136abcd52f21f703e3abd55a376082bcb73ad 100644 (file)
@@ -411,6 +411,12 @@ db._phrase =
       db._text
    }
 
+db._emphasis =
+   element emphasis {
+      db.emphasis.attlist,
+      (db._text | db._emphasis)*
+   }
+
 db._title         = db.title? & db.titleabbrev? & db.subtitle?
 db._title.req     = db.title  & db.titleabbrev? & db.subtitle?
 db._title.only    = db.title? & db.titleabbrev?
@@ -453,7 +459,6 @@ db.domain.inlines =
  | db.os.inlines
  | db.programming.inlines
  | db.markup.inlines
- | db.math.inlines
  | db.gui.inlines
  | db.keyboard.inlines
 
@@ -464,6 +469,7 @@ db.technical.inlines =
  | db.optional
  | db.package
  | db.property
+ | db.termdef
 
 db.error.inlines =
    db.errorcode
@@ -553,10 +559,6 @@ db.publishing.inlines =
  | db.superscript
  | db.wordasword
 
-# TEI: formula
-
-db.math.inlines = db.inlineequation
-
 # TEI: figure
 
 db.graphic.inlines = db.inlinemediaobject
@@ -598,7 +600,6 @@ db.nopara.blocks =
    db.list.blocks
  | db.admonition.blocks
  | db.formal.blocks
- | db.equation.blocks
  | db.informal.blocks
  | db.publishing.blocks
  | db.graphic.blocks
@@ -628,10 +629,6 @@ db.formal.blocks =
  | db.figure
  | db.table
 
-db.equation.blocks =
-   db.equation
- | db.informalequation
-
 db.informal.blocks =
    db.informalexample
  | db.informalfigure
@@ -1848,6 +1845,28 @@ div {
 
 # ======================================================================
 
+[
+   db:refname [ "termdef" ]
+   db:refpurpose [ "An inline definition of a term" ]
+]
+div {
+
+   db.termdef.role.attribute = attribute role { text }
+
+   db.termdef.attlist =
+      db.termdef.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+
+   db.termdef =
+      element termdef {
+         db.termdef.attlist,
+         (db.all.inlines* & db.glossterm)
+      }
+}
+
+# ======================================================================
+
 [
    db:refname [ "example" ]
    db:refpurpose [ "A formal example, with a title" ]
@@ -2337,86 +2356,6 @@ div {
 
 # ======================================================================
 
-db.equation.content = db.mediaobject
-
-# ======================================================================
-
-[
-   db:refname [ "equation" ]
-   db:refpurpose [ "A displayed mathematical equation" ]
-]
-div {
-
-   db.equation.role.attribute = attribute role { text }
-
-   db.equation.attlist =
-      db.equation.role.attribute?
-    & db.common.attributes
-    & db.common.linking.attributes
-    & attribute label { text }?
-    & db.pgwide.attribute?
-    & db.floatstyle.attribute?
-    & db.float.attribute?
-
-   db.equation.info = db._info.title.onlyreq
-
-   db.equation =
-      element equation {
-         db.equation.attlist,
-         db.equation.info,
-         db.equation.content+
-      }
-}
-
-# ======================================================================
-
-[
-   db:refname [ "informalequation" ]
-   db:refpurpose [ "A displayed mathematical equation without a title" ]
-]
-div {
-
-   db.informalequation.role.attribute = attribute role { text }
-
-   db.informalequation.attlist =
-      db.informalequation.role.attribute?
-    & db.common.attributes
-    & db.common.linking.attributes
-
-   db.informalequation.info = db._info.title.forbidden
-
-   db.informalequation =
-      element informalequation {
-         db.informalequation.attlist,
-         db.informalequation.info,
-         db.equation.content+
-      }
-}
-
-# ======================================================================
-
-[
-   db:refname [ "inlineequation" ]
-   db:refpurpose [ "A mathematical equation or expression occurring inline" ]
-]
-div {
-
-   db.inlineequation.role.attribute = attribute role { text }
-
-   db.inlineequation.attlist =
-      db.inlineequation.role.attribute?
-    & db.common.attributes
-    & db.common.linking.attributes
-
-   db.inlineequation =
-      element inlineequation {
-         db.inlineequation.attlist,
-         db.equation.content+
-      }
-}
-
-# ======================================================================
-
 [
    db:refname [ "synopsis" ]
    db:refpurpose [ "A general-purpose element for representing the syntax of commands or functions" ]
@@ -6271,7 +6210,7 @@ div {
 
 [
    db:refname [ "superscript" ]
-   db:refpurpose [ "A superscript (as in x2, the mathematical notation for x multiplied by itself)" ]
+   db:refpurpose [ "A superscript (as in x^2, the mathematical notation for x multiplied by itself)" ]
 ]
 div {