--- a/RelaxNG/publidoc.rnc mer. juil. 20 15:05:37 2011 +0200
+++ b/RelaxNG/publidoc.rnc mer. juil. 20 22:57:09 2011 +0200
@@ -47,6 +47,7 @@
top.head?,
section+
+
# =============================================================================
# HEAD LEVEL
# =============================================================================
@@ -69,6 +70,7 @@
& date?
& place?
& source*
+ & keywordset?
& subjectset?
& abstract?
& cover?
@@ -196,7 +198,17 @@
pagenumber.value.attribute
pagenumber.value.attribute = attribute value { xsd:positiveInteger }
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ subject ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ keyword & subject ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# ~~~~~~ keywordset
+keywordset = element keywordset { keywordset.content }
+
+keywordset.content = keyword+
+
+# ~~~~~~ keyword
+keyword = element keyword { keyword.content }
+
+keyword.content = text
# ~~~~~~ subjectset
subjectset = element subjectset { subjectset.content }
--- a/RelaxNG/publidoc.rng mer. juil. 20 15:05:37 2011 +0200
+++ b/RelaxNG/publidoc.rng mer. juil. 20 22:57:09 2011 +0200
@@ -154,6 +154,9 @@
<ref name="source"/>
</zeroOrMore>
<optional>
+ <ref name="keywordset"/>
+ </optional>
+ <optional>
<ref name="subjectset"/>
</optional>
<optional>
@@ -434,7 +437,27 @@
<data type="positiveInteger"/>
</attribute>
</define>
- <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ subject ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ keyword & subject ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <!-- ~~~~~~ keywordset -->
+ <define name="keywordset">
+ <element name="keywordset">
+ <ref name="keywordset.content"/>
+ </element>
+ </define>
+ <define name="keywordset.content">
+ <oneOrMore>
+ <ref name="keyword"/>
+ </oneOrMore>
+ </define>
+ <!-- ~~~~~~ keyword -->
+ <define name="keyword">
+ <element name="keyword">
+ <ref name="keyword.content"/>
+ </element>
+ </define>
+ <define name="keyword.content">
+ <text/>
+ </define>
<!-- ~~~~~~ subjectset -->
<define name="subjectset">
<element name="subjectset">
--- a/RelaxNG/publiset.rnc mer. juil. 20 15:05:37 2011 +0200
+++ b/RelaxNG/publiset.rnc mer. juil. 20 22:57:09 2011 +0200
@@ -79,7 +79,6 @@
& copyright?
& author*
& publisher?
- & source?
& cover?
division.head.content =
(title, subtitle?)?
@@ -160,29 +159,6 @@
label.content = inlines
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-# ~~~~~~ source
-source = element source {
- ( (attribute type { "book" }, source.content.book)
- | (attribute type { "file" }, source.content.file))
-}
-
-source.content.book =
- identifier.ean,
- title?,
- pagenumber*
-source.content.file =
- identifier.uri
-
-# ~~~~~~ pagenumber
-pagenumber = element pagenumber { pagenumber.attributes }
-
-pagenumber.attributes =
- pagenumber.value.attribute
-pagenumber.value.attribute = attribute value { pagenumber.value.enumeration }
-pagenumber.value.enumeration = xsd:positiveInteger
-
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cover ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cover = element cover { cover.content }
--- a/RelaxNG/publiset.rng mer. juil. 20 15:05:37 2011 +0200
+++ b/RelaxNG/publiset.rng mer. juil. 20 22:57:09 2011 +0200
@@ -163,9 +163,6 @@
<ref name="publisher"/>
</optional>
<optional>
- <ref name="source"/>
- </optional>
- <optional>
<ref name="cover"/>
</optional>
</interleave>
@@ -330,55 +327,6 @@
<define name="label.content">
<ref name="inlines"/>
</define>
- <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <!-- ~~~~~~ source -->
- <define name="source">
- <element name="source">
- <choice>
- <group>
- <attribute name="type">
- <value>book</value>
- </attribute>
- <ref name="source.content.book"/>
- </group>
- <group>
- <attribute name="type">
- <value>file</value>
- </attribute>
- <ref name="source.content.file"/>
- </group>
- </choice>
- </element>
- </define>
- <define name="source.content.book">
- <ref name="identifier.ean"/>
- <optional>
- <ref name="title"/>
- </optional>
- <zeroOrMore>
- <ref name="pagenumber"/>
- </zeroOrMore>
- </define>
- <define name="source.content.file">
- <ref name="identifier.uri"/>
- </define>
- <!-- ~~~~~~ pagenumber -->
- <define name="pagenumber">
- <element name="pagenumber">
- <ref name="pagenumber.attributes"/>
- </element>
- </define>
- <define name="pagenumber.attributes">
- <ref name="pagenumber.value.attribute"/>
- </define>
- <define name="pagenumber.value.attribute">
- <attribute name="value">
- <ref name="pagenumber.value.enumeration"/>
- </attribute>
- </define>
- <define name="pagenumber.value.enumeration">
- <data type="positiveInteger"/>
- </define>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cover ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<define name="cover">
<element name="cover">
--- a/Xml/Documents/torture_test.xml mer. juil. 20 15:05:37 2011 +0200
+++ b/Xml/Documents/torture_test.xml mer. juil. 20 22:57:09 2011 +0200
@@ -30,6 +30,11 @@
<source type="file">
<identifier type="uri">hugo_miserables.xml</identifier>
</source>
+ <keywordset>
+ <keyword>publidoc</keyword>
+ <keyword>Cyrano</keyword>
+ <keyword>météo</keyword>
+ </keywordset>
<subjectset>
<subject id="test"/>
<subject id="littérature"/>