Changeset 21
- Timestamp:
- 06/21/07 13:32:01 (17 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/biblioentry_xml.xsl
r2 r21 9 9 10 10 update : 11 fplod 2007-06-20T17:18:02Z aedon.locean-ipsl.upmc.fr (Darwin) 12 <bibliomisc role="id"> replaced by <biblioid class="doi"> 11 13 fplod 2007-05-16T14:01:44Z aedon.locean-ipsl.upmc.fr (Darwin) 12 14 correction in order to write doi only once … … 68 70 </xsl:otherwise> 69 71 </xsl:choose> 72 <xsl:apply-templates select="$my_biblioentry/biblioid"/> 70 73 <xsl:apply-templates select="$my_biblioentry/bibliomisc"/> 71 74 </xsl:element> … … 167 170 </xsl:message> 168 171 </xsl:template> 172 169 173 <xsl:template match="biblioset[@relation='journal']/volumenum"> 170 174 <xsl:value-of select="."/> 171 175 </xsl:template> 176 172 177 <xsl:template match="biblioset[@relation='journal']/issuenum"> 173 178 <xsl:value-of select="."/> 174 179 </xsl:template> 180 175 181 <xsl:template match="biblioset[@relation='journal']/pagesnum"> 176 182 <xsl:value-of select="."/> 177 183 </xsl:template> 178 184 179 <xsl:template match="biblio misc">185 <xsl:template match="biblioid"> 180 186 <xsl:choose> 181 <xsl:when test="contains(.,'In Press')"> 182 <xsl:text>, </xsl:text> 183 <xsl:value-of select="."/> 184 </xsl:when> 185 <xsl:when test="contains(.,'In press')"> 186 <xsl:text>, </xsl:text> 187 <xsl:value-of select="."/> 188 </xsl:when> 189 <xsl:when test="contains(.,'in press')"> 190 <xsl:text>, </xsl:text> 191 <xsl:value-of select="."/> 192 </xsl:when> 193 <xsl:when test="contains(.,'in revision')"> 194 <xsl:text>, </xsl:text> 195 <xsl:value-of select="."/> 196 </xsl:when> 197 <xsl:when test="@role='doi'"> <!-- ++ si doi existe et different de ??? --> 187 <xsl:when test="@class='doi'"> 198 188 <xsl:choose> 199 189 <xsl:when test=". = '???'"> 200 190 <xsl:message> iii : no doi found for 201 <xsl:value-of select="ancestor::biblioentry/@id"/>202 </xsl:message>191 <xsl:value-of select="ancestor::biblioentry/@id"/> 192 </xsl:message> 203 193 </xsl:when> 204 194 <xsl:otherwise> … … 218 208 <xsl:otherwise> 219 209 <xsl:message> 210 eee : unknown biblioid purpose for <xsl:value-of select="ancestor::biblioentry/@id"/> 211 eee : <xsl:value-of select="."/> 212 </xsl:message> 213 </xsl:otherwise> 214 </xsl:choose> 215 </xsl:template> 216 217 <xsl:template match="bibliomisc"> 218 <xsl:choose> 219 <xsl:when test="contains(.,'In Press')"> 220 <xsl:text>, </xsl:text> 221 <xsl:value-of select="."/> 222 </xsl:when> 223 <xsl:when test="contains(.,'In press')"> 224 <xsl:text>, </xsl:text> 225 <xsl:value-of select="."/> 226 </xsl:when> 227 <xsl:when test="contains(.,'in press')"> 228 <xsl:text>, </xsl:text> 229 <xsl:value-of select="."/> 230 </xsl:when> 231 <xsl:when test="contains(.,'in revision')"> 232 <xsl:text>, </xsl:text> 233 <xsl:value-of select="."/> 234 </xsl:when> 235 <xsl:otherwise> 236 <xsl:message> 220 237 eee : unknown bibliomisc purpose for <xsl:value-of select="ancestor::biblioentry/@id"/> 221 238 eee : <xsl:value-of select="."/> -
trunk/bibopa.sh
r15 r21 23 23 # Short Rains: A CGCM Study</title> 24 24 # <publishername>J. Climate</publishername> 25 # <biblio misc role="doi">doi</bibliomisc>25 # <biblioid class="doi">doi</bibliomisc> 26 26 # <bibliomisc role="pseudoref">In press.</bibliomisc> 27 27 # <bibliomisc role="internalref">from … … 44 44 # ++ gestion des id existants (cf à la fin) 45 45 # ++ option debug 46 # fplod 2007-06-20T17:18:02Z aedon.locean-ipsl.upmc.fr (Darwin) 47 # <bibliomisc role="id"> replace by <biblioid class="doi"> 46 48 # smasson 2007-06-07T16:43:42Z arete.locean-ipsl.upmc.fr (Darwin) 47 49 # Add journals … … 237 239 totlines=$( wc -l ${fileraw_strict} | awk '{print $1}' ) 238 240 l=1 239 while [ $ l -le $totlines]241 while [ ${l} -le ${totlines} ] 240 242 do 241 243 # extract one line 242 244 243 245 line=$( sed -n ${l}p ${fileraw_strict} ) 244 orgline=$( echo $ line| sed -e "s/--/- -/g" )245 line=$( echo $ line| sed -e "s/</\</g" -e "s/>/\>/g" )246 orgline=$( echo ${line} | sed -e "s/--/- -/g" ) 247 line=$( echo ${line} | sed -e "s/</\</g" -e "s/>/\>/g" ) 246 248 # before the first : 247 249 tmp=${line%%:*} … … 249 251 auths=${tmp%,*}, 250 252 # supress and 251 auths=$( echo "$ auths" | sed -e "s/ and //g" )253 auths=$( echo "${auths}" | sed -e "s/ and //g" ) 252 254 # after the last , 253 255 year=${tmp##*,} 254 year=$( rmbl "$ year" )256 year=$( rmbl "${year}" ) 255 257 ## first author before the first ., 256 258 first=${auths%%.,*}. 257 259 # its firstname after the last , 258 260 firstfn=${first##*,} 259 firstfn=$( rmbl "$ firstfn" )261 firstfn=$( rmbl "${firstfn}" ) 260 262 # its surname ; before the first , 261 263 firstsn=${first%%,*} 262 firstsn=$( rmbl "$ firstsn" )264 firstsn=$( rmbl "${firstsn}" ) 263 265 ## ref id 264 refid=$( echo $ firstsn | tr "[:upper:]" "[:lower:]" | tr -s " " "_" | tr -s "'" "_" | recode -d -f ISO-8859-1..flat )$year265 num=$( grep -c "<biblioentry id=\"${refid}_[0-9][0-9]\">" $ fileou)266 num=$(( $ num+ 1 ))267 [ $ num -le 9 ] && num=0$num268 refid=${refid}_$ num269 270 cat <<EOF >> $ fileou266 refid=$( echo ${firstsn} | tr "[:upper:]" "[:lower:]" | tr -s " " "_" | tr -s "'" "_" | recode -d -f ISO-8859-1..flat )${year} 267 num=$( grep -c "<biblioentry id=\"${refid}_[0-9][0-9]\">" ${fileou} ) 268 num=$(( ${num} + 1 )) 269 [ ${num} -le 9 ] && num=0${num} 270 refid=${refid}_${num} 271 272 cat <<EOF >> ${fileou} 271 273 <biblioentry id="${refid}"> 272 274 <!-- date … … 285 287 next=${auths##*${previous}} 286 288 # while the next author is not empty 287 while [ "$ next" != "" ]289 while [ "${next}" != "" ] 288 290 do 289 291 # get the first next author; before the first , … … 291 293 # its surname ; after the last . 292 294 nextsn=${next##*.} 293 nextsn=$( rmbl "$ nextsn" )295 nextsn=$( rmbl "${nextsn}" ) 294 296 # its firstname ; before the last . 295 297 nextfn=${next%.*}. 296 nextfn=$( rmbl "$ nextfn" )298 nextfn=$( rmbl "${nextfn}" ) 297 299 # 298 300 echo " <author> <personname> <surname>${nextsn}</surname> <firstname>${nextfn}</firstname> </personname> </author>" >> ${fileou} … … 301 303 302 304 done 303 echo " </authorgroup>" >> $ fileou305 echo " </authorgroup>" >> ${fileou} 304 306 305 307 # end of the line ; after the first : … … 312 314 while [[ $j -le $jlistsize && "${jfound}" == "" ]] 313 315 do 314 ok=$( echo $ endline| grep -ci "${jlist[j]} *," )316 ok=$( echo ${endline} | grep -ci "${jlist[j]} *," ) 315 317 [ $ok -eq 1 ] && jfound="${jlist[j]}" 316 318 j=$(( $j + 1 )) … … 318 320 if [ "$jfound" == "" ] 319 321 then 320 echo ERROR Journal not found321 echo $endline322 echo "ERROR Journal not found" 323 echo "${endline}" 322 324 exit 323 325 fi … … 325 327 # before the first : 326 328 title=${endline%%${jfound}*} 327 title=$( cleanname "$ title" )328 echo " <title>${title}</title>" >> $ fileou329 title=$( cleanname "${title}" ) 330 echo " <title>${title}</title>" >> ${fileou} 329 331 ## end 330 332 ## end of the line ; after the first ${jfound} 331 333 endline=${endline#*${jfound}} 332 endline=$( cleanname "$ endline" )334 endline=$( cleanname "${endline}" ) 333 335 ## doi 334 endline=$( echo $ endline| sed -e "s/[dD][oO][iI] *\t* *: *\t* */doi:/" )335 ok=$( echo $ endline| grep -ic "doi:" )336 endline=$( echo ${endline} | sed -e "s/[dD][oO][iI] *\t* *: *\t* */doi:/" ) 337 ok=$( echo ${endline} | grep -ic "doi:" ) 336 338 if [ $ok -eq 1 ] 337 339 then 338 340 doi=${endline##*doi:} 339 echo " <biblio misc role=\"doi\">${doi}</bibliomisc>" >> $fileou341 echo " <biblioid class=\"doi\">${doi}</biblioid>" >> ${fileou} 340 342 endline=${endline%doi:*} 341 endline=$( cleanname "$ endline" )343 endline=$( cleanname "${endline}" ) 342 344 else 343 echo non doi: $line345 echo "non doi: ${line}" 344 346 fi 345 num=$( echo $ endline| tr -dc "," | wc -c )346 case $ numin347 num=$( echo ${endline} | tr -dc "," | wc -c ) 348 case ${num} in 347 349 1) 348 ### echo $ num: ${endline}350 ### echo ${num}: ${endline} 349 351 vol=${endline%,*} 350 vol=$( cleanname "$ vol" )352 vol=$( cleanname "${vol}" ) 351 353 pag=${endline##*,} 352 pag=$( cleanname "$ pag" )353 cat <<EOF >> $ fileou354 pag=$( cleanname "${pag}" ) 355 cat <<EOF >> ${fileou} 354 356 <biblioset relation="journal"> 355 357 <title>${jfound}</title> … … 361 363 2) 362 364 vol=${endline%,*} 363 vol=$( cleanname "$ vol" )365 vol=$( cleanname "${vol}" ) 364 366 iss=${vol##*,} 365 iss=$( cleanname "$ iss" )367 iss=$( cleanname "${iss}" ) 366 368 vol=${vol%,*} 367 vol=$( cleanname "$ vol" )369 vol=$( cleanname "${vol}" ) 368 370 pag=${endline##*,} 369 pag=$( cleanname "$ pag" )370 cat <<EOF >> $ fileou371 pag=$( cleanname "${pag}" ) 372 cat <<EOF >> ${fileou} 371 373 <biblioset role="journal"> 372 374 <title>${jfound}</title> … … 377 379 ;; 378 380 *) 379 echo $ num: ${endline}380 cat <<EOF >> $ fileou381 echo ${num}: ${endline} 382 cat <<EOF >> ${fileou} 381 383 <biblioset role="journal"> 382 384 <title>${jfound}</title> … … 388 390 esac 389 391 390 cat <<EOF >> $ fileou392 cat <<EOF >> ${fileou} 391 393 </biblioentry> 392 394 … … 400 402 401 403 done 402 echo "</bibliography>" >> $ fileou404 echo "</bibliography>" >> ${fileou} 403 405 404 406 xsltproc \ -
trunk/data/biball.xml
r20 r21 42 42 <biblioid class="doi">10.1016/j.ocemod.2004.08.003</biblioid> 43 43 --> 44 <biblioid class="d oi">AAA</biblioid>44 <biblioid class="dio">AAA</biblioid> 45 45 <biblioset role="journal"> 46 46 <title>Ocean Modelling</title> -
trunk/makefile
r20 r21 457 457 $(DIRSRC)/comments_db.xsl \ 458 458 $(DIRSRC)/newreferences_db.xsl \ 459 $(DIRSRC)/processors_db.xsl 459 $(DIRSRC)/processors_db.xsl \ 460 $(DIRSRC)/biblioentry_xml.xsl 460 461 @echo "juste pour info dependances de form_db.xsl" 461 462
Note: See TracChangeset
for help on using the changeset viewer.