Index: /trunk/biblioentry_xml.xsl
===================================================================
--- /trunk/biblioentry_xml.xsl	(revision 65)
+++ /trunk/biblioentry_xml.xsl	(revision 66)
@@ -13,4 +13,8 @@
 update :
 $Id$
+fplod 2008-05-14T08:51:10Z aedon.locean-ipsl.upmc.fr (Darwin)
+introducting bibtex (latex) output
+fplod 2008-05-13T15:24:49Z aedon.locean-ipsl.upmc.fr (Darwin)
+add parameter type (default raw)
 fplod 2008-05-13T09:17:14Z aedon.locean-ipsl.upmc.fr (Darwin)
 bibliomisc is written after biblioid
@@ -45,62 +49,176 @@
 <xsl:template name="one_biblioentry">
  <xsl:param name="visu_modif"/>
+ <xsl:param name="type"/>
  <xsl:param name="my_biblioentry"/>
+ <xsl:choose>
+  <xsl:when test="$type = 'bibtex'">
+   <xsl:choose>
+    <xsl:when test="$my_biblioentry/descendant::d:biblioset[@relation='journal']">
+     <xsl:text>@article{</xsl:text>
+    </xsl:when>
+    <xsl:when test="$my_biblioentry/descendant::d:biblioset[@relation='conference']">
+     <xsl:text>@inproceedings{</xsl:text>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:message terminate="yes">
+eee : unknown biblioset relation for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
+eee : <xsl:value-of select="$my_biblioentry/descendant::d:biblioset/@relation"/>
+     </xsl:message>
+    </xsl:otherwise>
+   </xsl:choose>
+   <xsl:value-of select="$my_biblioentry/@xml:id"/>
+  </xsl:when> <!-- end of bibtex specific header for biblioentry -->
+ </xsl:choose>
  <xsl:element name="listitem">
   <xsl:element name="para">
-    <xsl:apply-templates select="$my_biblioentry/d:authorgroup"/>
-    <xsl:text>, </xsl:text>
-    <xsl:if test="$my_biblioentry/descendant::d:pubdate">
-     <xsl:apply-templates select="$my_biblioentry/descendant::d:pubdate"/>
-    </xsl:if>
+   <xsl:choose>
+    <xsl:when test="$type = 'bibtex'">
+     <xsl:apply-templates select="$my_biblioentry/d:authorgroup" mode="bibtex"/>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:apply-templates select="$my_biblioentry/d:authorgroup" mode="raw"/>
+    </xsl:otherwise>
+   </xsl:choose>
+   <xsl:if test="$my_biblioentry/descendant::d:pubdate">
+    <xsl:choose>
+     <xsl:when test="$type = 'bibtex'">
+      <xsl:apply-templates select="$my_biblioentry/descendant::d:pubdate" mode="bibtex"/>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-templates select="$my_biblioentry/descendant::d:pubdate" mode="raw"/>
+     </xsl:otherwise>
+    </xsl:choose>
+   </xsl:if>
     <xsl:if test="$my_biblioentry/descendant::d:date">
      <xsl:apply-templates select="$my_biblioentry/descendant::d:date"/>
     </xsl:if>
-    <xsl:text> : </xsl:text>
-    <xsl:apply-templates select="$my_biblioentry/d:title"/>
-    <xsl:text>, </xsl:text>
+   <xsl:choose>
+    <xsl:when test="$type = 'bibtex'">
+     <xsl:apply-templates select="$my_biblioentry/d:title" mode="bibtex"/>
+    </xsl:when>
+    <xsl:otherwise>
+     <xsl:apply-templates select="$my_biblioentry/d:title" mode="raw"/>
+    </xsl:otherwise>
+   </xsl:choose>
     <xsl:choose>
      <xsl:when test="$my_biblioentry/descendant::d:biblioset[@relation='journal']">
-      <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:title"/>
+      <xsl:choose>
+       <xsl:when test="$type = 'bibtex'">
+        <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:title" mode="bibtex"/>
+       </xsl:when>
+       <xsl:otherwise>
+        <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:title" mode="raw"/>
+       </xsl:otherwise>
+      </xsl:choose>
       <xsl:if test="$my_biblioentry/descendant::d:publishername">
-       <xsl:text>, </xsl:text>
-       <xsl:apply-templates select="$my_biblioentry/descendant::d:publishername"/>
+       <xsl:choose>
+        <xsl:when test="$type = 'bibtex'">
+         <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:publishername" mode="bibtex"/>
+        </xsl:when>
+        <xsl:otherwise>
+         <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:publishername" mode="raw"/>
+        </xsl:otherwise>
+       </xsl:choose>
       </xsl:if>
       <xsl:if test="$my_biblioentry/descendant::d:publisher/d:address">
-       <xsl:text>, </xsl:text>
-       <xsl:apply-templates select="$my_biblioentry/descendant::d:publisher/d:address"/>
+       <xsl:choose>
+        <xsl:when test="$type = 'bibtex'">
+         <xsl:apply-templates select="$my_biblioentry/descendant::d:publisher/d:address" mode="bibtex"/>
+        </xsl:when>
+        <xsl:otherwise>
+         <xsl:apply-templates select="$my_biblioentry/descendant::d:publisher/d:address" mode="raw"/>
+        </xsl:otherwise>
+       </xsl:choose>
       </xsl:if>
       <xsl:if test="$my_biblioentry/descendant::d:volumenum">
-       <xsl:text>, </xsl:text>
-       <xsl:apply-templates select="$my_biblioentry/descendant::d:volumenum"/>
+       <xsl:choose>
+        <xsl:when test="$type = 'bibtex'">
+         <xsl:apply-templates select="$my_biblioentry/descendant::d:volumenum" mode="bibtex"/>
+        </xsl:when>
+        <xsl:otherwise>
+         <xsl:apply-templates select="$my_biblioentry/descendant::d:volumenum" mode="raw"/>
+        </xsl:otherwise>
+       </xsl:choose>
        <xsl:if test="$my_biblioentry/descendant::d:issuenum">
-        <xsl:text>, </xsl:text>
-        <xsl:apply-templates select="$my_biblioentry/descendant::d:issuenum"/>
+        <xsl:choose>
+         <xsl:when test="$type = 'bibtex'">
+          <xsl:apply-templates select="$my_biblioentry/descendant::d:issuenum" mode="bibtex"/>
+         </xsl:when>
+         <xsl:otherwise>
+          <xsl:apply-templates select="$my_biblioentry/descendant::d:issuenum" mode="raw"/>
+         </xsl:otherwise>
+        </xsl:choose>
+        </xsl:if>
        </xsl:if>
+      <xsl:if test="$my_biblioentry/descendant::d:pagenums">
+       <xsl:choose>
+        <xsl:when test="$type = 'bibtex'">
+         <xsl:apply-templates select="$my_biblioentry/descendant::d:pagenums" mode="bibtex"/>
+        </xsl:when>
+        <xsl:otherwise>
+         <xsl:apply-templates select="$my_biblioentry/descendant::d:pagenums" mode="raw"/>
+        </xsl:otherwise>
+       </xsl:choose>
       </xsl:if>
-      <xsl:if test="$my_biblioentry/descendant::d:pagenums">
-       <xsl:text>, </xsl:text>
-       <xsl:apply-templates select="$my_biblioentry/descendant::d:pagenums"/>
+      <xsl:if test="$my_biblioentry/d:biblioid">
+       <xsl:choose>
+        <xsl:when test="$type = 'bibtex'">
+         <xsl:apply-templates select="$my_biblioentry/d:biblioid" mode="bibtex"/>
+        </xsl:when>
+        <xsl:otherwise>
+        <xsl:apply-templates select="$my_biblioentry/d:bibliomisc" mode="raw"/>
+        </xsl:otherwise>
+       </xsl:choose>
       </xsl:if>
-      <xsl:apply-templates select="$my_biblioentry/d:biblioid"/>
       <xsl:if test="$my_biblioentry/descendant::d:biblioset/child::d:bibliomisc">
-       <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:bibliomisc"/>
+       <xsl:choose>
+        <xsl:when test="$type = 'bibtex'">
+         <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:bibliomisc" mode="bibtex"/>
+        </xsl:when>
+        <xsl:otherwise>
+        <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:bibliomisc" mode="raw"/>
+        </xsl:otherwise>
+       </xsl:choose>
       </xsl:if>
      </xsl:when>
      <xsl:when test="$my_biblioentry/descendant::d:biblioset[@relation='conference']">
-      <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:title"/>
-      <xsl:text>, </xsl:text>
+      <xsl:choose>
+       <xsl:when test="$type = 'bibtex'">
+        <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset[@relation='conference']/child::d:title" mode="bibtex"/>
+       </xsl:when>
+       <xsl:otherwise>
+        <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:title" mode="raw"/>
+       </xsl:otherwise>
+      </xsl:choose>
       <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:conftitle"/>
       <xsl:if test="$my_biblioentry/descendant::d:biblioset/descendant::d:confnum">
        <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:confnum"/>
       </xsl:if>
-      <xsl:text>, </xsl:text>
       <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:confdates"/>
-      <xsl:text>, </xsl:text>
-      <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:address"/>
-      <xsl:text>, </xsl:text>
-      <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:publishername"/>
+       <xsl:choose>
+        <xsl:when test="$type = 'bibtex'">
+         <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:address" mode="bibtex"/>
+        </xsl:when>
+        <xsl:otherwise>
+         <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:address" mode="raw"/>
+        </xsl:otherwise>
+       </xsl:choose>
+       <xsl:choose>
+        <xsl:when test="$type = 'bibtex'">
+         <xsl:apply-templates select="$my_biblioentry/descendant::d:publishername" mode="bibtex"/>
+        </xsl:when>
+        <xsl:otherwise>
+         <xsl:apply-templates select="$my_biblioentry/descendant::d:publishername" mode="raw"/>
+        </xsl:otherwise>
+       </xsl:choose>
       <xsl:if test="$my_biblioentry/descendant::d:pagenums">
-       <xsl:text>, </xsl:text>
-       <xsl:apply-templates select="$my_biblioentry/descendant::d:pagenums"/>
+       <xsl:choose>
+        <xsl:when test="$type = 'bibtex'">
+         <xsl:apply-templates select="$my_biblioentry/descendant::d:pagenums" mode="bibtex"/>
+        </xsl:when>
+        <xsl:otherwise>
+         <xsl:apply-templates select="$my_biblioentry/descendant::d:pagenums" mode="raw"/>
+        </xsl:otherwise>
+       </xsl:choose>
       </xsl:if>
      </xsl:when>
@@ -110,5 +228,12 @@
 eee : <xsl:value-of select="$my_biblioentry/descendant::d:biblioset/@relation"/>
       </xsl:message>
-      <xsl:apply-templates select="$my_biblioentry/descendant::d:publishername"/>
+       <xsl:choose>
+        <xsl:when test="$type = 'bibtex'">
+         <xsl:apply-templates select="$my_biblioentry/descendant::d:publishername" mode="bibtex"/>
+        </xsl:when>
+        <xsl:otherwise>
+         <xsl:apply-templates select="$my_biblioentry/descendant::d:publishername" mode="raw"/>
+        </xsl:otherwise>
+       </xsl:choose>
      </xsl:otherwise>
     </xsl:choose>
@@ -125,9 +250,22 @@
   </xsl:if>
  </xsl:element>
-</xsl:template>
-
-<xsl:template match="d:authorgroup">
+ <xsl:choose>
+  <xsl:when test="$type = 'bibtex'">
+  <xsl:text>}</xsl:text>
+  </xsl:when>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="d:authorgroup" mode="raw">
  <xsl:apply-templates select="d:author"/>
  <xsl:apply-templates select="d:corpauthor"/>
+</xsl:template>
+
+<xsl:template match="d:authorgroup" mode="bibtex">
+ <xsl:text>, </xsl:text>
+ <xsl:text>author = {</xsl:text>
+ <xsl:apply-templates select="d:author"/>
+ <xsl:apply-templates select="d:corpauthor"/>
+ <xsl:text>} </xsl:text>
 </xsl:template>
 
@@ -204,22 +342,59 @@
 </xsl:template>
 
-<xsl:template match="d:biblioentry/d:title">
-  <xsl:value-of select="normalize-space(.)"/>
-</xsl:template>
-
-<xsl:template match="d:biblioset[@relation='journal']/d:title">
-  <xsl:value-of select="normalize-space(.)"/>
-</xsl:template>
-
-<xsl:template match="d:publishername">
-  <xsl:value-of select="normalize-space(.)"/>
-</xsl:template>
-
-<xsl:template match="d:biblioset[@relation='journal']/d:pubdate">
-  <xsl:value-of select="normalize-space(.)"/>
-</xsl:template>
-<xsl:template match="d:biblioset[@relation='conference']/d:pubdate">
-  <xsl:value-of select="normalize-space(.)"/>
-</xsl:template>
+<xsl:template match="d:biblioentry/d:title" mode="raw">
+ <xsl:text> : </xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+</xsl:template>
+
+<xsl:template match="d:biblioentry/d:title" mode="bibtex">
+ <xsl:text>, title = {</xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+ <xsl:text>}</xsl:text>
+</xsl:template>
+
+<xsl:template match="d:biblioset[@relation='journal']/d:title" mode="raw">
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+</xsl:template>
+
+<xsl:template match="d:biblioset[@relation='journal']/d:title" mode="bibtex">
+ <xsl:text>, journal = {</xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+ <xsl:text>} </xsl:text>
+</xsl:template>
+
+<xsl:template match="d:biblioset[@relation='conference']/d:title" mode="raw">
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+</xsl:template>
+
+<xsl:template match="d:biblioset[@relation='conference']/d:title" mode="bibtex">
+ <xsl:text>, inproceedings = {</xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+ <xsl:text>} </xsl:text>
+</xsl:template>
+
+<xsl:template match="d:publishername" mode="raw">
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+</xsl:template>
+
+<xsl:template match="d:publishername" mode="bibtex">
+ <xsl:text>, publisher = {</xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+ <xsl:text>} </xsl:text>
+</xsl:template>
+
+<xsl:template match="d:pubdate" mode="raw">
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+</xsl:template>
+
+<xsl:template match="d:pubdate" mode="bibtex">
+ <xsl:text>, year = {</xsl:text>
+ <xsl:value-of select="normalize-space(.)"/> 
+ <xsl:text>} </xsl:text>
+</xsl:template>
+
 <xsl:template match="d:date">
  <xsl:message terminate="no">
@@ -231,34 +406,131 @@
 </xsl:template>
 
-<xsl:template match="d:biblioset[@relation='journal']/d:volumenum">
-  <xsl:value-of select="normalize-space(.)"/>
-</xsl:template>
-
-<xsl:template match="d:biblioset[@relation='journal']/d:issuenum">
-  <xsl:value-of select="normalize-space(.)"/>
-</xsl:template>
-
-<xsl:template match="d:biblioset[@relation='journal']/d:pagesnum">
-  <xsl:value-of select="normalize-space(.)"/>
-</xsl:template>
-
-<xsl:template match="d:biblioset[@relation='conference']/d:title">
-<!-- title of proceedings for instance -->
- <xsl:value-of select="normalize-space(.)"/>
+<xsl:template match="d:volumenum" mode="raw">
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+</xsl:template>
+
+<xsl:template match="d:volumenum" mode="bibtex">
+ <xsl:text>, volume = {</xsl:text>
+ <xsl:value-of select="normalize-space(.)"/> 
+ <xsl:text>} </xsl:text>
+</xsl:template>
+
+<xsl:template match="d:issuenum" mode="raw">
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+</xsl:template>
+
+<xsl:template match="d:issuenum" mode="bibtex">
+ <xsl:text>, number = {</xsl:text>
+ <xsl:value-of select="normalize-space(.)"/> 
+ <xsl:text>} </xsl:text>
+</xsl:template>
+
+<xsl:template match="d:pagenums" mode="raw">
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+</xsl:template>
+
+<xsl:template match="d:pagenums" mode="bibtex">
+ <xsl:text>, pages = {</xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+ <xsl:text>} </xsl:text>
+</xsl:template>
+
+<xsl:template match="d:biblioid[@class='isbn']" mode="raw">
+ <xsl:text>, ISBN : </xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+</xsl:template>
+
+<xsl:template match="d:biblioid[@class='isbn']" mode="bibtex">
+ <xsl:text>, isbn = {</xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+ <xsl:text>} </xsl:text>
+</xsl:template>
+
+
+<xsl:template match="d:biblioid[@class='other']" mode="raw">
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="@otherclass"/>
+ <xsl:text> : </xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+</xsl:template>
+
+<xsl:template match="d:biblioid[@class='other']" mode="bibtex">
+ <xsl:text>, note = {</xsl:text>
+ <xsl:value-of select="@otherclass"/>
+ <xsl:text> : </xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+ <xsl:text>} </xsl:text>
+</xsl:template>
+
+<xsl:template match="d:biblioid[@class='doi']" mode="bibtex">
+ <xsl:message terminate="no">
+BBBB
+ </xsl:message>
+   <xsl:choose>
+    <xsl:when test=". = '???'">
+     <xsl:message> iii : no doi found for 
+      <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
+     </xsl:message>
+    </xsl:when>
+    <xsl:otherwise>
+     <!-- ++ transformer 10.1029/2003GL018906 en un lien sur http://dx.doi.org/10.1029/2003GL018906 par exemple
+  -->
+      <xsl:text>, doi = {</xsl:text> <!-- ++ pas sûre, peut-être seulement note = {doi:..} -->
+      <xsl:value-of select="normalize-space(.)"/>
+    </xsl:otherwise>
+   </xsl:choose>
+ <xsl:text>} </xsl:text>
+</xsl:template>
+
+<xsl:template match="d:biblioid[@class='doi']" mode="raw">
+   <xsl:choose>
+    <xsl:when test=". = '???'">
+     <xsl:message> iii : no doi found for
+      <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
+     </xsl:message>
+    </xsl:when>
+    <xsl:otherwise>
+     <!-- transformer 10.1029/2003GL018906 en un lien sur http://dx.doi.org/10.1029/2003GL018906 par exemple -->
+     <xsl:text>, </xsl:text>
+     <xsl:element name="link">
+      <xsl:attribute name="xl:href">
+       <xsl:text>http://dx.doi.org/</xsl:text>
+       <xsl:value-of select="normalize-space(.)"/>
+      </xsl:attribute>
+      <xsl:text>doi:</xsl:text><xsl:value-of select="normalize-space(.)"/>
+     </xsl:element>
+    </xsl:otherwise>
+   </xsl:choose>
+ <xsl:value-of select="normalize-space(.)"/>
+ <xsl:text>, </xsl:text>
 </xsl:template>
 
 <xsl:template match="d:conftitle">
-  <xsl:value-of select="normalize-space(.)"/>
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
 </xsl:template>
 
 <xsl:template match="d:confdates">
-  <xsl:value-of select="normalize-space(.)"/>
-</xsl:template>
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+</xsl:template>
+
 <xsl:template match="d:confnum">
-  <xsl:value-of select="normalize-space(.)"/>
-</xsl:template>
-
-<xsl:template match="d:address">
-  <xsl:value-of select="normalize-space(.)"/>
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+</xsl:template>
+
+<xsl:template match="d:address" mode="raw">
+ <xsl:text>, </xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+</xsl:template>
+
+<xsl:template match="d:address" mode="bibtex">
+ <xsl:text>, address = {</xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+ <xsl:text>} </xsl:text>
 </xsl:template>
 
@@ -266,63 +538,36 @@
 <xsl:choose>
 <xsl:when test="@class='doi'">
- <xsl:choose>
-  <xsl:when test=". = '???'">
-   <xsl:message> iii : no doi found for 
-    <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
-   </xsl:message>
-  </xsl:when>
- <xsl:otherwise>
-  <!-- transformer 10.1029/2003GL018906 en un lien sur http://dx.doi.org/10.1029/2003GL018906 par exemple
-  -->
-  <xsl:text>, </xsl:text>
-  <xsl:element name="link">
-   <xsl:attribute name="xl:href">
-    <xsl:text>http://dx.doi.org/</xsl:text>
-    <xsl:value-of select="normalize-space(.)"/>
-   </xsl:attribute>
-   <xsl:text>doi:</xsl:text><xsl:value-of select="normalize-space(.)"/>
-  </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:apply-templates select="." mode="bibtex"/>
+ <xsl:message terminate="no">
+AAAA <xsl:value-of select="normalize-space(.)"/>
+ </xsl:message>
 </xsl:when>
 <xsl:when test="@class='isbn'">
- <xsl:text>, ISBN : </xsl:text><xsl:value-of select="normalize-space(.)"/>
+ <xsl:apply-templates select="." mode="bibtex"/>
 </xsl:when>
 <xsl:when test="@class='other'">
- <xsl:text>, </xsl:text><xsl:value-of select="@otherclass"/><xsl:text> : </xsl:text><xsl:value-of select="normalize-space(.)"/>
+ <xsl:apply-templates select="." mode="bibtex"/>
+ <xsl:message terminate="no">
+CCCC <xsl:value-of select="normalize-space(.)"/>
+ </xsl:message>
+</xsl:when>
+<xsl:otherwise>
+ <xsl:message terminate="yes">
+eee : unknown biblioid class for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
+eee : class : <xsl:value-of select="normalize-space(@class)"/>
+eee : value : <xsl:value-of select="normalize-space(.)"/>
+ </xsl:message>
+</xsl:otherwise>
+</xsl:choose>
+</xsl:template>
+
+<xsl:template match="d:bibliomisc" mode="raw">
+<xsl:choose>
+<xsl:when test="contains(.,'In Press') or contains(.,'In press') or contains(.,'in press') or contains(.,'in revision') or contains(.,'submitted')">
+ <xsl:value-of select="normalize-space(.)"/>
+ <xsl:text>, </xsl:text>
 </xsl:when>
 <xsl:otherwise>
  <xsl:message terminate="no">
-eee : unknown biblioid class for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
-eee : <xsl:value-of select="normalize-space(.)"/>
- </xsl:message>
-</xsl:otherwise>
-</xsl:choose>
-</xsl:template>
-
-<xsl:template match="d:bibliomisc">
-<xsl:choose>
-<xsl:when test="contains(.,'In Press')">
- <xsl:text>, </xsl:text>
- <xsl:value-of select="normalize-space(.)"/>
-</xsl:when>
-<xsl:when test="contains(.,'In press')">
- <xsl:text>, </xsl:text>
- <xsl:value-of select="normalize-space(.)"/>
-</xsl:when>
-<xsl:when test="contains(.,'in press')">
- <xsl:text>, </xsl:text>
- <xsl:value-of select="normalize-space(.)"/>
-</xsl:when>
-<xsl:when test="contains(.,'in revision')">
- <xsl:text>, </xsl:text>
- <xsl:value-of select="normalize-space(.)"/>
-</xsl:when>
-<xsl:when test="contains(.,'submitted')">
- <xsl:text>, </xsl:text>
- <xsl:value-of select="normalize-space(.)"/>
-</xsl:when>
-<xsl:otherwise>
- <xsl:message>
 eee : unknown bibliomisc purpose for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
 eee : <xsl:value-of select="normalize-space(.)"/>
@@ -334,3 +579,22 @@
 </xsl:template>
 
+<xsl:template match="d:bibliomisc" mode="bibtex">
+<xsl:choose>
+<xsl:when test="contains(.,'In Press') or contains(.,'In press') or contains(.,'in press') or contains(.,'in revision') or contains(.,'submitted')">
+   <xsl:text>, note = {</xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+   <xsl:text>} </xsl:text>
+</xsl:when>
+<xsl:otherwise>
+ <xsl:message terminate="no">
+eee : unknown bibliomisc purpose for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>
+eee : <xsl:value-of select="normalize-space(.)"/>
+ </xsl:message>
+ <xsl:text>, note = {</xsl:text>
+ <xsl:value-of select="normalize-space(.)"/>
+ <xsl:text>} </xsl:text>
+</xsl:otherwise>
+</xsl:choose>
+</xsl:template>
+
 </xsl:stylesheet>
Index: /trunk/bibopa.sh
===================================================================
--- /trunk/bibopa.sh	(revision 65)
+++ /trunk/bibopa.sh	(revision 66)
@@ -417,5 +417,5 @@
 # strip comments
 fileraw_strict=/tmp/$(basename ${fileraw})_strict
-grep -v "^#" ${fileraw} > ${fileraw_strict}
+grep -v "^#" ${fileraw} | grep -v "^%" > ${fileraw_strict}
 totlines=$( wc -l ${fileraw_strict} | awk '{print $1}' )
 l=1
@@ -435,6 +435,8 @@
      # before the last ,
        auths=${tmp%,*},
-     # replace "and" by ","
+     # replace " and " by ","
        auths=$( echo "${auths}" | sed -e "s/ and /,/g" )
+     # replace " et " by ","
+       auths=$( echo "${auths}" | sed -e "s/ et /,/g" )
      # after the last ,
        year=${tmp##*,}
@@ -712,5 +714,5 @@
           pag=${endline##*,}
 	  pag=$( cleanname "${pag}" )
-#set 
+#set
 #read a
 	  cat <<EOF >> ${fileou}
@@ -736,5 +738,5 @@
       ;;
       10)
-          publishername=${endline%%Editors,*} 
+          publishername=${endline%%Editors,*}
           publishername="${publishername} Editors"
           publishername=$( cleanname "${publishername}" )
@@ -771,5 +773,5 @@
 EOF
       unset isbn
-      unset agu 
+      unset agu
       unset pag
       unset publishername
@@ -800,5 +802,5 @@
   unset title
   unset vol
-  unset year 
+  unset year
   unset pag
   l=$(( ${l} + 1 ))
Index: /trunk/makefile
===================================================================
--- /trunk/makefile	(revision 65)
+++ /trunk/makefile	(revision 66)
@@ -177,6 +177,9 @@
 clean :
 	-@rm -fr $(DIRWWW)/
-	-@rm -f $(DIRTMP)/bibdemo1_dbk5.txt
-	-@rm -f $(DIRTMP)/bibdemo1_dbk5.xml
+	-@rm -f $(DIRTMP)/bibdemo1_dbk5_1.txt
+	-@rm -f $(DIRTMP)/bibdemo1_dbk5_2.txt
+	-@rm -f $(DIRTMP)/bibdemo1_dbk5_1.xml
+	-@rm -f $(DIRTMP)/bibdemo1_dbk5_2.xml
+	-@rm -f $(DIRTMP)/bibdemo1_dbk5.bib
 	-@rm -f $(DIRTMP)/bibnemo1.xml
 	-@rm -f $(DIRTMP)/bibnemo1.txt
@@ -548,18 +551,20 @@
 
 test_raw : \
-test_raw_demo1 \
+test_raw_demo1_1 \
+test_raw_demo1_2 \
 test_raw_nemo1 \
 test_raw_nemoall
 
-test_raw_demo1 : \
+test_raw_demo1_1 : \
 $(DIRSRC)/data/bibdemo1_dbk5.xml \
-$(DIRTMP)/bibdemo1_dbk5.xml \
-$(DIRTMP)/bibdemo1_dbk5.txt
-	diff -b $(DIRTMP)/bibdemo1_dbk5.xml $(DIRSRC)/data/bibdemo1_dbk5.xml | more
-	rm -i $(DIRTMP)/bibdemo1_dbk5.xml $(DIRTMP)/bibdemo1_dbk5.txt
-
-$(DIRTMP)/bibdemo1_dbk5.txt : \
+$(DIRTMP)/bibdemo1_dbk5_1.xml \
+$(DIRTMP)/bibdemo1_dbk5_1.txt
+	diff -b $(DIRTMP)/bibdemo1_dbk5_1.xml $(DIRSRC)/data/bibdemo1_dbk5.xml | more
+	rm -i $(DIRTMP)/bibdemo1_dbk5_1.xml $(DIRTMP)/bibdemo1_dbk5_1.txt
+
+$(DIRTMP)/bibdemo1_dbk5_1.txt : \
 $(DIRSRC)/data/bibdemo1_dbk5.xml \
-$(DIRSRC)/superbib01_txt.xsl
+$(DIRSRC)/superbib01_txt.xsl \
+$(DIRSRC)/biblioentry_xml.xsl
 	xsltproc --param makedate "'$(MAKEDATE)'" \
  	--output $@ \
@@ -567,8 +572,29 @@
 	$(DIRSRC)/data/bibdemo1_dbk5.xml
 
-$(DIRTMP)/bibdemo1_dbk5.xml : \
-$(DIRTMP)/bibdemo1_dbk5.txt \
+$(DIRTMP)/bibdemo1_dbk5_1.xml : \
+$(DIRTMP)/bibdemo1_dbk5_1.txt \
 $(DIRSRC)/bibopa.sh
-	$(DIRSRC)/bibopa.sh -p demo1 -i $(DIRTMP)/bibdemo1_dbk5.txt -t raw -l fr
+	$(DIRSRC)/bibopa.sh -p demo1 -i $(DIRTMP)/bibdemo1_dbk5_1.txt -t raw -l fr
+
+test_raw_demo1_2 : \
+$(DIRSRC)/data/bibdemo1_dbk5.xml \
+$(DIRTMP)/bibdemo1_dbk5_2.xml \
+$(DIRTMP)/bibdemo1_dbk5_2.txt
+	diff -b $(DIRTMP)/bibdemo1_dbk5_2.xml $(DIRSRC)/data/bibdemo1_dbk5.xml | more
+	rm -i $(DIRTMP)/bibdemo1_dbk5_2.xml $(DIRTMP)/bibdemo1_dbk5_2.txt
+
+$(DIRTMP)/bibdemo1_dbk5_2.txt : \
+$(DIRSRC)/data/bibdemo1_dbk5.xml \
+$(DIRSRC)/superbib02_txt.xsl \
+$(DIRSRC)/biblioentry_xml.xsl
+	xsltproc --param makedate "'$(MAKEDATE)'" \
+ 	--output $@ \
+  	$(DIRSRC)/superbib02_txt.xsl \
+	$(DIRSRC)/data/bibdemo1_dbk5.xml
+
+$(DIRTMP)/bibdemo1_dbk5_2.xml : \
+$(DIRTMP)/bibdemo1_dbk5_2.txt \
+$(DIRSRC)/bibopa.sh
+	$(DIRSRC)/bibopa.sh -p demo1 -i $(DIRTMP)/bibdemo1_dbk5_2.txt -t bibtex -l fr
 
 test_raw_nemo1 : \
@@ -581,5 +607,6 @@
 $(DIRTMP)/bibnemo1.txt : \
 $(DIRSRC)/data/bibnemo1.xml \
-$(DIRSRC)/superbib01_txt.xsl
+$(DIRSRC)/superbib01_txt.xsl \
+$(DIRSRC)/biblioentry_xml.xsl
 	xsltproc --param makedate "'$(MAKEDATE)'" \
  	--output $@ \
@@ -601,5 +628,6 @@
 $(DIRTMP)/bibnemoall.txt : \
 $(DIRSRC)/data/biball.xml \
-$(DIRSRC)/superbib01_txt.xsl
+$(DIRSRC)/superbib01_txt.xsl \
+$(DIRSRC)/biblioentry_xml.xsl
 	xsltproc --param makedate "'$(MAKEDATE)'" \
  	--output $@ \
Index: /trunk/superbib01_txt.xsl
===================================================================
--- /trunk/superbib01_txt.xsl	(revision 65)
+++ /trunk/superbib01_txt.xsl	(revision 66)
@@ -7,12 +7,12 @@
 <!--
 module :
-transformation docbook en un texte
+transformation of a DocBook file into a text file eatable by bibopa.sh 
 
 example pour test demo1
 $ xsltproc \-\-param makedate "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'" \
-  \-\-output /tmp/bibdemo_dbk5.txt \
-  superbib01_txt.xsl data/bibdemo_dbk5.xml
+  \-\-output /tmp/bibdemo1_dbk5.txt \
+  superbib01_txt.xsl data/bibdemo1_dbk5.xml
 $ ./bibopa.sh -p demo1 -i /tmp/bibdemo1_dbk5.txt -t raw -l fr
-$ diff biblio.xml data/bibdemo_dbk5.xml
+$ diff biblio.xml data/bibdemo1_dbk5.xml
 
 update :
@@ -40,4 +40,5 @@
  <xsl:call-template name="one_biblioentry">
  <xsl:with-param name="visu_modif" select="'visu'"/>
+ <xsl:with-param name="type" select="'raw'"/>
  <xsl:with-param name="my_biblioentry" select="."/>
 </xsl:call-template>
Index: /trunk/superbib01_xml.xsl
===================================================================
--- /trunk/superbib01_xml.xsl	(revision 65)
+++ /trunk/superbib01_xml.xsl	(revision 66)
@@ -231,4 +231,5 @@
     <xsl:call-template name="one_biblioentry">
      <xsl:with-param name="visu_modif" select="'visu'"/>
+     <xsl:with-param name="type" select="'raw'"/>
      <xsl:with-param name="my_biblioentry" select="."/>
     </xsl:call-template>
Index: /trunk/superbib02_txt.xsl
===================================================================
--- /trunk/superbib02_txt.xsl	(revision 66)
+++ /trunk/superbib02_txt.xsl	(revision 66)
@@ -0,0 +1,48 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+<xsl:stylesheet
+xmlns:d="http://docbook.org/ns/docbook"
+xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+version="1.0">
+
+<!--
+module :
+transformation of a DocBook file into a BibTeX file
+
+example pour test demo1
+$ xsltproc \-\-param makedate "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'" \
+  \-\-output /tmp/bibdemo1_dbk5.bib \
+  superbib02_txt.xsl data/bibdemo1_dbk5.xml
+$ ./bibopa.sh -p demo1 -i /tmp/bibdemo1_dbk5.bib -t bibtex -l fr
+$ diff biblio.xml data/bibdemo1_dbk5.xml
+
+update :
+$Id$
+not finished
+fplod 2008-05-13T15:12:47Z aedon.locean-ipsl.upmc.fr (Darwin)
+creation
+-->
+
+<!--
+<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"/>
+-->
+
+<xsl:output method="text"
+encoding="ISO-8859-1"
+indent="yes"/>
+
+<xsl:include href="biblioentry_xml.xsl"/>
+
+<xsl:template match="d:bibliography">
+<xsl:text>% update </xsl:text><xsl:value-of select="$makedate"/>
+<xsl:text>&#xA;</xsl:text>
+<xsl:for-each select="d:biblioentry">
+ <xsl:call-template name="one_biblioentry">
+ <xsl:with-param name="visu_modif" select="'visu'"/>
+ <xsl:with-param name="type" select="'bibtex'"/>
+ <xsl:with-param name="my_biblioentry" select="."/>
+</xsl:call-template>
+<xsl:text>&#xA;</xsl:text>
+
+</xsl:for-each>
+</xsl:template>
+</xsl:stylesheet>
Index: /trunk/superbib02_xml.xsl
===================================================================
--- /trunk/superbib02_xml.xsl	(revision 65)
+++ /trunk/superbib02_xml.xsl	(revision 66)
@@ -193,4 +193,5 @@
   <xsl:call-template name="one_biblioentry">
    <xsl:with-param name="visu_modif" select="'visu'"/>
+   <xsl:with-param name="type" select="'raw'"/>
    <xsl:with-param name="my_biblioentry" select="ancestor::d:biblioentry"/>
   </xsl:call-template>
Index: /trunk/superbibmany01_xml.xsl
===================================================================
--- /trunk/superbibmany01_xml.xsl	(revision 65)
+++ /trunk/superbibmany01_xml.xsl	(revision 66)
@@ -179,4 +179,5 @@
   <xsl:call-template name="one_biblioentry">
    <xsl:with-param name="visu_modif" select="'visu'"/>
+   <xsl:with-param name="type" select="'raw'"/>
    <xsl:with-param name="my_biblioentry" select="ancestor::d:biblioentry"/>
   </xsl:call-template>
