RelaxNG/publidoc.rnc
changeset 20 79713ffae179
parent 18 e448c6a000e5
child 22 94b8e4454c47
--- a/RelaxNG/publidoc.rnc	dim. juin 12 14:28:07 2011 +0200
+++ b/RelaxNG/publidoc.rnc	dim. juin 12 15:21:35 2011 +0200
@@ -18,7 +18,7 @@
 
 
 # =============================================================================
-#                                  Top level
+#                                  TOP LEVEL
 # =============================================================================
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ document ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -30,26 +30,36 @@
 document.id.attribute = attribute xml:id { xsd:ID }
 
 document.content =
-   top.metadata?,
+   top.head?,
    (division+ | topic+)
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 top.topic = element topic { top.topic.attributes, top.topic.content }
 
+top.topic.attributes =
+   topic.id.attribute
+ & topic.type.attribute?
+topic.id.attribute = attribute xml:id { xsd:ID }
+topic.type.attribute = attribute type { xsd:NCName }
+
+top.topic.content =
+   top.head?,
+   section+
 
 # =============================================================================
-#                               Metadata level
+#                                 HEAD LEVEL
 # =============================================================================
 
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-top.metadata = element metadata { top.metadata.content }
-division.metadata = element metadata { division.metadata.content }
-component.metadata = element metadata { component.metadata.content }
-section.metadata = element metadata { section.metadata.content }
+top.head = element head { top.head.content }
+division.head = element head { division.head.content }
+component.head = element head { component.head.content }
+section.head = element head { section.head.content }
+block.head = element head { block.head.content }
 
-top.metadata.content =
+top.head.content =
    (title, subtitle?)?
  & language?
  & author*
@@ -60,19 +70,21 @@
  & subjectset?
  & abstract?
  & annotation*
-division.metadata.content =
+division.head.content =
    (title, subtitle?)?
  & language?
  & annotation*
-component.metadata.content =
+component.head.content =
    (title, subtitle?)?
  & language?
  & author*
  & annotation*
-section.metadata.content =
+section.head.content =
    (title, subtitle?)?
  & language?
  & annotation*
+block.head.content =
+   (title, subtitle?)?
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ title, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -165,7 +177,7 @@
 abstract = element abstract { abstract.content }
 
 abstract.content =
-   parag+
+   p+
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ annotation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -175,7 +187,7 @@
 
 
 # =============================================================================
-#                                 Division level
+#                                 DIVISION LEVEL
 # =============================================================================
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ division ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -183,45 +195,37 @@
 division = element division { division.content }
 
 division.content =
-   division.metadata?,
+   division.head?,
    (division+ | topic+)
 
 
 # =============================================================================
-#                               Component level
+#                               COMPONENT LEVEL
 # =============================================================================
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 topic = element topic { topic.attributes, topic.content }
 
-top.topic.attributes =
-   topic.id.attribute
- & topic.type.attribute?
 topic.attributes =
    topic.id.attribute?
  & topic.type.attribute?
-topic.id.attribute = attribute xml:id { xsd:ID }
-topic.type.attribute = attribute type { xsd:NCName }
 
-top.topic.content =
-   top.metadata?,
-   section+
 topic.content =
-   component.metadata?,
+   component.head?,
    section+
 
 
 # =============================================================================
-#                                 Section level
+#                                 SECTION LEVEL
 # =============================================================================
 
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 section = element section { section.content, section.attributes }
 
 section.content =
-   section.metadata?,
+   section.head?,
    (section+ | block+)
 
 section.attributes =
@@ -230,18 +234,18 @@
 
 
 # =============================================================================
-#                                 Block level
+#                                 BLOCK LEVEL
 # =============================================================================
 
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-block = (parag | speech | \list | table | media)
+block = (p | speech | \list | table | media)
 
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ parag ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-parag = element parag { parag.content }
+p = element p { p.content }
 
-parag.content =
+p.content =
    inlines
  & link*
 
@@ -253,7 +257,7 @@
 speech.content =
    speaker?,
    stage?,
-   parag+
+   p+
 
 # ~~~~~~ speaker
 speaker = element speaker { speaker.content }
@@ -271,7 +275,7 @@
 \list = element list { \list.content }
 
 \list.content =
-   title?,
+   block.head?,
    (  (attribute type {"ordered"} ?, item, item+)
     | (attribute type {"glossary"}, glossary.item+) )
 
@@ -297,7 +301,7 @@
 table = element table { table.content }
 
 table.content =
-   title?,
+   block.head?,
    tgroup+,
    caption?
 
@@ -346,13 +350,14 @@
 
 entry.content =
    inlines
- | parag+
+ | p+
 
 # ~~~~~~ caption
 caption = element caption { caption.content }
 
 caption.content =
-   parag+
+   inlines
+ | p+
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -380,7 +385,7 @@
 
 
 # =============================================================================
-#                                 Inline level
+#                                 INLINE LEVEL
 # =============================================================================
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -454,7 +459,7 @@
 
 note.content =
    inlines
- | parag+
+ | p+
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foreign ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~