RelaxNG/publiset.rnc
changeset 96 4817d2fa8801
parent 66 29c53c3d676e
child 97 e28caa4cbf4c
--- a/RelaxNG/publiset.rnc	ven. avril 27 17:13:49 2012 +0200
+++ b/RelaxNG/publiset.rnc	ven. avril 27 19:13:50 2012 +0200
@@ -22,6 +22,7 @@
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ composition ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+# ~~~~~~ composition
 composition = element composition {
    composition.attributes,
    composition.content
@@ -44,8 +45,24 @@
    composition.head?,
    (composition.division | composition.file)+
 
+# ~~~~~~ composition.head
+composition.head = element head {
+   composition.head.attributes, composition.head.content }
+
+composition.head.attributes =
+   remap.attributes
+
+composition.head.content =
+   (title, subtitle?)?
+ & identifier*
+ & copyright?
+ & contributors?
+ & abstract?
+ & cover?
+
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ selection ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+# ~~~~~~ selection
 selection = element selection {
    selection.attributes,
    selection.content
@@ -61,30 +78,85 @@
    selection.head?,
    (selection.division | selection.file | link)+
 
+# ~~~~~~ selection.head
+selection.head = element head { composition.head.content }
+
+
+# =============================================================================
+#                                DIVISION LEVEL
+# =============================================================================
+
+# ~~~~~~ division
+composition.division = element division {
+   composition.division.attributes,
+   composition.division.content
+}
+selection.division = element division {
+   selection.division.attributes,
+   selection.division.content
+}
+
+composition.division.attributes =
+   path.attribute?
+ & xpath.attribute?
+ & xslt.attribute?
+ & transform.attribute?
+ & remap.attributes
+selection.division.attributes =
+   path.attribute?
+transform.attribute = attribute transform { xsd:anyURI }
+
+composition.division.content =
+   composition.head?,
+   (composition.division | composition.file)+
+selection.division.content =
+   selection.head?,
+   (selection.division | selection.file | link)+
+
+# ~~~~~~ division.head
+division.head = element head { division.head.content }
+
+division.head.content =
+   (title, subtitle?)?
+
+
+# =============================================================================
+#                                  FILE LEVEL
+# =============================================================================
+
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ file ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+composition.file = element file { composition.file.attributes }
+selection.file = element file { selection.file.attributes, file.content }
+
+composition.file.attributes =
+   name.attribute
+ & xpath.attribute?
+ & xslt.attribute?
+selection.file.attributes =
+   name.attribute
+ & uri.attribute?
+name.attribute = attribute name { xsd:anyURI }
+
+file.content = inlines
+
+
+# =============================================================================
+#                                 BLOCK LEVEL
+# =============================================================================
+
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+p = element p { p.content }
+
+p.content =
+   inlines
+
 
 # =============================================================================
 #                                  HEAD LEVEL
 # =============================================================================
 
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-composition.head = element head { head.attributes, top.head.content }
-selection.head = element head { top.head.content }
-division.head = element head { division.head.content }
-
-head.attributes =
-   remap.attributes
-
-top.head.content =
-   (title, subtitle?)?
- & identifier*
- & copyright?
- & contributors?
- & abstract?
- & cover?
-division.head.content =
-   (title, subtitle?)?
-
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ title, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 title = element title { title.content }
@@ -170,68 +242,6 @@
 
 
 # =============================================================================
-#                                DIVISION LEVEL
-# =============================================================================
-
-composition.division = element division {
-   composition.division.attributes,
-   composition.division.content
-}
-selection.division = element division {
-   selection.division.attributes,
-   selection.division.content
-}
-
-composition.division.attributes =
-   path.attribute?
- & xpath.attribute?
- & xslt.attribute?
- & remap.attributes
-selection.division.attributes =
-   path.attribute?
-
-composition.division.content =
-   composition.head?,
-   (composition.division | composition.file)+
-selection.division.content =
-   selection.head?,
-   (selection.division | selection.file | link)+
-
-
-# =============================================================================
-#                                  FILE LEVEL
-# =============================================================================
-
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ file ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-composition.file = element file { composition.file.attributes }
-selection.file = element file { selection.file.attributes, file.content }
-
-composition.file.attributes =
-   name.attribute
- & xpath.attribute?
- & xslt.attribute?
-selection.file.attributes =
-   name.attribute
- & uri.attribute?
-name.attribute = attribute name { xsd:anyURI }
-
-file.content = inlines
-
-
-# =============================================================================
-#                                 BLOCK LEVEL
-# =============================================================================
-
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-p = element p { p.content }
-
-p.content =
-   inlines
-
-
-# =============================================================================
 #                                 INLINE LEVEL
 # =============================================================================