--- a/RelaxNG/publidoc.rnc dim. juin 05 12:02:50 2011 +0200
+++ b/RelaxNG/publidoc.rnc dim. juin 05 16:26:16 2011 +0200
@@ -8,13 +8,10 @@
publidoc.content
}
-# ~~~~~~ attributes
publidoc.attributes =
version.attribute
-
version.attribute = attribute version { "1.0" }
-# ~~~~~~ content
publidoc.content =
document
| top.topic
@@ -28,13 +25,10 @@
document = element document { document.attributes, document.content }
-# ~~~~~~ attributes
document.attributes =
document.id.attribute
-
document.id.attribute = attribute xml:id { xsd:ID }
-# ~~~~~~ content
document.content =
metadata?,
(division+ | topic+)
@@ -65,19 +59,10 @@
& abstract?
& annotation*
-language = element language { language.attributes }
-language.attributes = lang.attribute
-lang.attribute = attribute xml:lang { xsd:language }
-
-place = element place { place.content }
-place.content = inlines
-
-abstract = element abstract { abstract.content }
-abstract.content = parag+
-
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ title, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
title = element title { title.content }
+
title.content = inlines
subtitle = element subtitle { title.content }
@@ -94,8 +79,22 @@
publisher.content = inlines
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Language ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+language = element language { language.attributes }
+
+language.attributes = lang.attribute
+lang.attribute = attribute xml:lang { xsd:language }
+
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ place ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+place = element place { place.content }
+
+place.content = inlines
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# ~~~~~~ source
source = element source {
source.attributes,
( (attribute type { "book" }, source.content.book)
@@ -103,21 +102,19 @@
source.content
}
-# ~~~~~~ Attributes
source.attributes =
source.id.attribute
-
source.id.attribute = attribute id { xsd:NMTOKEN }
-# ~~~~~~ Content
source.content.book =
title,
pagenumber*
-
source.content =
annotation*
+# ~~~~~~ pagenumber
pagenumber = element pagenumber { pagenumber.attributes }
+
pagenumber.attributes =
pagenumber.value.attribute
pagenumber.value.attribute = attribute value { pagenumber.value.enumeration }
@@ -125,15 +122,25 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ subject ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# ~~~~~~ subjectset
subjectset = element subjectset { subjectset.content }
subjectset.content = subject+
+# ~~~~~~ subject
subject = element subject { subject.attributes }
+
subject.attributes =
subject.id.attribute
subject.id.attribute = attribute id { xsd:NMTOKEN }
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ abstract ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+abstract = element abstract { abstract.content }
+
+abstract.content =
+ parag+
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ annotation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
annotation = element annotation { annotation.content }
@@ -162,20 +169,15 @@
topic = element topic { topic.attributes, topic.content }
-# ~~~~~~ attributes
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 }
-# ~~~~~~ content
topic.content =
metadata?,
section+
@@ -213,6 +215,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# ~~~~~~ media
media = element media { media.content }
media.content =
@@ -221,10 +224,13 @@
media.id.attribute = attribute id { xsd:NMTOKEN }
+# ~~~~~~ caption
media.caption = element caption { media.caption.content }
-media.caption.content = parag+
-# ~~~~~~ Image
+media.caption.content =
+ parag+
+
+# ~~~~~~ image
image = element image { image.attributes, image.content }
image.attributes =
@@ -233,6 +239,7 @@
image.content =
copyright?
+# ~~~~~~ copyright
copyright = element copyright { copyright.content }
copyright.content = inlines
@@ -269,33 +276,36 @@
date = element date { date.attributes, date.content }
date.attributes = date.of.attribute
-
date.of.attribute = attribute of { date.of.enumeration }
date.of.enumeration = "event" | "birth" | "death"
date.content = xsd:date | xsd:gYearMonth | xsd:gYear
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ name ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ name ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
firstname = element firstname { inlines }
lastname = element lastname { inlines }
name = element name { name.attributes, name.content }
-name.attributes = name.of.attribute?
-name.content = inlines
+
+name.attributes =
+ name.of.attribute?
name.of.attribute = attribute of { name.of.enumeration }
name.of.enumeration = "person" | "company" | "book" | "newspaper" | "party"
+name.content = inlines
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ footnote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
footnote = element footnote { footnote.attributes, footnote.content }
-footnote.attributes = footnote.label.attribute?
-
+footnote.attributes =
+ footnote.label.attribute?
footnote.label.attribute = attribute label { text }
-footnote.content = parag+
+footnote.content =
+ parag+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foreign ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~