RelaxNG/publidoc.rnc
changeset 288 e89c967167bb
parent 285 aace9a2da668
child 289 3cc4f942de2c
--- a/RelaxNG/publidoc.rnc	mar. janv. 07 19:33:45 2014 +0100
+++ b/RelaxNG/publidoc.rnc	ven. janv. 10 16:50:33 2014 +0100
@@ -37,6 +37,7 @@
  & keywordset?
  & subjectset?
  & abstract?
+ & head.index*
  & cover?
  & annotation*
 
@@ -123,6 +124,7 @@
  & place?
  & keywordset?
  & subjectset?
+ & head.index*
  & abstract?
  & annotation*
 
@@ -178,6 +180,7 @@
    (title, shorttitle?, subtitle*)?
  & keywordset?
  & subjectset?
+ & head.index*
  & abstract?
  & audio*
  & annotation*
@@ -212,6 +215,7 @@
 
 block.head.content =
    (title, shorttitle?, subtitle*)?
+ & head.index*
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -397,13 +401,13 @@
 
 media.content =
    block.head?,
-   (image | audio | video)+,
+   (media.image | audio | video)+,
    media.caption?,
    link?
 
 # ~~~~~~ image
-image = element image { image.attributes, image.content }
-hotspot.image = element image { image.attributes }
+image = element image { image.attributes }
+media.image = element image { image.attributes, media.image.content }
 
 image.attributes =
    media.id.attribute
@@ -411,7 +415,7 @@
 media.id.attribute = attribute id { xsd:NMTOKEN }
 image.type = attribute type { "cover" | "thumbnail" | "icon" | "animation" }
 
-image.content =
+media.image.content =
    copyright?,
    hotspot*
 
@@ -448,7 +452,7 @@
 hotspot.type.attribute = attribute type { xsd:NCName }
    
 hotspot.content =
-   ((link | p+ | hotspot.image | audio | video), (spot, scenario?)?)
+   ((link | p+ | image | audio | video), (spot, scenario?)?)
  | (spot, scenario?)
  | empty 
    
@@ -565,13 +569,13 @@
 
 copyright = element copyright { copyright.content }
 
-copyright.content = inlines
+copyright.content = simple.inlines
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ collection ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 collection = element collection { collection.content }
 
-collection.content = inlines
+collection.content = simple.inlines
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ contributors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -597,15 +601,15 @@
 lastname = element lastname { lastname.content }
 label = element label { label.content }
 
-firstname.content = inlines
-secondname.content = inlines
-lastname.content = inlines
-label.content = inlines
+firstname.content = simple.inlines
+secondname.content = simple.inlines
+lastname.content = simple.inlines
+label.content = simple.inlines
 
 # ~~~~~~ address
 address = element address { address.content }
 
-address.content = inlines
+address.content = simple.inlines
 
 # ~~~~~~ role
 role = element role { role.content }
@@ -616,7 +620,7 @@
 
 place = element place { place.content }
 
-place.content = inlines
+place.content = simple.inlines
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -641,7 +645,7 @@
 # ~~~~~~ keyword
 keyword = element keyword { keyword.content }
 
-keyword.content = mixed { sup*, sub* }
+keyword.content = simple.inlines
 
 # ~~~~~~ subjectset
 subjectset = element subjectset { subjectset.content }
@@ -651,7 +655,25 @@
 # ~~~~~~ subject
 subject = element subject { subject.content }
 
-subject.content = mixed { sup*, sub* }
+subject.content = simple.inlines
+
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ index ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# ~~~~~~ index
+index = element index { index.content }
+head.index = element index { head.index.content }
+
+index.content =
+   (index.w, index.entry?)
+ | (index.entry, (index.w | index.entry)?)
+head.index.content =
+   index.entry, index.entry?
+
+# ~~~~~~ index.w
+index.w = element w { simple.inlines }
+
+# ~~~~~~ index.entry
+index.entry = element entry { simple.inlines }
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ abstract ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -670,8 +692,7 @@
 cover.image = element image { cover.image.attributes }
 
 cover.image.attributes =
