RelaxNG/publiset.rnc
changeset 38 3c8b406be906
parent 36 d23cfb7be79e
child 39 7faa356bad3e
--- a/RelaxNG/publiset.rnc	mar. juil. 19 18:16:50 2011 +0200
+++ b/RelaxNG/publiset.rnc	mer. juil. 20 14:38:48 2011 +0200
@@ -93,13 +93,15 @@
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ identifier ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-identifier = element identifier { identifier.content, identifier.attributes }
+identifier.uri = element identifier {
+   attribute type { "uri" }, xsd:anyURI
+}
 
-identifier.attributes =
-   class.attribute
-class.attribute = attribute class { "uri" | "ean" }
+identifier.ean = element identifier {
+   attribute type { "ean" }, xsd:token {pattern = "\d{13}"}
+}
 
-identifier.content =  xsd:anyURI | xsd:NMTOKEN
+identifier = identifier.uri | identifier.ean
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ language ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -139,11 +141,6 @@
 
 lastname.content = inlines
 
-# ~~~~~~ label
-label = element label { label.content }
-
-label.content = inlines
-
 # ~~~~~~ role
 role = element role { role.attributes }
 
@@ -151,23 +148,25 @@
    role.of.attribute
 role.of.attribute = attribute of { "author" | "illustrator" }
 
+# ~~~~~~ label
+label = element label { label.content }
+
+label.content = inlines
+
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 # ~~~~~~ source
 source = element source {
-   source.attributes,
    (  (attribute type { "book" }, source.content.book)
-    | (attribute type { "file" }))
+    | (attribute type { "file" }, source.content.file))
 }
 
-source.attributes =
-   source.id.attribute?
- & remap.attributes
-source.id.attribute = attribute id { xsd:NMTOKEN }
-
 source.content.book =
+   identifier.ean,
    title?,
-   pagenumber?
+   pagenumber*
+source.content.file =
+   identifier.uri
 
 # ~~~~~~ pagenumber
 pagenumber = element pagenumber { pagenumber.attributes }