Ajout de la bibliographie
authorPatrick PIERRE
dim., 07 avril 2013 17:05:34 +0200
changeset 189 951f1a25efc5
parent 188 b9fea8bd2412
child 190 546609a92447
Ajout de la bibliographie
RelaxNG/Examples/Documents/torture_test.xml
RelaxNG/Examples/Topics/portugal_ue.xml
RelaxNG/publidoc.rnc
RelaxNG/publiset.rnc
--- a/RelaxNG/Examples/Documents/torture_test.xml	sam. avril 06 14:17:18 2013 +0200
+++ b/RelaxNG/Examples/Documents/torture_test.xml	dim. avril 07 17:05:34 2013 +0200
@@ -32,7 +32,7 @@
       <source type="book">
         <identifier type="ean">9782843550362</identifier>
         <title>L'art de mettre à l'épreuve</title>
-        <pagenumber>312</pagenumber>
+        <pages>312</pages>
       </source>
       <source type="file">
         <identifier type="uri">hugo_miserables.xml</identifier>
@@ -154,6 +154,43 @@
         <section type="sign">
           <p>Jeanson Henri (signature)</p>
         </section>
+        <bibliography>
+          <entry>
+            <identifier type="ean">9782877065073</identifier>
+            <title>La gloire de mon père</title>
+            <contributors>
+              <contributor>
+                <firstname>Marcel</firstname>
+                <lastname>PAGNOL</lastname>
+                <role>author</role>
+              </contributor>
+              <contributor>
+                <label>De Fallois</label>
+                <role>publisher</role>
+              </contributor>
+            </contributors>
+            <date value="1988"/>
+            <pages>217</pages>
+          </entry>
+          <entry>
+            <identifier type="ean">9782253096334</identifier>
+            <title>Les Misérables</title>
+            <contributors>
+              <contributor>
+                <firstname>Victor</firstname>
+                <lastname>HUGO</lastname>
+                <role>author</role>
+              </contributor>
+              <contributor>
+                <label>Le Livre de Poche</label>
+                <role>publisher</role>
+              </contributor>
+            </contributors>
+            <date value="1998-12-15"/>
+            <pages>512</pages>
+            <collection>Les classiques</collection>
+          </entry>
+        </bibliography>
         <footer>
           <media><image id="footer"/></media>
         </footer>
--- a/RelaxNG/Examples/Topics/portugal_ue.xml	sam. avril 06 14:17:18 2013 +0200
+++ b/RelaxNG/Examples/Topics/portugal_ue.xml	dim. avril 07 17:05:34 2013 +0200
@@ -10,7 +10,7 @@
       <source type="book">
         <identifier type="ean">9782843550362</identifier>
         <title>Chronique de l'année 2000</title>
-        <pagenumber>4</pagenumber>
+        <folio>4</folio>
       </source>
       <source type="file">
         <identifier type="uri">4z.tex</identifier>
--- a/RelaxNG/publidoc.rnc	sam. avril 06 14:17:18 2013 +0200
+++ b/RelaxNG/publidoc.rnc	dim. avril 07 17:05:34 2013 +0200
@@ -72,6 +72,7 @@
    top.head?,
    header?,
    section+,
+   bibliography?,
    footer?
 
 
@@ -129,6 +130,7 @@
    component.head?,
    header?,
    section+,
+   bibliography?,
    footer?
 
 
@@ -170,6 +172,14 @@
  & audio*
  & annotation*
 
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bibliography ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# ~~~~~~ bibliography
+bibliography = element bibliography { bibliography.content }
+
+bibliography.content =
+   bibliography.entry+
+
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ footer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 footer = element footer { footer.content }
@@ -304,18 +314,18 @@
  & rowsep.attribute?
 
 row.content =
-  entry+
+  table.entry+
 
-# ~~~~~~ entry
-entry = element entry { entry.attributes, entry.content }
+# ~~~~~~ table.entry
+table.entry = element entry { table.entry.attributes, table.entry.content }
 
