]> granicus.if.org Git - docbook-dsssl/commitdiff
RFE 2770858/2791288 add more elements to ubiquitous inlines
authorNorman Walsh <ndw@nwalsh.com>
Fri, 1 Jan 2010 18:14:44 +0000 (18:14 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Fri, 1 Jan 2010 18:14:44 +0000 (18:14 +0000)
docbook/relaxng/docbook/src/glossary.rnc
docbook/relaxng/docbook/src/pool.rnc

index 2e90a8aaa3f190b6c98be737bce7de8f5f5edf66..ac6fc4618e2d5b83a8e6f167a7a8bdb090c09718 100644 (file)
@@ -41,6 +41,8 @@ db.navigation.components |= db.glossary
 db.glossary.inlines =
    db.firstterm
  | db.glossterm
+ | db._firstterm
+ | db._glossterm
 
 # ======================================================================
 
@@ -255,6 +257,41 @@ div {
 
 # ======================================================================
 
+[
+   db:refname [ "firstterm" ]
+   db:refpurpose [ "The first occurrence of a term, with limited content" ]
+]
+div {
+
+   db._firstterm.role.attribute = attribute role { text }
+
+   db._firstterm.attlist =
+      db._firstterm.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.baseform.attribute
+
+   db._firstterm =
+      [
+         s:pattern [
+            name = "Glossary 'firstterm' type constraint"
+            s:rule [
+               context = "db:firstterm[@linkend]"
+               s:assert [
+                  test = "local-name(//*[@xml:id=current()/@linkend]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'"
+                  "@linkend on firstterm must point to a glossentry."
+               ]
+            ]
+         ]
+      ]
+      element firstterm {
+         db._firstterm.attlist,
+         db._text
+      }
+}
+
+# ======================================================================
+
 [
    db:refname [ "glossterm" ]
    db:refpurpose [ "A glossary term" ]
@@ -290,6 +327,41 @@ div {
 
 # ======================================================================
 
+[
+   db:refname [ "glossterm" ]
+   db:refpurpose [ "A glossary term" ]
+]
+div {
+
+   db._glossterm.role.attribute = attribute role { text }
+
+   db._glossterm.attlist =
+      db._glossterm.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+    & db.baseform.attribute
+
+   db._glossterm =
+      [
+         s:pattern [
+            name = "Glossary 'glossterm' type constraint"
+            s:rule [
+               context = "db:glossterm[@linkend]"
+               s:assert [
+                  test = "local-name(//*[@xml:id=current()/@linkend]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'"
+                  "@linkend on glossterm must point to a glossentry."
+               ]
+            ]
+         ]
+      ]
+      element glossterm {
+         db._glossterm.attlist,
+         db._text
+      }
+}
+
+# ======================================================================
+
 [
    db:refname [ "glossary" ]
    db:refpurpose [ "A glossary" ]
index 80c2d624e2a1fbeda8fae4bf56d3c9bd8485a261..a5d366cd255d8242224209c9c3fc094150413617 100644 (file)
@@ -46,7 +46,7 @@ default namespace = "http://docbook.org/ns/docbook"
 
 start |= db.abstract
  | db.mediaobject.content
- | db.audiodata 
+ | db.audiodata
  | db.imagedata
  | db.textdata
  | db.videodata
@@ -637,10 +637,27 @@ db.biblio.class.attribute =
 db.ubiq.inlines =
    db.inlinemediaobject
  | db.remark
- | db.superscript
- | db.subscript
  | db.link.inlines
  | db.alt
+ | db.trademark
+ # below, effectively the publishing inlines (as of 5.0)
+ | db.abbrev
+ | db.acronym
+ | db.date
+ | db._emphasis
+ | db.footnote
+ | db.footnoteref
+ | db._foreignphrase
+ | db._phrase
+ | db._quote
+ | db.subscript
+ | db.superscript
+ | db.wordasword
+ | db._firstterm
+ | db._glossterm
+ | db.coref
+
+
 
 db._text         = (text | db.ubiq.inlines | db._phrase | db.replaceable)*
 
@@ -4728,7 +4745,7 @@ div {
    db._emphasis =
       element emphasis {
          db.emphasis.attlist,
-         (db._text | db._emphasis)*
+         db._text
       }
 }
 
@@ -4756,6 +4773,28 @@ div {
 
 # ======================================================================
 
+[
+   db:refname [ "foreignphrase" ]
+   db:refpurpose [ "A limited word or phrase in a language other than the primary language of the document" ]
+]
+div {
+
+   db._foreignphrase.role.attribute = attribute role { text }
+
+   db._foreignphrase.attlist =
+      db._foreignphrase.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+
+   db._foreignphrase =
+      element foreignphrase {
+         db._foreignphrase.attlist,
+         db._text
+      }
+}
+
+# ======================================================================
+
 [
    db:refname [ "phrase" ]
    db:refpurpose [ "A span of text" ]
@@ -4815,6 +4854,28 @@ div {
 
 # ======================================================================
 
+[
+   db:refname [ "quote" ]
+   db:refpurpose [ "A limited inline quotation" ]
+]
+div {
+
+   db._quote.role.attribute = attribute role { text }
+
+   db._quote.attlist =
+      db._quote.role.attribute?
+    & db.common.attributes
+    & db.common.linking.attributes
+
+   db._quote =
+      element quote {
+         db._quote.attlist,
+         db._text
+      }
+}
+
+# ======================================================================
+
 [
    db:refname [ "subscript" ]
    db:refpurpose [ "A subscript (as in H" db:subscript [ "2" ] "O, the molecular formula for water)" ]