RelaxNG/publiset.rnc
changeset 2 417bb62f2a77
parent 0 41a5385c69a2
child 5 69310bc35b63
--- a/RelaxNG/publiset.rnc	dim. juin 05 12:02:50 2011 +0200
+++ b/RelaxNG/publiset.rnc	dim. juin 05 16:26:16 2011 +0200
@@ -8,13 +8,10 @@
    publiset.content
 }
 
-# ~~~~~~ attributes
 publiset.attributes =
    version.attribute
-
 version.attribute = attribute version { "1.0" }
 
-# ~~~~~~ content
 publiset.content =
    (composition | selection)+
 
@@ -30,16 +27,13 @@
    composition.content
 }
 
-# ~~~~~~ attributes
 composition.attributes =
    composition.id.attribute
  & base.attribute?
  & remap.attributes
-
 composition.id.attribute = attribute xml:id { xsd:ID }
 base.attribute = attribute xml:base { xsd:anyURI }
 
-# ~~~~~~ content
 composition.content =
    composition.metadata?,
    (composition.file | composition.division)+
@@ -51,13 +45,10 @@
    selection.content
 }
 
-# ~~~~~~ attributes
 selection.attributes =
    base.attribute?
-
 selection.id.attribute = attribute xml:id { xsd:ID }
 
-# ~~~~~~ content
 selection.content =
    selection.metadata?,
    (selection.file | selection.division)+
@@ -73,14 +64,11 @@
    metadata.attributes,
    metadata.content
 }
-
 selection.metadata = element metadata { metadata.content }
 
-# ~~~~~~ attributes
 metadata.attributes =
    remap.attributes
 
-# ~~~~~~ content
 metadata.content =
    title?,
    subtitle?,
@@ -89,31 +77,32 @@
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ title, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 title = element title { title.content }
+
 title.content = inlines
 
 subtitle = element subtitle { title.content }
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+# ~~~~~~ source
 source = element source {
    source.attributes,
    (  (attribute type { "book" }, source.content.book)
     | (attribute type { "file" }))
 }
 
-# ~~~~~~ Attributes
 source.attributes =
    source.id.attribute?
  & remap.attributes
-
 source.id.attribute = attribute id { xsd:NMTOKEN }
 
-# ~~~~~~ Content
 source.content.book =
    title?,
    pagenumber?
 
+# ~~~~~~ pagenumber
 pagenumber = element pagenumber { pagenumber.attributes }
+
 pagenumber.attributes =
    pagenumber.value.attribute
 pagenumber.value.attribute = attribute value { pagenumber.value.enumeration }
@@ -128,25 +117,20 @@
    composition.division.attributes,
    composition.division.content
 }
-
 selection.division = element division {
    selection.division.attributes,
    selection.division.content
 }
 
-# ~~~~~~ attributes
 composition.division.attributes =
    base.attribute?
  & remap.attributes
-
 selection.division.attributes =
    base.attribute?
 
-# ~~~~~~ content
 composition.division.content =
    composition.metadata?,
    (composition.file | composition.division)+
-
 selection.division.content =
    selection.metadata?,
    (selection.file | selection.division)+
@@ -158,24 +142,18 @@
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ file ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-composition.file = element file { composition.file.attributes }
+composition.file = element file { composition.file.attributes, file.content }
+selection.file = element file { selection.file.attributes, file.content }
 
-selection.file = element file { selection.file.attributes }
-
-# ~~~~~~ attributes
 composition.file.attributes =
-   name.attribute
- & xpath.attribute?
+   xpath.attribute?
  & remap.attributes
-
 selection.file.attributes =
-   name.attribute
- & xpath.attribute?
-
-name.attribute = attribute name { text }
+   xpath.attribute?
 xpath.attribute = attribute xpath { text }
 
-
+file.content = xsd:anyURI
+   
 # =============================================================================
 #                                 Inline level
 # =============================================================================
@@ -201,7 +179,6 @@
 remap.attributes =
    as.attribute?
  & attributes.attribute?
-
 as.attribute = attribute as { xsd:QName }
 attributes.attribute =
    attribute attributes {list { (xsd:token {pattern = "\c+=\S+"})+ }}