-entry.attributes =
+table.entry.attributes =
    align.attribute?
  & valign.attribute?
  & colsep.attribute?
  & rowsep.attribute?
 
-entry.content =
+table.entry.content =
    inlines
  | (p | media)+
 
@@ -398,6 +408,33 @@
    x.attribute?
  & y.attribute?
 
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bibliograpgy.entry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# ~~~~~~ bibliography.entry
+bibliography.entry = element entry { bibliography.entry.content }
+
+bibliography.entry.content =
+   identifier.ean?
+ & title
+ & subtitle?
+ & copyright?
+ & collection?
+ & contributors?
+ & date?
+ & place?
+ & folio?
+ & pages?
+
+# ~~~~~~ folio
+folio = element folio { folio.content }
+
+folio.content = xsd:positiveInteger | xsd:token {pattern = "[DLXVI]+"}
+
+# ~~~~~~ pages
+pages = element pages { pages.content }
+
+pages.content = xsd:positiveInteger
+
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ scenario ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 # ~~~~~~ scenario
@@ -507,28 +544,18 @@
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-# ~~~~~~ source
 source = element source {
-   (  (attribute type { "book" }, source.content.book)
+   (  (attribute type { "book" }, bibliography.entry.content)
     | (attribute type { "file" }, source.content.file)),
    source.content
 }
 
-source.content.book =
-   identifier.ean,
-   title?,
-   pagenumber*
 source.content.file =
    identifier.uri
 source.content =
    annotation*
 
-# ~~~~~~ pagenumber
-pagenumber = element pagenumber { pagenumber.content }
-
-pagenumber.content = xsd:positiveInteger
-
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~ keyword & subject ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ keyword & subject ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 # ~~~~~~ keywordset
 keywordset = element keywordset { keywordset.content }
--- a/RelaxNG/publiset.rnc	sam. avril 06 14:17:18 2013 +0200
+++ b/RelaxNG/publiset.rnc	dim. avril 07 17:05:34 2013 +0200
@@ -53,11 +53,13 @@
 
 composition.head.content =
    (title, shorttitle?, subtitle?)?
- & identifier*
+ & (identifier, identifier?)?
  & copyright*
  & collection?
  & contributors?
+ & date?
  & keywordset?
+ & subjectset?
  & abstract?
  & cover?
 
@@ -224,7 +226,7 @@
 
 role.content = "author" | "illustrator" | "publisher" | "packager"
 
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ keyword ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ keyword & subject ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 # ~~~~~~ keywordset
 keywordset = element keywordset { keywordset.content }
@@ -236,6 +238,16 @@
 
 keyword.content = mixed { sup*, sub* }
 
+# ~~~~~~ subjectset
+subjectset = element subjectset { subjectset.content }
+
+subjectset.content = subject+
+
+# ~~~~~~ subject
+subject = element subject { subject.content }
+
+subject.content = xsd:NMTOKEN
+
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ abstract ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 abstract = element abstract { abstract.content }
@@ -266,8 +278,10 @@
 inlines = mixed {
    sup*
  & sub*
+ & date*
  & name*
  & highlight*
+ & link*
 }
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub, sup ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -276,6 +290,16 @@
 
 sub = element sub { inlines }
 
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ date ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+date = element date { date.attributes, date.content }
+
+date.attributes =
+   date.value.attribute
+date.value.attribute = attribute value { xsd:date | xsd:gYearMonth | xsd:gYear }
+
+date.content = mixed { sup* }
+
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ name ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 name = element name { name.attributes, name.content }
@@ -283,7 +307,7 @@
 name.attributes =
    name.of.attribute?
 name.of.attribute = attribute of
-   { "person" | "company" | "book" | "newspaper" | "party" }
+   { "person" | "company" | "book" | "newspaper" | "party" | "painting" }
 
 name.content = inlines