RelaxNG/publidoc.rnc
changeset 419 9ee9258144c5
parent 416 544199d43060
child 423 0b803d5f38d4
--- a/RelaxNG/publidoc.rnc	dim. mai 29 14:06:37 2016 +0200
+++ b/RelaxNG/publidoc.rnc	mer. juin 15 15:15:54 2016 +0200
@@ -15,7 +15,7 @@
 publidoc.content =
    document
  | top.topic
-
+ | glossary
 
 # =============================================================================
 #                                 HEAD LEVEL
@@ -226,7 +226,7 @@
 
 document.content =
    top.head?,
-   (division | topic)+
+   (division | topic | glossary)+
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ top.topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -246,6 +246,22 @@
    footer?
 
 
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ glossary ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+glossary = element glossary { glossary.attributes, glossary.content }
+
+glossary.attributes =
+   glossary.type.attribute?
+ & langfrom.attribute?
+ & langto.attribute?
+glossary.type.attribute = attribute type { xsd:NCName }
+langfrom.attribute = attribute langfrom { xsd:language }
+langto.attribute = attribute langto { xsd:language }
+
+glossary.content =
+   glossary.entry+
+
+
 # =============================================================================
 #                                 DIVISION LEVEL
 # =============================================================================
@@ -371,6 +387,22 @@
 footer.content =
    block+
 
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ glossary.entry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# ~~~~~~ glossary.entry
+glossary.entry= element entry {
+   glossary.entry.attributes, glossary.entry.content }
+
+glossary.entry.attributes =
+   xmlid.attribute
+
+glossary.entry.content =
+   mainterm,
+   meanings+,
+   seealso*
+
+# ~~~~~~ mainterm
+mainterm = element mainterm { mainterm.content }
+mainterm.content = simple.inlines
 
 # =============================================================================
 #                                 BLOCK LEVEL
@@ -402,7 +434,7 @@
 \list = element list {
    block.head?,
    (  (attribute type {"ordered"}?, item, item+)
-    | (attribute type {"glossary"}, glossary.item+) )
+    | (attribute type {"glossary"}, item.glossary+) )
 }
 
 # ~~~~~~ item
@@ -412,10 +444,10 @@
    inlines
  | block+
 
-# ~~~~~~ glossary.item
-glossary.item = element item { glossary.item.content }
+# ~~~~~~ item.glossary
+item.glossary = element item { item.glossary.content }
 
-glossary.item.content =
+item.glossary.content =
    label,
    block+
 
@@ -718,6 +750,60 @@
 
 pages.content = xsd:positiveInteger
 
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ meanings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# ~~~~~~ meanings
+meanings = element meanings { meanings.attributes, meanings.content }
+
+meanings.attributes =
+   gramcode.attribute?
+gramcode.attribute = attribute gramcode { xsd:NMTOKEN }
+
+meanings.content =
+   female?,
+   plural?,
+   meaning+
+
+# ~~~~~~ female, plural
+female = element female { inlines }
+plural = element plural { inlines }
+
+# ~~~~~~ meaning
+meaning = element meaning { meaning.attributes, meaning.content }
+
+meaning.attributes =
+   meaning.domain.attribute?
+ & langlevel.attribute?
+meaning.domain.attribute = attribute domain { xsd:NMTOKEN }
+langlevel.attribute = attribute langlevel { xsd:NMTOKEN }
+
+meaning.content =
+   ((definition, example*, synonym*, antonym*, translation*)
+    | (definition?, example*, synonym*, antonym*, translation+)
+    | (definition?, example*, synonym+, antonym*, translation*)
+    | (definition?, example*, synonym*, antonym+, translation*)),
+   dictum*
+
+# ~~~~~~ definition
+definition = element definition { inlines }
+
+# ~~~~~~ synonym, antonym
+synonym = element synonym { simple.inlines }
+antonym = element antonym { simple.inlines }
+
+# ~~~~~~ translation
+translation = element translation { simple.inlines }
+
+# ~~~~~~ dictum
+dictum = element dictum { inlines }
+
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ seealso ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+seealso = element seealso { seealso.attributes }
+
+seealso.attributes =
+   gloss.ref.attribute
+
 
 # =============================================================================
 #                                 INLINE LEVEL
@@ -747,6 +833,7 @@
  & mentioned*
  & literal*
  & term*
+ & example*
  & stage*
  & name*
  & foreign*
@@ -758,6 +845,7 @@
  & link*
  & anchor*
  & index*
+ & gloss*
  & image*
  & audio*
  & smil*
@@ -821,6 +909,12 @@
 
 term.content = mixed { sup* & warning* }
 
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ example ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+example = element example { example.content }
+   
+example.content = inlines
+
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ stage ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 stage = element stage { stage.content }
@@ -941,6 +1035,16 @@
 
 anchor.content = simple.inlines
 
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gloss ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+gloss = element gloss { gloss.attributes, gloss.content }
+
+gloss.attributes =
+   gloss.ref.attribute
+gloss.ref.attribute = attribute ref { xsd:NCName }
+
+gloss.content = simple.inlines
+
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ smil ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 smil = element smil { smil.attributes, smil.content }