Newer
Older
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
"cnm" markup.xml write$ }
{ temp.str i "{ll{ }}" format.name$ % last names space seperated.
"snm" markup.xml write$ }
if$
"fnm" markup.xml write$
"</au>" write$ newline$
i #1 + 'i :=
}
while$
" </aug>" write$ newline$
}
if$
}
%%
% markup.xml.pub
%
% Takes 4 args (school address publisher tag)
% prints concatenation
% returns nothing
%%
FUNCTION {markup.xml.pub}
{
't := % Tag
"" 'v := % Publisher
"" 'l := % Address
"" 'f := % School
"" 's := % Answer
duplicate$ missing$ 'pop$ { 'v := } if$
duplicate$ missing$ 'pop$ { 'l := } if$
duplicate$ missing$ 'pop$ { 'f := } if$
"" f = not % school not empty
{ f 's := } % return school as publisher
{ % else
"" v = "" l = and % address and pub empty
'skip$
{
"" l =
{ v 's := } % return pub
{ "" v =
{ l 's := } % return add
{ l ": " * v * 's := } % return add : pub
if$
}
if$
}
if$
}
if$
s t markup.xml output.xml
}
%%
% xml.phd
%
% Takes nothing
% Returns type (phd/msc) of empty string
%%
FUNCTION {xml.phd}
{
"phdthesis" type$ =
"mastersthesis" type$ = or
{ "phdthesis" type$ =
{ "PhD thesis" }
{ "Master's thesis" }
if$
}
{ type } % usually empty
if$
}
% markup.xml.edition
%
% edition is a numeric value. ie "2"
% if format 2nd 1st etc.. strip letters.
%
FUNCTION {markup.xml.edition}
{ pop$ pop$ %clear stack
edition strip.letters duplicate$ "" =
{ pop$ edition }
'skip$
if$
"edition" markup.xml output.xml
}
FUNCTION{begin.bmcxmlcomment}{
newline$
"\newcommand{\BMCxmlcomment}[1]{}" write$ newline$
newline$
"\BMCxmlcomment{" write$ newline$
newline$ "<refgrp>" write$ newline$
}
FUNCTION{end.bmcxmlcomment}{
newline$
"</refgrp>" write$ newline$
"} % end of \BMCxmlcomment" write$ newline$
}
FUNCTION {export.xml}{
newline$
global.counter #1 + 'global.counter :=
"<bibl id=" quote$ * "B" * global.counter int.to.str$ * quote$ * ">" *
write$ newline$
% title "\&" "&" replace "title" markup.xml.title
title "title" markup.xml.title
author "aug" markup.xml.names % org. and inst. here
howpublished missing$
{ booktitle missing$
{ journal missing$
{ xml.phd } % <type> Phd/Msc
{journal}
if$
} {booktitle}
if$
} { howpublished }
if$ "source" markup.xml output.xml
school
address
publisher "publisher" markup.xml.pub
editor "editor" markup.xml output.xml
edition "edition" markup.xml.edition
series "p" markup.xml
"title" markup.xml
"series" markup.xml output.xml
chapter "p" markup.xml
"title" markup.xml
"section" markup.xml output.xml
% month % ignore
year "pubdate" markup.xml output.xml
note missing$
{ volume "volume" markup.xml output.xml
number "issue" markup.xml output.xml
pages markup.xml.pages
url "url" markup.xml output.xml }
{ note "l" change.case$ "in press" =
{ " <inpress />" write$ newline$ }
{ volume "volume" markup.xml output.xml
number "issue" markup.xml output.xml
pages markup.xml.pages
url "url" markup.xml output.xml
note "note" markup.xml output.xml
}
if$
}
if$
"</bibl>" write$ newline$
}
%%EXECUTE {begin.bmcxmlcomment}
%%ITERATE {export.xml}
%%EXECUTE {end.bmcxmlcomment}