--- a/RelaxNG/publidoc.rnc sam. juin 11 20:35:18 2011 +0200
+++ b/RelaxNG/publidoc.rnc dim. juin 12 14:17:23 2011 +0200
@@ -30,12 +30,12 @@
document.id.attribute = attribute xml:id { xsd:ID }
document.content =
- metadata?,
+ top.metadata?,
(division+ | topic+)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-top.topic = element topic { top.topic.attributes, topic.content }
+top.topic = element topic { top.topic.attributes, top.topic.content }
# =============================================================================
@@ -44,28 +44,49 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-metadata = element metadata { metadata.content }
+top.metadata = element metadata { top.metadata.content }
+division.metadata = element metadata { division.metadata.content }
+component.metadata = element metadata { component.metadata.content }
+section.metadata = element metadata { section.metadata.content }
-metadata.content =
- title
- & subtitle?
+top.metadata.content =
+ (title, subtitle?)?
+ & language?
& author*
& publisher?
- & language?
& date?
& place?
& source*
& subjectset?
& abstract?
& annotation*
+division.metadata.content =
+ (title, subtitle?)?
+ & language?
+ & annotation*
+component.metadata.content =
+ (title, subtitle?)?
+ & language?
+ & author*
+ & annotation*
+section.metadata.content =
+ (title, subtitle?)?
+ & language?
+ & annotation*
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ title, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
title = element title { title.content }
+subtitle = element subtitle { title.content }
title.content = inlines
-subtitle = element subtitle { title.content }
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ language ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+language = element language { language.attributes }
+
+language.attributes = lang.attribute
+lang.attribute = attribute xml:lang { xsd:language }
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ author, publisher ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -91,13 +112,6 @@
lastname.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 }
@@ -169,7 +183,7 @@
division = element division { division.content }
division.content =
- metadata?,
+ division.metadata?,
(division+ | topic+)
@@ -190,8 +204,11 @@
topic.id.attribute = attribute xml:id { xsd:ID }
topic.type.attribute = attribute type { xsd:NCName }
+top.topic.content =
+ top.metadata?,
+ section+
topic.content =
- metadata?,
+ component.metadata?,
section+
@@ -204,7 +221,7 @@
section = element section { section.content, section.attributes }
section.content =
- metadata?,
+ section.metadata?,
(section+ | block+)
section.attributes =
@@ -218,7 +235,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-block = (parag | \list | table | speech | media)
+block = (parag | speech | \list | table | media)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ parag ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -228,6 +245,26 @@
inlines
& link*
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# ~~~~~~ speech
+speech = element speech { speech.content }
+
+speech.content =
+ speaker?,
+ stage?,
+ parag+
+
+# ~~~~~~ speaker
+speaker = element speaker { speaker.content }
+
+speaker.content = inlines
+
+# ~~~~~~ stage
+stage = element stage { stage.content }
+
+stage.content = inlines
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~ list
@@ -317,26 +354,6 @@
caption.content =
parag+
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-# ~~~~~~ speech
-speech = element speech { speech.content }
-
-speech.content =
- speaker?,
- stage?,
- parag+
-
-# ~~~~~~ speaker
-speaker = element speaker { speaker.content }
-
-speaker.content = inlines
-
-# ~~~~~~ stage
-stage = element stage { stage.content }
-
-stage.content = inlines
-
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~ media
--- a/RelaxNG/publiset.rnc sam. juin 11 20:35:18 2011 +0200
+++ b/RelaxNG/publiset.rnc dim. juin 12 14:17:23 2011 +0200
@@ -70,20 +70,25 @@
remap.attributes
metadata.content =
- title?
- & subtitle?
+ (title, subtitle?)?
+ & language?
& author*
& publisher?
- & language?
& source?
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ title, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
title = element title { title.content }
+subtitle = element subtitle { title.content }
title.content = inlines
-subtitle = element subtitle { title.content }
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ language ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+language = element language { language.attributes }
+
+language.attributes = lang.attribute
+lang.attribute = attribute xml:lang { xsd:language }
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ author, publisher ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -109,13 +114,6 @@
lastname.content = inlines
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Language ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-language = element language { language.attributes }
-
-language.attributes = lang.attribute
-lang.attribute = attribute xml:lang { xsd:language }
-
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~ source
--- a/Xml/Documents/demi-douce.xml sam. juin 11 20:35:18 2011 +0200
+++ b/Xml/Documents/demi-douce.xml dim. juin 12 14:17:23 2011 +0200
@@ -5,11 +5,11 @@
<metadata>
<title>La demi-douce</title>
<subtitle>Récit</subtitle>
+ <language xml:lang="fr"/>
<author>
<firstname>Henri</firstname><lastname>Ostrowiecki</lastname>
</author>
<publisher>Les éditions des Rosiers</publisher>
- <language xml:lang="fr"/>
<abstract>
<parag>
C'est l'histoire d'un petit garçon qui faillit ne jamais avoir 5 ans
--- a/Xml/Documents/torture_test.xml sam. juin 11 20:35:18 2011 +0200
+++ b/Xml/Documents/torture_test.xml dim. juin 12 14:17:23 2011 +0200
@@ -44,9 +44,6 @@
<metadata>
<title>Les misérables</title>
<subtitle>Extrait</subtitle>
- <author>
- <firstname>Victor</firstname><lastname>HUGO</lastname>
- </author>
</metadata>
<parag>
Cosette et Marius tombèrent à genoux, éperdus, étouffés de larmes,
@@ -69,6 +66,34 @@
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<topic>
<metadata>
+ <title>Les dialogues</title>
+ </metadata>
+ <section>
+ <metadata>
+ <title>Cyrano de Bergerac</title>
+ <subtitle>Extrait</subtitle>
+ </metadata>
+ <speech>
+ <speaker>Le fâcheux</speaker>
+ <parag>
+ Quoi, pas un grand seigneur pour couvrir de son nom ?…
+ </parag>
+ </speech>
+ <speech>
+ <speaker>Cyrano</speaker>
+ <stage>agacé</stage>
+ <parag>
+ Non, ai-je dit deux fois. Faut-il donc que je trisse ?…
+ </parag>
+ <parag>
+ Non, pas de protecteur…mais une protectrice !
+ </parag>
+ </speech>
+ </section>
+ </topic>
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <topic>
+ <metadata>
<title>Les listes</title>
</metadata>
<section>
@@ -139,29 +164,35 @@
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<topic>
<metadata>
- <title>Les dialogues</title>
+ <title>Les tableaux</title>
</metadata>
<section>
- <metadata>
- <title>Cyrano de Bergerac</title>
- <subtitle>Extrait</subtitle>
- </metadata>
- <speech>
- <speaker>Le fâcheux</speaker>
- <parag>
- Quoi, pas un grand seigneur pour couvrir de son nom ?…
- </parag>
- </speech>
- <speech>
- <speaker>Cyrano</speaker>
- <stage>agacé</stage>
- <parag>
- Non, ai-je dit deux fois. Faut-il donc que je trisse ?…
- </parag>
- <parag>
- Non, pas de protecteur…mais une protectrice !
- </parag>
- </speech>
+ <table>
+ <tgroup cols="3" align="left">
+ <thead>
+ <row>
+ <entry>head 1.1</entry>
+ <entry>head 1.2</entry>
+ <entry>head 1.3</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>cell 1.1</entry>
+ <entry>cell 1.2</entry>
+ <entry>cell 1.3</entry>
+ </row>
+ <row>
+ <entry>cell 2.1</entry>
+ <entry>cell 2.2</entry>
+ <entry>cell 2.3</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ <caption>
+ <parag>Légende du tableau</parag>
+ </caption>
+ </table>
</section>
</topic>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->