-   cover.image.id.attribute
-cover.image.id.attribute = attribute id { xsd:NMTOKEN }
+   media.id.attribute
    
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ annotation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -686,7 +707,7 @@
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-inlines = mixed {
+simple.inlines = mixed {
    sup*
  & sub*
  & var*
@@ -694,24 +715,28 @@
  & math*
  & date*
  & name*
- & foreign*
  & acronym*
  & term*
+ & warning*
+}
+
+inlines =
+   simple.inlines
  & literal*
- & stage*
+ & foreign*
  & highlight*
  & emphasis*
  & mentioned*
+ & stage*
  & initial*
- & note*
  & quote*
- & link*
- & anchor*
  & image*
  & audio*
  & smil*
- & warning*
-}
+ & note*
+ & link*
+ & anchor*
+ & index*
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub, sup, var ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -783,15 +808,6 @@
 
 name.content = mixed { sup* & number* & acronym* & warning* }
 
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foreign ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-foreign = element foreign { foreign.attributes, foreign.content }
-
-foreign.attributes =
-   lang.attribute?
-
-foreign.content = inlines
-
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ acronym ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 acronym = element acronym { acronym.content }
@@ -810,11 +826,14 @@
 
 literal.content = inlines
 
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ stage ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foreign ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-stage = element stage { stage.content }
+foreign = element foreign { foreign.attributes, foreign.content }
 
-stage.content = inlines
+foreign.attributes =
+   lang.attribute?
+
+foreign.content = inlines
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ highlight ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -834,27 +853,22 @@
 
 mentioned.content = inlines
 
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ stage ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+stage = element stage { stage.content }
+
+stage.content = inlines
+
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ initial ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 initial = element initial { initial.content }
 
 initial.content =
-   c,
-   w?
+   initial.c,
+   initial.w?
 
-c = element c { text }
-w = element w { inlines }
-
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ note ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-note = element note { note.attributes, note.content }
-
-note.attributes =
-   note.label.attribute?
-note.label.attribute = attribute label { text }
-
-note.content =
-   (w?, block+) | inlines
+initial.c = element c { text }
+initial.w = element w { inlines }
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ quote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -867,29 +881,6 @@
 
 phrase.content = inlines
 
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ link ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-link = element link { link.attributes, link.content }
-
-link.attributes =
-   (uri.attribute | idref.attribute)
-uri.attribute = attribute uri { xsd:anyURI }
-idref.attribute = attribute idref { xsd:IDREF }
-
-link.content = mixed {
-   sup* & sub* & var* & number* & math* & date* & name* & foreign* & acronym*
- & term* & literal* & stage* & highlight* & emphasis* & mentioned* & warning* }
-
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ anchor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-anchor = element anchor { anchor.attributes, anchor.content }
-
-anchor.attributes =
-   anchor.id.attribute
-anchor.id.attribute = attribute xml:id { xsd:ID }
-
-anchor.content = inlines
-
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ smil ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 smil = element smil { smil.attributes, smil.content }
@@ -904,6 +895,41 @@
 
 smil.content = inlines
 
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ note ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+note = element note { note.attributes, note.content }
+
+note.attributes =
+   note.label.attribute?
+note.label.attribute = attribute label { text }
+
+note.content =
+   (note.w?, block+)
+ | inlines
+
+note.w = element w { inlines }
+
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ link ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+link = element link { link.attributes, link.content }
+
+link.attributes =
+   (uri.attribute | idref.attribute)
+uri.attribute = attribute uri { xsd:anyURI }
+idref.attribute = attribute idref { xsd:IDREF }
+
+link.content = simple.inlines
+
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ anchor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+anchor = element anchor { anchor.attributes, anchor.content }
+
+anchor.attributes =
+   anchor.id.attribute
+anchor.id.attribute = attribute xml:id { xsd:ID }
+
+anchor.content = simple.inlines
+
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 warning = element warning { warning.attributes, warning.content }