Changeset 66
- Timestamp:
- 05/14/08 17:35:50 (16 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/biblioentry_xml.xsl
r65 r66 13 13 update : 14 14 $Id$ 15 fplod 2008-05-14T08:51:10Z aedon.locean-ipsl.upmc.fr (Darwin) 16 introducting bibtex (latex) output 17 fplod 2008-05-13T15:24:49Z aedon.locean-ipsl.upmc.fr (Darwin) 18 add parameter type (default raw) 15 19 fplod 2008-05-13T09:17:14Z aedon.locean-ipsl.upmc.fr (Darwin) 16 20 bibliomisc is written after biblioid … … 45 49 <xsl:template name="one_biblioentry"> 46 50 <xsl:param name="visu_modif"/> 51 <xsl:param name="type"/> 47 52 <xsl:param name="my_biblioentry"/> 53 <xsl:choose> 54 <xsl:when test="$type = 'bibtex'"> 55 <xsl:choose> 56 <xsl:when test="$my_biblioentry/descendant::d:biblioset[@relation='journal']"> 57 <xsl:text>@article{</xsl:text> 58 </xsl:when> 59 <xsl:when test="$my_biblioentry/descendant::d:biblioset[@relation='conference']"> 60 <xsl:text>@inproceedings{</xsl:text> 61 </xsl:when> 62 <xsl:otherwise> 63 <xsl:message terminate="yes"> 64 eee : unknown biblioset relation for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/> 65 eee : <xsl:value-of select="$my_biblioentry/descendant::d:biblioset/@relation"/> 66 </xsl:message> 67 </xsl:otherwise> 68 </xsl:choose> 69 <xsl:value-of select="$my_biblioentry/@xml:id"/> 70 </xsl:when> <!-- end of bibtex specific header for biblioentry --> 71 </xsl:choose> 48 72 <xsl:element name="listitem"> 49 73 <xsl:element name="para"> 50 <xsl:apply-templates select="$my_biblioentry/d:authorgroup"/> 51 <xsl:text>, </xsl:text> 52 <xsl:if test="$my_biblioentry/descendant::d:pubdate"> 53 <xsl:apply-templates select="$my_biblioentry/descendant::d:pubdate"/> 54 </xsl:if> 74 <xsl:choose> 75 <xsl:when test="$type = 'bibtex'"> 76 <xsl:apply-templates select="$my_biblioentry/d:authorgroup" mode="bibtex"/> 77 </xsl:when> 78 <xsl:otherwise> 79 <xsl:apply-templates select="$my_biblioentry/d:authorgroup" mode="raw"/> 80 </xsl:otherwise> 81 </xsl:choose> 82 <xsl:if test="$my_biblioentry/descendant::d:pubdate"> 83 <xsl:choose> 84 <xsl:when test="$type = 'bibtex'"> 85 <xsl:apply-templates select="$my_biblioentry/descendant::d:pubdate" mode="bibtex"/> 86 </xsl:when> 87 <xsl:otherwise> 88 <xsl:apply-templates select="$my_biblioentry/descendant::d:pubdate" mode="raw"/> 89 </xsl:otherwise> 90 </xsl:choose> 91 </xsl:if> 55 92 <xsl:if test="$my_biblioentry/descendant::d:date"> 56 93 <xsl:apply-templates select="$my_biblioentry/descendant::d:date"/> 57 94 </xsl:if> 58 <xsl:text> : </xsl:text> 59 <xsl:apply-templates select="$my_biblioentry/d:title"/> 60 <xsl:text>, </xsl:text> 95 <xsl:choose> 96 <xsl:when test="$type = 'bibtex'"> 97 <xsl:apply-templates select="$my_biblioentry/d:title" mode="bibtex"/> 98 </xsl:when> 99 <xsl:otherwise> 100 <xsl:apply-templates select="$my_biblioentry/d:title" mode="raw"/> 101 </xsl:otherwise> 102 </xsl:choose> 61 103 <xsl:choose> 62 104 <xsl:when test="$my_biblioentry/descendant::d:biblioset[@relation='journal']"> 63 <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:title"/> 105 <xsl:choose> 106 <xsl:when test="$type = 'bibtex'"> 107 <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:title" mode="bibtex"/> 108 </xsl:when> 109 <xsl:otherwise> 110 <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:title" mode="raw"/> 111 </xsl:otherwise> 112 </xsl:choose> 64 113 <xsl:if test="$my_biblioentry/descendant::d:publishername"> 65 <xsl:text>, </xsl:text> 66 <xsl:apply-templates select="$my_biblioentry/descendant::d:publishername"/> 114 <xsl:choose> 115 <xsl:when test="$type = 'bibtex'"> 116 <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:publishername" mode="bibtex"/> 117 </xsl:when> 118 <xsl:otherwise> 119 <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:publishername" mode="raw"/> 120 </xsl:otherwise> 121 </xsl:choose> 67 122 </xsl:if> 68 123 <xsl:if test="$my_biblioentry/descendant::d:publisher/d:address"> 69 <xsl:text>, </xsl:text> 70 <xsl:apply-templates select="$my_biblioentry/descendant::d:publisher/d:address"/> 124 <xsl:choose> 125 <xsl:when test="$type = 'bibtex'"> 126 <xsl:apply-templates select="$my_biblioentry/descendant::d:publisher/d:address" mode="bibtex"/> 127 </xsl:when> 128 <xsl:otherwise> 129 <xsl:apply-templates select="$my_biblioentry/descendant::d:publisher/d:address" mode="raw"/> 130 </xsl:otherwise> 131 </xsl:choose> 71 132 </xsl:if> 72 133 <xsl:if test="$my_biblioentry/descendant::d:volumenum"> 73 <xsl:text>, </xsl:text> 74 <xsl:apply-templates select="$my_biblioentry/descendant::d:volumenum"/> 134 <xsl:choose> 135 <xsl:when test="$type = 'bibtex'"> 136 <xsl:apply-templates select="$my_biblioentry/descendant::d:volumenum" mode="bibtex"/> 137 </xsl:when> 138 <xsl:otherwise> 139 <xsl:apply-templates select="$my_biblioentry/descendant::d:volumenum" mode="raw"/> 140 </xsl:otherwise> 141 </xsl:choose> 75 142 <xsl:if test="$my_biblioentry/descendant::d:issuenum"> 76 <xsl:text>, </xsl:text> 77 <xsl:apply-templates select="$my_biblioentry/descendant::d:issuenum"/> 143 <xsl:choose> 144 <xsl:when test="$type = 'bibtex'"> 145 <xsl:apply-templates select="$my_biblioentry/descendant::d:issuenum" mode="bibtex"/> 146 </xsl:when> 147 <xsl:otherwise> 148 <xsl:apply-templates select="$my_biblioentry/descendant::d:issuenum" mode="raw"/> 149 </xsl:otherwise> 150 </xsl:choose> 151 </xsl:if> 78 152 </xsl:if> 153 <xsl:if test="$my_biblioentry/descendant::d:pagenums"> 154 <xsl:choose> 155 <xsl:when test="$type = 'bibtex'"> 156 <xsl:apply-templates select="$my_biblioentry/descendant::d:pagenums" mode="bibtex"/> 157 </xsl:when> 158 <xsl:otherwise> 159 <xsl:apply-templates select="$my_biblioentry/descendant::d:pagenums" mode="raw"/> 160 </xsl:otherwise> 161 </xsl:choose> 79 162 </xsl:if> 80 <xsl:if test="$my_biblioentry/descendant::d:pagenums"> 81 <xsl:text>, </xsl:text> 82 <xsl:apply-templates select="$my_biblioentry/descendant::d:pagenums"/> 163 <xsl:if test="$my_biblioentry/d:biblioid"> 164 <xsl:choose> 165 <xsl:when test="$type = 'bibtex'"> 166 <xsl:apply-templates select="$my_biblioentry/d:biblioid" mode="bibtex"/> 167 </xsl:when> 168 <xsl:otherwise> 169 <xsl:apply-templates select="$my_biblioentry/d:bibliomisc" mode="raw"/> 170 </xsl:otherwise> 171 </xsl:choose> 83 172 </xsl:if> 84 <xsl:apply-templates select="$my_biblioentry/d:biblioid"/>85 173 <xsl:if test="$my_biblioentry/descendant::d:biblioset/child::d:bibliomisc"> 86 <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:bibliomisc"/> 174 <xsl:choose> 175 <xsl:when test="$type = 'bibtex'"> 176 <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:bibliomisc" mode="bibtex"/> 177 </xsl:when> 178 <xsl:otherwise> 179 <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:bibliomisc" mode="raw"/> 180 </xsl:otherwise> 181 </xsl:choose> 87 182 </xsl:if> 88 183 </xsl:when> 89 184 <xsl:when test="$my_biblioentry/descendant::d:biblioset[@relation='conference']"> 90 <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:title"/> 91 <xsl:text>, </xsl:text> 185 <xsl:choose> 186 <xsl:when test="$type = 'bibtex'"> 187 <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset[@relation='conference']/child::d:title" mode="bibtex"/> 188 </xsl:when> 189 <xsl:otherwise> 190 <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/child::d:title" mode="raw"/> 191 </xsl:otherwise> 192 </xsl:choose> 92 193 <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:conftitle"/> 93 194 <xsl:if test="$my_biblioentry/descendant::d:biblioset/descendant::d:confnum"> 94 195 <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:confnum"/> 95 196 </xsl:if> 96 <xsl:text>, </xsl:text>97 197 <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:confdates"/> 98 <xsl:text>, </xsl:text> 99 <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:address"/> 100 <xsl:text>, </xsl:text> 101 <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:publishername"/> 198 <xsl:choose> 199 <xsl:when test="$type = 'bibtex'"> 200 <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:address" mode="bibtex"/> 201 </xsl:when> 202 <xsl:otherwise> 203 <xsl:apply-templates select="$my_biblioentry/descendant::d:biblioset/descendant::d:address" mode="raw"/> 204 </xsl:otherwise> 205 </xsl:choose> 206 <xsl:choose> 207 <xsl:when test="$type = 'bibtex'"> 208 <xsl:apply-templates select="$my_biblioentry/descendant::d:publishername" mode="bibtex"/> 209 </xsl:when> 210 <xsl:otherwise> 211 <xsl:apply-templates select="$my_biblioentry/descendant::d:publishername" mode="raw"/> 212 </xsl:otherwise> 213 </xsl:choose> 102 214 <xsl:if test="$my_biblioentry/descendant::d:pagenums"> 103 <xsl:text>, </xsl:text> 104 <xsl:apply-templates select="$my_biblioentry/descendant::d:pagenums"/> 215 <xsl:choose> 216 <xsl:when test="$type = 'bibtex'"> 217 <xsl:apply-templates select="$my_biblioentry/descendant::d:pagenums" mode="bibtex"/> 218 </xsl:when> 219 <xsl:otherwise> 220 <xsl:apply-templates select="$my_biblioentry/descendant::d:pagenums" mode="raw"/> 221 </xsl:otherwise> 222 </xsl:choose> 105 223 </xsl:if> 106 224 </xsl:when> … … 110 228 eee : <xsl:value-of select="$my_biblioentry/descendant::d:biblioset/@relation"/> 111 229 </xsl:message> 112 <xsl:apply-templates select="$my_biblioentry/descendant::d:publishername"/> 230 <xsl:choose> 231 <xsl:when test="$type = 'bibtex'"> 232 <xsl:apply-templates select="$my_biblioentry/descendant::d:publishername" mode="bibtex"/> 233 </xsl:when> 234 <xsl:otherwise> 235 <xsl:apply-templates select="$my_biblioentry/descendant::d:publishername" mode="raw"/> 236 </xsl:otherwise> 237 </xsl:choose> 113 238 </xsl:otherwise> 114 239 </xsl:choose> … … 125 250 </xsl:if> 126 251 </xsl:element> 127 </xsl:template> 128 129 <xsl:template match="d:authorgroup"> 252 <xsl:choose> 253 <xsl:when test="$type = 'bibtex'"> 254 <xsl:text>}</xsl:text> 255 </xsl:when> 256 </xsl:choose> 257 </xsl:template> 258 259 <xsl:template match="d:authorgroup" mode="raw"> 130 260 <xsl:apply-templates select="d:author"/> 131 261 <xsl:apply-templates select="d:corpauthor"/> 262 </xsl:template> 263 264 <xsl:template match="d:authorgroup" mode="bibtex"> 265 <xsl:text>, </xsl:text> 266 <xsl:text>author = {</xsl:text> 267 <xsl:apply-templates select="d:author"/> 268 <xsl:apply-templates select="d:corpauthor"/> 269 <xsl:text>} </xsl:text> 132 270 </xsl:template> 133 271 … … 204 342 </xsl:template> 205 343 206 <xsl:template match="d:biblioentry/d:title"> 207 <xsl:value-of select="normalize-space(.)"/> 208 </xsl:template> 209 210 <xsl:template match="d:biblioset[@relation='journal']/d:title"> 211 <xsl:value-of select="normalize-space(.)"/> 212 </xsl:template> 213 214 <xsl:template match="d:publishername"> 215 <xsl:value-of select="normalize-space(.)"/> 216 </xsl:template> 217 218 <xsl:template match="d:biblioset[@relation='journal']/d:pubdate"> 219 <xsl:value-of select="normalize-space(.)"/> 220 </xsl:template> 221 <xsl:template match="d:biblioset[@relation='conference']/d:pubdate"> 222 <xsl:value-of select="normalize-space(.)"/> 223 </xsl:template> 344 <xsl:template match="d:biblioentry/d:title" mode="raw"> 345 <xsl:text> : </xsl:text> 346 <xsl:value-of select="normalize-space(.)"/> 347 </xsl:template> 348 349 <xsl:template match="d:biblioentry/d:title" mode="bibtex"> 350 <xsl:text>, title = {</xsl:text> 351 <xsl:value-of select="normalize-space(.)"/> 352 <xsl:text>}</xsl:text> 353 </xsl:template> 354 355 <xsl:template match="d:biblioset[@relation='journal']/d:title" mode="raw"> 356 <xsl:text>, </xsl:text> 357 <xsl:value-of select="normalize-space(.)"/> 358 </xsl:template> 359 360 <xsl:template match="d:biblioset[@relation='journal']/d:title" mode="bibtex"> 361 <xsl:text>, journal = {</xsl:text> 362 <xsl:value-of select="normalize-space(.)"/> 363 <xsl:text>} </xsl:text> 364 </xsl:template> 365 366 <xsl:template match="d:biblioset[@relation='conference']/d:title" mode="raw"> 367 <xsl:text>, </xsl:text> 368 <xsl:value-of select="normalize-space(.)"/> 369 </xsl:template> 370 371 <xsl:template match="d:biblioset[@relation='conference']/d:title" mode="bibtex"> 372 <xsl:text>, inproceedings = {</xsl:text> 373 <xsl:value-of select="normalize-space(.)"/> 374 <xsl:text>} </xsl:text> 375 </xsl:template> 376 377 <xsl:template match="d:publishername" mode="raw"> 378 <xsl:text>, </xsl:text> 379 <xsl:value-of select="normalize-space(.)"/> 380 </xsl:template> 381 382 <xsl:template match="d:publishername" mode="bibtex"> 383 <xsl:text>, publisher = {</xsl:text> 384 <xsl:value-of select="normalize-space(.)"/> 385 <xsl:text>} </xsl:text> 386 </xsl:template> 387 388 <xsl:template match="d:pubdate" mode="raw"> 389 <xsl:text>, </xsl:text> 390 <xsl:value-of select="normalize-space(.)"/> 391 </xsl:template> 392 393 <xsl:template match="d:pubdate" mode="bibtex"> 394 <xsl:text>, year = {</xsl:text> 395 <xsl:value-of select="normalize-space(.)"/> 396 <xsl:text>} </xsl:text> 397 </xsl:template> 398 224 399 <xsl:template match="d:date"> 225 400 <xsl:message terminate="no"> … … 231 406 </xsl:template> 232 407 233 <xsl:template match="d:biblioset[@relation='journal']/d:volumenum"> 234 <xsl:value-of select="normalize-space(.)"/> 235 </xsl:template> 236 237 <xsl:template match="d:biblioset[@relation='journal']/d:issuenum"> 238 <xsl:value-of select="normalize-space(.)"/> 239 </xsl:template> 240 241 <xsl:template match="d:biblioset[@relation='journal']/d:pagesnum"> 242 <xsl:value-of select="normalize-space(.)"/> 243 </xsl:template> 244 245 <xsl:template match="d:biblioset[@relation='conference']/d:title"> 246 <!-- title of proceedings for instance --> 247 <xsl:value-of select="normalize-space(.)"/> 408 <xsl:template match="d:volumenum" mode="raw"> 409 <xsl:text>, </xsl:text> 410 <xsl:value-of select="normalize-space(.)"/> 411 </xsl:template> 412 413 <xsl:template match="d:volumenum" mode="bibtex"> 414 <xsl:text>, volume = {</xsl:text> 415 <xsl:value-of select="normalize-space(.)"/> 416 <xsl:text>} </xsl:text> 417 </xsl:template> 418 419 <xsl:template match="d:issuenum" mode="raw"> 420 <xsl:text>, </xsl:text> 421 <xsl:value-of select="normalize-space(.)"/> 422 </xsl:template> 423 424 <xsl:template match="d:issuenum" mode="bibtex"> 425 <xsl:text>, number = {</xsl:text> 426 <xsl:value-of select="normalize-space(.)"/> 427 <xsl:text>} </xsl:text> 428 </xsl:template> 429 430 <xsl:template match="d:pagenums" mode="raw"> 431 <xsl:text>, </xsl:text> 432 <xsl:value-of select="normalize-space(.)"/> 433 </xsl:template> 434 435 <xsl:template match="d:pagenums" mode="bibtex"> 436 <xsl:text>, pages = {</xsl:text> 437 <xsl:value-of select="normalize-space(.)"/> 438 <xsl:text>} </xsl:text> 439 </xsl:template> 440 441 <xsl:template match="d:biblioid[@class='isbn']" mode="raw"> 442 <xsl:text>, ISBN : </xsl:text> 443 <xsl:value-of select="normalize-space(.)"/> 444 </xsl:template> 445 446 <xsl:template match="d:biblioid[@class='isbn']" mode="bibtex"> 447 <xsl:text>, isbn = {</xsl:text> 448 <xsl:value-of select="normalize-space(.)"/> 449 <xsl:text>} </xsl:text> 450 </xsl:template> 451 452 453 <xsl:template match="d:biblioid[@class='other']" mode="raw"> 454 <xsl:text>, </xsl:text> 455 <xsl:value-of select="@otherclass"/> 456 <xsl:text> : </xsl:text> 457 <xsl:value-of select="normalize-space(.)"/> 458 </xsl:template> 459 460 <xsl:template match="d:biblioid[@class='other']" mode="bibtex"> 461 <xsl:text>, note = {</xsl:text> 462 <xsl:value-of select="@otherclass"/> 463 <xsl:text> : </xsl:text> 464 <xsl:value-of select="normalize-space(.)"/> 465 <xsl:text>} </xsl:text> 466 </xsl:template> 467 468 <xsl:template match="d:biblioid[@class='doi']" mode="bibtex"> 469 <xsl:message terminate="no"> 470 BBBB 471 </xsl:message> 472 <xsl:choose> 473 <xsl:when test=". = '???'"> 474 <xsl:message> iii : no doi found for 475 <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/> 476 </xsl:message> 477 </xsl:when> 478 <xsl:otherwise> 479 <!-- ++ transformer 10.1029/2003GL018906 en un lien sur http://dx.doi.org/10.1029/2003GL018906 par exemple 480 --> 481 <xsl:text>, doi = {</xsl:text> <!-- ++ pas sûre, peut-être seulement note = {doi:..} --> 482 <xsl:value-of select="normalize-space(.)"/> 483 </xsl:otherwise> 484 </xsl:choose> 485 <xsl:text>} </xsl:text> 486 </xsl:template> 487 488 <xsl:template match="d:biblioid[@class='doi']" mode="raw"> 489 <xsl:choose> 490 <xsl:when test=". = '???'"> 491 <xsl:message> iii : no doi found for 492 <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/> 493 </xsl:message> 494 </xsl:when> 495 <xsl:otherwise> 496 <!-- transformer 10.1029/2003GL018906 en un lien sur http://dx.doi.org/10.1029/2003GL018906 par exemple --> 497 <xsl:text>, </xsl:text> 498 <xsl:element name="link"> 499 <xsl:attribute name="xl:href"> 500 <xsl:text>http://dx.doi.org/</xsl:text> 501 <xsl:value-of select="normalize-space(.)"/> 502 </xsl:attribute> 503 <xsl:text>doi:</xsl:text><xsl:value-of select="normalize-space(.)"/> 504 </xsl:element> 505 </xsl:otherwise> 506 </xsl:choose> 507 <xsl:value-of select="normalize-space(.)"/> 508 <xsl:text>, </xsl:text> 248 509 </xsl:template> 249 510 250 511 <xsl:template match="d:conftitle"> 251 <xsl:value-of select="normalize-space(.)"/> 512 <xsl:text>, </xsl:text> 513 <xsl:value-of select="normalize-space(.)"/> 252 514 </xsl:template> 253 515 254 516 <xsl:template match="d:confdates"> 255 <xsl:value-of select="normalize-space(.)"/> 256 </xsl:template> 517 <xsl:text>, </xsl:text> 518 <xsl:value-of select="normalize-space(.)"/> 519 </xsl:template> 520 257 521 <xsl:template match="d:confnum"> 258 <xsl:value-of select="normalize-space(.)"/> 259 </xsl:template> 260 261 <xsl:template match="d:address"> 262 <xsl:value-of select="normalize-space(.)"/> 522 <xsl:text>, </xsl:text> 523 <xsl:value-of select="normalize-space(.)"/> 524 </xsl:template> 525 526 <xsl:template match="d:address" mode="raw"> 527 <xsl:text>, </xsl:text> 528 <xsl:value-of select="normalize-space(.)"/> 529 </xsl:template> 530 531 <xsl:template match="d:address" mode="bibtex"> 532 <xsl:text>, address = {</xsl:text> 533 <xsl:value-of select="normalize-space(.)"/> 534 <xsl:text>} </xsl:text> 263 535 </xsl:template> 264 536 … … 266 538 <xsl:choose> 267 539 <xsl:when test="@class='doi'"> 268 <xsl:choose> 269 <xsl:when test=". = '???'"> 270 <xsl:message> iii : no doi found for 271 <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/> 272 </xsl:message> 273 </xsl:when> 274 <xsl:otherwise> 275 <!-- transformer 10.1029/2003GL018906 en un lien sur http://dx.doi.org/10.1029/2003GL018906 par exemple 276 --> 277 <xsl:text>, </xsl:text> 278 <xsl:element name="link"> 279 <xsl:attribute name="xl:href"> 280 <xsl:text>http://dx.doi.org/</xsl:text> 281 <xsl:value-of select="normalize-space(.)"/> 282 </xsl:attribute> 283 <xsl:text>doi:</xsl:text><xsl:value-of select="normalize-space(.)"/> 284 </xsl:element> 285 </xsl:otherwise> 286 </xsl:choose> 540 <xsl:apply-templates select="." mode="bibtex"/> 541 <xsl:message terminate="no"> 542 AAAA <xsl:value-of select="normalize-space(.)"/> 543 </xsl:message> 287 544 </xsl:when> 288 545 <xsl:when test="@class='isbn'"> 289 <xsl: text>, ISBN : </xsl:text><xsl:value-of select="normalize-space(.)"/>546 <xsl:apply-templates select="." mode="bibtex"/> 290 547 </xsl:when> 291 548 <xsl:when test="@class='other'"> 292 <xsl:text>, </xsl:text><xsl:value-of select="@otherclass"/><xsl:text> : </xsl:text><xsl:value-of select="normalize-space(.)"/> 549 <xsl:apply-templates select="." mode="bibtex"/> 550 <xsl:message terminate="no"> 551 CCCC <xsl:value-of select="normalize-space(.)"/> 552 </xsl:message> 553 </xsl:when> 554 <xsl:otherwise> 555 <xsl:message terminate="yes"> 556 eee : unknown biblioid class for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/> 557 eee : class : <xsl:value-of select="normalize-space(@class)"/> 558 eee : value : <xsl:value-of select="normalize-space(.)"/> 559 </xsl:message> 560 </xsl:otherwise> 561 </xsl:choose> 562 </xsl:template> 563 564 <xsl:template match="d:bibliomisc" mode="raw"> 565 <xsl:choose> 566 <xsl:when test="contains(.,'In Press') or contains(.,'In press') or contains(.,'in press') or contains(.,'in revision') or contains(.,'submitted')"> 567 <xsl:value-of select="normalize-space(.)"/> 568 <xsl:text>, </xsl:text> 293 569 </xsl:when> 294 570 <xsl:otherwise> 295 571 <xsl:message terminate="no"> 296 eee : unknown biblioid class for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/>297 eee : <xsl:value-of select="normalize-space(.)"/>298 </xsl:message>299 </xsl:otherwise>300 </xsl:choose>301 </xsl:template>302 303 <xsl:template match="d:bibliomisc">304 <xsl:choose>305 <xsl:when test="contains(.,'In Press')">306 <xsl:text>, </xsl:text>307 <xsl:value-of select="normalize-space(.)"/>308 </xsl:when>309 <xsl:when test="contains(.,'In press')">310 <xsl:text>, </xsl:text>311 <xsl:value-of select="normalize-space(.)"/>312 </xsl:when>313 <xsl:when test="contains(.,'in press')">314 <xsl:text>, </xsl:text>315 <xsl:value-of select="normalize-space(.)"/>316 </xsl:when>317 <xsl:when test="contains(.,'in revision')">318 <xsl:text>, </xsl:text>319 <xsl:value-of select="normalize-space(.)"/>320 </xsl:when>321 <xsl:when test="contains(.,'submitted')">322 <xsl:text>, </xsl:text>323 <xsl:value-of select="normalize-space(.)"/>324 </xsl:when>325 <xsl:otherwise>326 <xsl:message>327 572 eee : unknown bibliomisc purpose for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/> 328 573 eee : <xsl:value-of select="normalize-space(.)"/> … … 334 579 </xsl:template> 335 580 581 <xsl:template match="d:bibliomisc" mode="bibtex"> 582 <xsl:choose> 583 <xsl:when test="contains(.,'In Press') or contains(.,'In press') or contains(.,'in press') or contains(.,'in revision') or contains(.,'submitted')"> 584 <xsl:text>, note = {</xsl:text> 585 <xsl:value-of select="normalize-space(.)"/> 586 <xsl:text>} </xsl:text> 587 </xsl:when> 588 <xsl:otherwise> 589 <xsl:message terminate="no"> 590 eee : unknown bibliomisc purpose for <xsl:value-of select="ancestor::d:biblioentry/@xml:id"/> 591 eee : <xsl:value-of select="normalize-space(.)"/> 592 </xsl:message> 593 <xsl:text>, note = {</xsl:text> 594 <xsl:value-of select="normalize-space(.)"/> 595 <xsl:text>} </xsl:text> 596 </xsl:otherwise> 597 </xsl:choose> 598 </xsl:template> 599 336 600 </xsl:stylesheet> -
trunk/bibopa.sh
r65 r66 417 417 # strip comments 418 418 fileraw_strict=/tmp/$(basename ${fileraw})_strict 419 grep -v "^#" ${fileraw} > ${fileraw_strict}419 grep -v "^#" ${fileraw} | grep -v "^%" > ${fileraw_strict} 420 420 totlines=$( wc -l ${fileraw_strict} | awk '{print $1}' ) 421 421 l=1 … … 435 435 # before the last , 436 436 auths=${tmp%,*}, 437 # replace " and" by ","437 # replace " and " by "," 438 438 auths=$( echo "${auths}" | sed -e "s/ and /,/g" ) 439 # replace " et " by "," 440 auths=$( echo "${auths}" | sed -e "s/ et /,/g" ) 439 441 # after the last , 440 442 year=${tmp##*,} … … 712 714 pag=${endline##*,} 713 715 pag=$( cleanname "${pag}" ) 714 #set 716 #set 715 717 #read a 716 718 cat <<EOF >> ${fileou} … … 736 738 ;; 737 739 10) 738 publishername=${endline%%Editors,*} 740 publishername=${endline%%Editors,*} 739 741 publishername="${publishername} Editors" 740 742 publishername=$( cleanname "${publishername}" ) … … 771 773 EOF 772 774 unset isbn 773 unset agu 775 unset agu 774 776 unset pag 775 777 unset publishername … … 800 802 unset title 801 803 unset vol 802 unset year 804 unset year 803 805 unset pag 804 806 l=$(( ${l} + 1 )) -
trunk/makefile
r65 r66 177 177 clean : 178 178 -@rm -fr $(DIRWWW)/ 179 -@rm -f $(DIRTMP)/bibdemo1_dbk5.txt 180 -@rm -f $(DIRTMP)/bibdemo1_dbk5.xml 179 -@rm -f $(DIRTMP)/bibdemo1_dbk5_1.txt 180 -@rm -f $(DIRTMP)/bibdemo1_dbk5_2.txt 181 -@rm -f $(DIRTMP)/bibdemo1_dbk5_1.xml 182 -@rm -f $(DIRTMP)/bibdemo1_dbk5_2.xml 183 -@rm -f $(DIRTMP)/bibdemo1_dbk5.bib 181 184 -@rm -f $(DIRTMP)/bibnemo1.xml 182 185 -@rm -f $(DIRTMP)/bibnemo1.txt … … 548 551 549 552 test_raw : \ 550 test_raw_demo1 \ 553 test_raw_demo1_1 \ 554 test_raw_demo1_2 \ 551 555 test_raw_nemo1 \ 552 556 test_raw_nemoall 553 557 554 test_raw_demo1 : \558 test_raw_demo1_1 : \ 555 559 $(DIRSRC)/data/bibdemo1_dbk5.xml \ 556 $(DIRTMP)/bibdemo1_dbk5 .xml \557 $(DIRTMP)/bibdemo1_dbk5 .txt558 diff -b $(DIRTMP)/bibdemo1_dbk5 .xml $(DIRSRC)/data/bibdemo1_dbk5.xml | more559 rm -i $(DIRTMP)/bibdemo1_dbk5 .xml $(DIRTMP)/bibdemo1_dbk5.txt560 561 $(DIRTMP)/bibdemo1_dbk5 .txt : \560 $(DIRTMP)/bibdemo1_dbk5_1.xml \ 561 $(DIRTMP)/bibdemo1_dbk5_1.txt 562 diff -b $(DIRTMP)/bibdemo1_dbk5_1.xml $(DIRSRC)/data/bibdemo1_dbk5.xml | more 563 rm -i $(DIRTMP)/bibdemo1_dbk5_1.xml $(DIRTMP)/bibdemo1_dbk5_1.txt 564 565 $(DIRTMP)/bibdemo1_dbk5_1.txt : \ 562 566 $(DIRSRC)/data/bibdemo1_dbk5.xml \ 563 $(DIRSRC)/superbib01_txt.xsl 567 $(DIRSRC)/superbib01_txt.xsl \ 568 $(DIRSRC)/biblioentry_xml.xsl 564 569 xsltproc --param makedate "'$(MAKEDATE)'" \ 565 570 --output $@ \ … … 567 572 $(DIRSRC)/data/bibdemo1_dbk5.xml 568 573 569 $(DIRTMP)/bibdemo1_dbk5 .xml : \570 $(DIRTMP)/bibdemo1_dbk5 .txt \574 $(DIRTMP)/bibdemo1_dbk5_1.xml : \ 575 $(DIRTMP)/bibdemo1_dbk5_1.txt \ 571 576 $(DIRSRC)/bibopa.sh 572 $(DIRSRC)/bibopa.sh -p demo1 -i $(DIRTMP)/bibdemo1_dbk5.txt -t raw -l fr 577 $(DIRSRC)/bibopa.sh -p demo1 -i $(DIRTMP)/bibdemo1_dbk5_1.txt -t raw -l fr 578 579 test_raw_demo1_2 : \ 580 $(DIRSRC)/data/bibdemo1_dbk5.xml \ 581 $(DIRTMP)/bibdemo1_dbk5_2.xml \ 582 $(DIRTMP)/bibdemo1_dbk5_2.txt 583 diff -b $(DIRTMP)/bibdemo1_dbk5_2.xml $(DIRSRC)/data/bibdemo1_dbk5.xml | more 584 rm -i $(DIRTMP)/bibdemo1_dbk5_2.xml $(DIRTMP)/bibdemo1_dbk5_2.txt 585 586 $(DIRTMP)/bibdemo1_dbk5_2.txt : \ 587 $(DIRSRC)/data/bibdemo1_dbk5.xml \ 588 $(DIRSRC)/superbib02_txt.xsl \ 589 $(DIRSRC)/biblioentry_xml.xsl 590 xsltproc --param makedate "'$(MAKEDATE)'" \ 591 --output $@ \ 592 $(DIRSRC)/superbib02_txt.xsl \ 593 $(DIRSRC)/data/bibdemo1_dbk5.xml 594 595 $(DIRTMP)/bibdemo1_dbk5_2.xml : \ 596 $(DIRTMP)/bibdemo1_dbk5_2.txt \ 597 $(DIRSRC)/bibopa.sh 598 $(DIRSRC)/bibopa.sh -p demo1 -i $(DIRTMP)/bibdemo1_dbk5_2.txt -t bibtex -l fr 573 599 574 600 test_raw_nemo1 : \ … … 581 607 $(DIRTMP)/bibnemo1.txt : \ 582 608 $(DIRSRC)/data/bibnemo1.xml \ 583 $(DIRSRC)/superbib01_txt.xsl 609 $(DIRSRC)/superbib01_txt.xsl \ 610 $(DIRSRC)/biblioentry_xml.xsl 584 611 xsltproc --param makedate "'$(MAKEDATE)'" \ 585 612 --output $@ \ … … 601 628 $(DIRTMP)/bibnemoall.txt : \ 602 629 $(DIRSRC)/data/biball.xml \ 603 $(DIRSRC)/superbib01_txt.xsl 630 $(DIRSRC)/superbib01_txt.xsl \ 631 $(DIRSRC)/biblioentry_xml.xsl 604 632 xsltproc --param makedate "'$(MAKEDATE)'" \ 605 633 --output $@ \ -
trunk/superbib01_txt.xsl
r64 r66 7 7 <!-- 8 8 module : 9 transformation docbook en un texte9 transformation of a DocBook file into a text file eatable by bibopa.sh 10 10 11 11 example pour test demo1 12 12 $ xsltproc \-\-param makedate "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'" \ 13 \-\-output /tmp/bibdemo _dbk5.txt \14 superbib01_txt.xsl data/bibdemo _dbk5.xml13 \-\-output /tmp/bibdemo1_dbk5.txt \ 14 superbib01_txt.xsl data/bibdemo1_dbk5.xml 15 15 $ ./bibopa.sh -p demo1 -i /tmp/bibdemo1_dbk5.txt -t raw -l fr 16 $ diff biblio.xml data/bibdemo _dbk5.xml16 $ diff biblio.xml data/bibdemo1_dbk5.xml 17 17 18 18 update : … … 40 40 <xsl:call-template name="one_biblioentry"> 41 41 <xsl:with-param name="visu_modif" select="'visu'"/> 42 <xsl:with-param name="type" select="'raw'"/> 42 43 <xsl:with-param name="my_biblioentry" select="."/> 43 44 </xsl:call-template> -
trunk/superbib01_xml.xsl
r64 r66 231 231 <xsl:call-template name="one_biblioentry"> 232 232 <xsl:with-param name="visu_modif" select="'visu'"/> 233 <xsl:with-param name="type" select="'raw'"/> 233 234 <xsl:with-param name="my_biblioentry" select="."/> 234 235 </xsl:call-template> -
trunk/superbib02_xml.xsl
r64 r66 193 193 <xsl:call-template name="one_biblioentry"> 194 194 <xsl:with-param name="visu_modif" select="'visu'"/> 195 <xsl:with-param name="type" select="'raw'"/> 195 196 <xsl:with-param name="my_biblioentry" select="ancestor::d:biblioentry"/> 196 197 </xsl:call-template> -
trunk/superbibmany01_xml.xsl
r64 r66 179 179 <xsl:call-template name="one_biblioentry"> 180 180 <xsl:with-param name="visu_modif" select="'visu'"/> 181 <xsl:with-param name="type" select="'raw'"/> 181 182 <xsl:with-param name="my_biblioentry" select="ancestor::d:biblioentry"/> 182 183 </xsl:call-template>
Note: See TracChangeset
for help on using the changeset viewer.