When transforming valid mods XML to RIS (or other formats) the nonSort portion of the title is dropped. I would expect it to appear preceding the main title.
I believe I have implemented the proper changes to make this happen. But should note that I haven't worked with C since I last contributed to this project in 2014 [1].
Can you inform me of the process of submitting patches?
diff-Naur./lib/adsout.c/home/matt/bibutils_6.10/lib/adsout.c---./lib/adsout.c2020-06-2911:40:25.777497402-0400+++/home/matt/bibutils_6.10/lib/adsout.c2020-03-2314:53:54.000000000-0400@@-152,22+152,21@@}staticint-append_title(fields*in,char*nsrt,char*ttl,char*sub,char*adstag,intlevel,fields*out,int*status)+append_title(fields*in,char*ttl,char*sub,char*adstag,intlevel,fields*out,int*status){-strfulltitle,*nonsort,*title,*subtitle,*vol,*iss,*sn,*en,*ar;+strfulltitle,*title,*subtitle,*vol,*iss,*sn,*en,*ar;intfstatus,output=0;str_init(&fulltitle);-nonsort=fields_findv(in,level,FIELDS_STRP,nsrt);-title=fields_findv(in,level,FIELDS_STRP,ttl);-subtitle=fields_findv(in,level,FIELDS_STRP,sub);+title=fields_findv(in,level,FIELDS_STRP,ttl);+subtitle=fields_findv(in,level,FIELDS_STRP,sub);if(str_has_value(title)){output=1;-title_combine(&fulltitle,nonsort,title,subtitle);+title_combine(&fulltitle,title,subtitle);vol=fields_findv(in,LEVEL_ANY,FIELDS_STRP,"VOLUME");if(str_has_value(vol)){@@-222,9+221,9@@{intadded;if(type==TYPE_ARTICLE||type==TYPE_MAGARTICLE){-added=append_title(in,"NONSORT","TITLE","SUBTITLE","%J",LEVEL_HOST,out,status);+added=append_title(in,"TITLE","SUBTITLE","%J",LEVEL_HOST,out,status);if(added==0)-(void)append_title(in,"SHORTNONSORT","SHORTTITLE","SHORTSUBTITLE","%J",LEVEL_HOST,out,status);+(void)append_title(in,"SHORTTITLE","SHORTSUBTITLE","%J",LEVEL_HOST,out,status);}}diff-Naur./lib/biblatexout.c/home/matt/bibutils_6.10/lib/biblatexout.c---./lib/biblatexout.c2020-06-2911:38:30.547495470-0400+++/home/matt/bibutils_6.10/lib/biblatexout.c2020-03-2314:53:54.000000000-0400@@-396,18+396,13@@}staticint-append_title_chosen(fields*in,char*bibtag,fields*out,intnnonsortttl,intnmainttl,intnsubttl)+append_title_chosen(fields*in,char*bibtag,fields*out,intnmainttl,intnsubttl){-strfulltitle,*nonsortttl=NULL,*mainttl=NULL,*subttl=NULL;+strfulltitle,*mainttl=NULL,*subttl=NULL;intstatus,ret=BIBL_OK;str_init(&fulltitle);-if(nnonsortttl!=-1){-mainttl=fields_value(in,nnonsortttl,FIELDS_STRP);-fields_set_used(in,nnonsortttl);-}-if(nmainttl!=-1){mainttl=fields_value(in,nmainttl,FIELDS_STRP);fields_set_used(in,nmainttl);@@-418,7+413,7@@fields_set_used(in,nsubttl);}-title_combine(&fulltitle,nonsortttl,mainttl,subttl);+title_combine(&fulltitle,mainttl,subttl);if(str_memerr(&fulltitle)){ret=BIBL_ERR_MEMERR;@@-438,28+433,24@@staticintappend_title(fields*in,char*bibtag,intlevel,fields*out,intformat_opts){-intnonsort,short_nonsort,title,short_title,subtitle,short_subtitle,use_nonsort,use_title,use_subtitle;+inttitle,short_title,subtitle,short_subtitle,use_title,use_subtitle;-nonsort=fields_find(in,"NONSORT",level);-short_nonsort=fields_find(in,"SHORTNONSORT",level);title=fields_find(in,"TITLE",level);short_title=fields_find(in,"SHORTTITLE",level);subtitle=fields_find(in,"SUBTITLE",level);short_subtitle=fields_find(in,"SHORTSUBTITLE",level);if(title==FIELDS_NOTFOUND||((format_opts&BIBL_FORMAT_BIBOUT_SHORTTITLE)&&level==1)){-use_nonsort=short_nonsort;use_title=short_title;use_subtitle=short_subtitle;}else{-use_nonsort=nonsort;use_title=title;use_subtitle=subtitle;}-returnappend_title_chosen(in,bibtag,out,use_nonsort,use_title,use_subtitle);+returnappend_title_chosen(in,bibtag,out,use_title,use_subtitle);}staticvoiddiff-Naur./lib/bibtexout.c/home/matt/bibutils_6.10/lib/bibtexout.c---./lib/bibtexout.c2020-06-2911:34:53.894158506-0400+++/home/matt/bibutils_6.10/lib/bibtexout.c2020-03-2314:53:54.000000000-0400@@-372,17+372,13@@}staticint-append_title_chosen(fields*in,char*bibtag,fields*out,intnnonsortttl,intnmainttl,intnsubttl)+append_title_chosen(fields*in,char*bibtag,fields*out,intnmainttl,intnsubttl){-strfulltitle,*nonsortttl=NULL,*mainttl=NULL,*subttl=NULL;+strfulltitle,*mainttl=NULL,*subttl=NULL;intstatus,ret=BIBL_OK;str_init(&fulltitle);-if(nnonsortttl!=-1){-nonsortttl=fields_value(in,nnonsortttl,FIELDS_STRP);-fields_set_used(in,nnonsortttl);-}if(nmainttl!=-1){mainttl=fields_value(in,nmainttl,FIELDS_STRP);fields_set_used(in,nmainttl);@@-393,7+389,7@@fields_set_used(in,nsubttl);}-title_combine(&fulltitle,nonsortttl,mainttl,subttl);+title_combine(&fulltitle,mainttl,subttl);if(str_memerr(&fulltitle)){ret=BIBL_ERR_MEMERR;@@-413,29+409,24@@staticintappend_title(fields*in,char*bibtag,intlevel,fields*out,intformat_opts){-intnonsort,short_nonsort,title,short_title,subtitle,short_subtitle,use_nonsort,use_title,use_subtitle;+inttitle,short_title,subtitle,short_subtitle,use_title,use_subtitle;--nonsort=fields_find(in,"NONSORT",level);-short_nonsort=fields_find(in,"SHORTNONSORT",level);title=fields_find(in,"TITLE",level);short_title=fields_find(in,"SHORTTITLE",level);subtitle=fields_find(in,"SUBTITLE",level);short_subtitle=fields_find(in,"SHORTSUBTITLE",level);if(title==FIELDS_NOTFOUND||((format_opts&BIBL_FORMAT_BIBOUT_SHORTTITLE)&&level==1)){-use_nonsort=short_nonsort;use_title=short_title;use_subtitle=short_subtitle;}else{-use_nonsort=nonsort;use_title=title;use_subtitle=subtitle;}-returnappend_title_chosen(in,bibtag,out,use_nonsort,use_title,use_subtitle);+returnappend_title_chosen(in,bibtag,out,use_title,use_subtitle);}staticvoiddiff-Naur./lib/endout.c/home/matt/bibutils_6.10/lib/endout.c---./lib/endout.c2020-06-2911:29:37.577486506-0400+++/home/matt/bibutils_6.10/lib/endout.c2020-03-2314:53:54.000000000-0400@@-410,17+410,16@@}staticint-append_title(fields*in,char*nonsort,char*full,char*sub,char*endtag,+append_title(fields*in,char*full,char*sub,char*endtag,intlevel,fields*out,int*status){-str*nonsortttl=fields_findv(in,level,FIELDS_STRP,nonsort);str*mainttl=fields_findv(in,level,FIELDS_STRP,full);str*subttl=fields_findv(in,level,FIELDS_STRP,sub);strfullttl;intfstatus;str_init(&fullttl);-title_combine(&fullttl,nonsortttl,mainttl,subttl);+title_combine(&fullttl,mainttl,subttl);if(str_memerr(&fullttl)){*status=BIBL_ERR_MEMERR;@@-659,9+658,9@@append_type(type,out,pm,&status);-added=append_title(in,"NONSORT","TITLE","SUBTITLE","%T",LEVEL_MAIN,out,&status);-if(added==0)append_title(in,"SHORTNONSORT","SHORTTITLE","SHORTSUBTITLE","%T",LEVEL_MAIN,out,&status);-elseappend_title(in,"SHORTNONSORT","SHORTTITLE","SHORTSUBTITLE","%!",LEVEL_MAIN,out,&status);+added=append_title(in,"TITLE","SUBTITLE","%T",LEVEL_MAIN,out,&status);+if(added==0)append_title(in,"SHORTTITLE","SHORTSUBTITLE","%T",LEVEL_MAIN,out,&status);+elseappend_title(in,"SHORTTITLE","SHORTSUBTITLE","%!",LEVEL_MAIN,out,&status);append_people(in,"AUTHOR","%A",LEVEL_MAIN,out,&status);append_people(in,"EDITOR","%E",LEVEL_MAIN,out,&status);@@-705,22+704,22@@}if(type==TYPE_ARTICLE||type==TYPE_MAGARTICLE||type==TYPE_ELECTRONICARTICLE||type==TYPE_NEWSARTICLE){-added=append_title(in,"NONSORT","TITLE","SUBTITLE","%J",LEVEL_HOST,out,&status);-if(added==0)append_title(in,"SHORTNONSORT","SHORTTITLE","SHORTSUBTITLE","%J",LEVEL_HOST,out,&status);+added=append_title(in,"TITLE","SUBTITLE","%J",LEVEL_HOST,out,&status);+if(added==0)append_title(in,"SHORTTITLE","SHORTSUBTITLE","%J",LEVEL_HOST,out,&status);}elseif(type==TYPE_INBOOK||type==TYPE_INPROCEEDINGS){-added=append_title(in,"NONSORT","TITLE","SUBTITLE","%B",LEVEL_HOST,out,&status);-if(added==0)append_title(in,"SHORTNONSORT","SHORTTITLE","SHORTSUBTITLE","%B",LEVEL_HOST,out,&status);+added=append_title(in,"TITLE","SUBTITLE","%B",LEVEL_HOST,out,&status);+if(added==0)append_title(in,"SHORTTITLE","SHORTSUBTITLE","%B",LEVEL_HOST,out,&status);}else{-added=append_title(in,"NONSORT","TITLE","SUBTITLE","%S",LEVEL_HOST,out,&status);-if(added==0)append_title(in,"SHORTNONSORT","SHORTTITLE","SHORTSUBTITLE","%S",LEVEL_HOST,out,&status);+added=append_title(in,"TITLE","SUBTITLE","%S",LEVEL_HOST,out,&status);+if(added==0)append_title(in,"SHORTTITLE","SHORTSUBTITLE","%S",LEVEL_HOST,out,&status);}if(type!=TYPE_CASE&&type!=TYPE_HEARING){-append_title(in,"SHORTNONSORT","TITLE","SUBTITLE","%S",LEVEL_SERIES,out,&status);+append_title(in,"TITLE","SUBTITLE","%S",LEVEL_SERIES,out,&status);}append_year(in,out,&status);diff-Naur./lib/isiout.c/home/matt/bibutils_6.10/lib/isiout.c---./lib/isiout.c2020-06-2911:27:30.680817697-0400+++/home/matt/bibutils_6.10/lib/isiout.c2020-03-2314:53:54.000000000-0400@@-120,16+120,15@@}staticvoid-append_titlecore(fields*in,char*isitag,intlevel,char*nonsorttag,char*maintag,char*subtag,fields*out,int*status)+append_titlecore(fields*in,char*isitag,intlevel,char*maintag,char*subtag,fields*out,int*status){-str*nonsortttl=fields_findv(in,level,FIELDS_STRP,nonsorttag);str*mainttl=fields_findv(in,level,FIELDS_STRP,maintag);str*subttl=fields_findv(in,level,FIELDS_STRP,subtag);strfullttl;intfstatus;str_init(&fullttl);-title_combine(&fullttl,nonsortttl,mainttl,subttl);+title_combine(&fullttl,mainttl,subttl);if(str_memerr(&fullttl)){*status=BIBL_ERR_MEMERR;@@-147,13+146,13@@staticvoidappend_title(fields*in,char*isitag,intlevel,fields*out,int*status){-append_titlecore(in,isitag,level,"NONSORT","TITLE","SUBTITLE",out,status);+append_titlecore(in,isitag,level,"TITLE","SUBTITLE",out,status);}staticvoidappend_abbrtitle(fields*in,char*isitag,intlevel,fields*out,int*status){-append_titlecore(in,isitag,level,"SHORTNONSORT","SHORTTITLE","SHORTSUBTITLE",out,status);+append_titlecore(in,isitag,level,"SHORTTITLE","SHORTSUBTITLE",out,status);}staticvoiddiff-Naur./lib/modsin.c/home/matt/bibutils_6.10/lib/modsin.c---./lib/modsin.c2020-06-2911:01:40.737458080-0400+++/home/matt/bibutils_6.10/lib/modsin.c2020-03-2314:53:54.000000000-0400@@-235,14+235,10@@}staticint-modsin_titler(xml*node,str*nonsort,str*title,str*subtitle)+modsin_titler(xml*node,str*title,str*subtitle){intstatus=BIBL_OK;--if(xml_tag_matches_has_value(node,"nonSort")){-str_strcat(nonsort,xml_value(node));-if(str_memerr(nonsort))returnBIBL_ERR_MEMERR;-}elseif(xml_tag_matches_has_value(node,"title")){+if(xml_tag_matches_has_value(node,"title")){if(str_has_value(title))str_strcatc(title," : ");str_strcat(title,xml_value(node));if(str_memerr(title))returnBIBL_ERR_MEMERR;@@-251,53+247,47@@if(str_memerr(subtitle))returnBIBL_ERR_MEMERR;}if(node->down){-status=modsin_titler(node->down,nonsort,title,subtitle);+status=modsin_titler(node->down,title,subtitle);if(status!=BIBL_OK)returnstatus;}if(node->next)-status=modsin_titler(node->next,nonsort,title,subtitle);+status=modsin_titler(node->next,title,subtitle);returnstatus;}staticintmodsin_title(xml*node,fields*info,intlevel){-char*titletag[3][2]={-{"NONSORT","SHORTNONSORT"},+char*titletag[2][2]={{"TITLE","SHORTTITLE"},{"SUBTITLE","SHORTSUBTITLE"},};intfstatus,status=BIBL_OK;-strnonsort,title,subtitle;+strtitle,subtitle;xml*dnode;intabbr;dnode=node->down;if(!dnode)returnstatus;-strs_init(&nonsort,&title,&subtitle,NULL);+strs_init(&title,&subtitle,NULL);abbr=xml_tag_has_attribute(node,"titleInfo","type","abbreviated");-status=modsin_titler(dnode,&nonsort,&title,&subtitle);+status=modsin_titler(dnode,&title,&subtitle);if(status!=BIBL_OK)gotoout;-if(str_has_value(&nonsort)){-fstatus=fields_add(info,titletag[0][abbr],str_cstr(&nonsort),level);-if(fstatus!=FIELDS_OK){status=BIBL_ERR_MEMERR;gotoout;}-}-if(str_has_value(&title)){-fstatus=fields_add(info,titletag[1][abbr],str_cstr(&title),level);+fstatus=fields_add(info,titletag[0][abbr],str_cstr(&title),level);if(fstatus!=FIELDS_OK){status=BIBL_ERR_MEMERR;gotoout;}}if(str_has_value(&subtitle)){-fstatus=fields_add(info,titletag[2][abbr],str_cstr(&subtitle),level);+fstatus=fields_add(info,titletag[1][abbr],str_cstr(&subtitle),level);if(fstatus!=FIELDS_OK){status=BIBL_ERR_MEMERR;gotoout;}}out:-strs_free(&nonsort,&title,&subtitle,NULL);+strs_free(&title,&subtitle,NULL);returnstatus;}diff-Naur./lib/nbibout.c/home/matt/bibutils_6.10/lib/nbibout.c---./lib/nbibout.c2020-06-2911:17:56.394141251-0400+++/home/matt/bibutils_6.10/lib/nbibout.c2020-03-2314:53:54.000000000-0400@@-110,16+110,15@@}staticvoid-append_titlecore(fields*in,char*nbibtag,intlevel,char*nonsorttag,char*maintag,char*subtag,fields*out,int*status)+append_titlecore(fields*in,char*nbibtag,intlevel,char*maintag,char*subtag,fields*out,int*status){-str*nonsrtttl=fields_findv(in,level,FIELDS_STRP,nonsorttag);str*mainttl=fields_findv(in,level,FIELDS_STRP,maintag);str*subttl=fields_findv(in,level,FIELDS_STRP,subtag);strfullttl;intfstatus;str_init(&fullttl);-title_combine(&fullttl,nonsrtttl,mainttl,subttl);+title_combine(&fullttl,mainttl,subttl);if(str_memerr(&fullttl)){*status=BIBL_ERR_MEMERR;@@-137,13+136,13@@staticvoidappend_title(fields*in,char*nbibtag,intlevel,fields*out,int*status){-append_titlecore(in,nbibtag,level,"NONSORT","TITLE","SUBTITLE",out,status);+append_titlecore(in,nbibtag,level,"TITLE","SUBTITLE",out,status);}staticvoidappend_abbrtitle(fields*in,char*nbibtag,intlevel,fields*out,int*status){-append_titlecore(in,nbibtag,level,"SHORTNONSORT","SHORTTITLE","SHORTSUBTITLE",out,status);+append_titlecore(in,nbibtag,level,"SHORTTITLE","SHORTSUBTITLE",out,status);}staticvoiddiff-Naur./lib/risout.c/home/matt/bibutils_6.10/lib/risout.c---./lib/risout.c2020-06-2911:15:08.274138408-0400+++/home/matt/bibutils_6.10/lib/risout.c2020-03-2314:53:54.000000000-0400@@-431,9+431,8@@}staticvoid-append_titlecore(fields*in,char*ristag,intlevel,char*nonsorttag,char*maintag,char*subtag,fields*out,int*status)+append_titlecore(fields*in,char*ristag,intlevel,char*maintag,char*subtag,fields*out,int*status){-str*nonsortttl=fields_findv(in,level,FIELDS_STRP,nonsorttag);str*mainttl=fields_findv(in,level,FIELDS_STRP,maintag);str*subttl=fields_findv(in,level,FIELDS_STRP,subtag);strfullttl;@@-441,7+440,7@@str_init(&fullttl);-title_combine(&fullttl,nonsortttl,mainttl,subttl);+title_combine(&fullttl,mainttl,subttl);if(str_memerr(&fullttl)){*status=BIBL_ERR_MEMERR;@@-460,15+459,15@@staticvoidappend_alltitles(fields*in,inttype,fields*out,int*status){-append_titlecore(in,"TI",0,"NONSORT","TITLE","SUBTITLE",out,status);-append_titlecore(in,"T2",-1,"SHORTNONSORT","SHORTTITLE","SHORTSUBTITLE",out,status);+append_titlecore(in,"TI",0,"TITLE","SUBTITLE",out,status);+append_titlecore(in,"T2",-1,"SHORTTITLE","SHORTSUBTITLE",out,status);if(type_is_element[type]){if(type_uses_journal[type])-append_titlecore(in,"JO",1,"NONSORT","TITLE","SUBTITLE",out,status);-elseappend_titlecore(in,"BT",1,"NONSORT","TITLE","SUBTITLE",out,status);-append_titlecore(in,"T3",2,"NONSORT","TITLE","SUBTITLE",out,status);+append_titlecore(in,"JO",1,"TITLE","SUBTITLE",out,status);+elseappend_titlecore(in,"BT",1,"TITLE","SUBTITLE",out,status);+append_titlecore(in,"T3",2,"TITLE","SUBTITLE",out,status);}else{-append_titlecore(in,"T3",1,"NONSORT","TITLE","SUBTITLE",out,status);+append_titlecore(in,"T3",1,"TITLE","SUBTITLE",out,status);}}diff-Naur./lib/title.c/home/matt/bibutils_6.10/lib/title.c---./lib/title.c2020-06-2911:52:00.204175843-0400+++/home/matt/bibutils_6.10/lib/title.c2020-03-2314:53:54.000000000-0400@@-67,7+67,7@@/* title_combine() *- * Combine a non sort, main title and a subtitle into a full title.+ * Combine a main title and a subtitle into a full title. * * Example: * Main title = "A Clearing in the Distance"@@ -77,28 +77,15 @@ * Main title = "What Makes a Good Team Player?" * Subtitle = "Personality and Team Effectiveness" * Full title = "What Makes a Good Team Player? Personality and Team Effectiveness"- * Example:- * Nonsort = "The "- * Title = "Nuer"- * Subtitle = "a description of the modes of livelihood and political institutions of a Nilotic people"- * Full title = "The Nuer: a description of the modes of livelihood and political institutions of a Nilotic people"-- * */void-title_combine(str*fullttl,str*nonsortttl,str*mainttl,str*subttl)+title_combine(str*fullttl,str*mainttl,str*subttl){str_empty(fullttl);if(!mainttl)return;-if(nonsortttl){// a nonsort precedes the main title-str_strcpy(fullttl,nonsortttl);-str_strcat(fullttl,mainttl);-}else{-str_strcpy(fullttl,mainttl);-}-+str_strcpy(fullttl,mainttl);if(subttl){if(str_has_value(mainttl)){diff-Naur./lib/title.h/home/matt/bibutils_6.10/lib/title.h---./lib/title.h2020-06-2911:11:48.894135046-0400+++/home/matt/bibutils_6.10/lib/title.h2020-03-2314:53:54.000000000-0400@@-15,6+15,6@@#include"fields.h"inttitle_process(fields*info,constchar*tag,constchar*value,intlevel,unsignedcharnosplittitle);-voidtitle_combine(str*fullttl,str*nonsortttl,str*mainttl,str*subttl);+voidtitle_combine(str*fullttl,str*mainttl,str*subttl);#endifdiff-Naur./lib/wordout.c/home/matt/bibutils_6.10/lib/wordout.c---./lib/wordout.c2020-06-2912:00:29.834184403-0400+++/home/matt/bibutils_6.10/lib/wordout.c2020-03-2314:53:54.000000000-0400@@-294,10+294,9@@}staticvoid-output_titlebits(constchar*nonsortttl,constchar*mainttl,constchar*subttl,FILE*outptr)+output_titlebits(constchar*mainttl,constchar*subttl,FILE*outptr){-if(nonsortttl)fprintf(outptr,"%s",nonsortttl);-if(mainttl)fprintf(outptr,"%s",mainttl);+if(mainttl)fprintf(outptr,"%s",mainttl);if(subttl){if(mainttl){if(mainttl[strlen(mainttl)-1]!='?')@@-309,11+308,11@@}staticvoid-output_titleinfo(constchar*nonsortttl,constchar*mainttl,constchar*subttl,FILE*outptr,constchar*tag,intlevel)+output_titleinfo(constchar*mainttl,constchar*subttl,FILE*outptr,constchar*tag,intlevel){if(mainttl||subttl){fprintf(outptr,"<%s>",tag);-output_titlebits(nonsortttl,mainttl,subttl,outptr);+output_titlebits(mainttl,subttl,outptr);fprintf(outptr,"</%s>\n",tag);}}@@-321,45+320,41@@staticvoidoutput_generaltitle(fields*info,FILE*outptr,constchar*tag,intlevel){-constchar*nsrt=fields_findv(info,level,FIELDS_CHRP,"NONSORT");-constchar*shrtnsrt=fields_findv(info,level,FIELDS_CHRP,"SHORTNONSORT");constchar*ttl=fields_findv(info,level,FIELDS_CHRP,"TITLE");constchar*subttl=fields_findv(info,level,FIELDS_CHRP,"SUBTITLE");constchar*shrttl=fields_findv(info,level,FIELDS_CHRP,"SHORTTITLE");constchar*shrsubttl=fields_findv(info,level,FIELDS_CHRP,"SHORTSUBTITLE");if(ttl){-output_titleinfo(nsrt,ttl,subttl,outptr,tag,level);+output_titleinfo(ttl,subttl,outptr,tag,level);}elseif(shrttl){-output_titleinfo(shrtnsrt,shrttl,shrsubttl,outptr,tag,level);+output_titleinfo(shrttl,shrsubttl,outptr,tag,level);}}staticvoidoutput_maintitle(fields*info,FILE*outptr,intlevel){-constchar*nsrt=fields_findv(info,level,FIELDS_CHRP,"NONSORT");-constchar*shrtnsrt=fields_findv(info,level,FIELDS_CHRP,"SHORTNONSORT");constchar*ttl=fields_findv(info,level,FIELDS_CHRP,"TITLE");constchar*subttl=fields_findv(info,level,FIELDS_CHRP,"SUBTITLE");constchar*shrttl=fields_findv(info,level,FIELDS_CHRP,"SHORTTITLE");constchar*shrsubttl=fields_findv(info,level,FIELDS_CHRP,"SHORTSUBTITLE");if(ttl){-output_titleinfo(nsrt,ttl,subttl,outptr,"b:Title",level);+output_titleinfo(ttl,subttl,outptr,"b:Title",level);/* output shorttitle if it's different from normal title */if(shrttl){if(!ttl||(strcmp(shrttl,ttl)||subttl)){fprintf(outptr," <b:ShortTitle>");-output_titlebits(shrtnsrt,shrttl,shrsubttl,outptr);+output_titlebits(shrttl,shrsubttl,outptr);fprintf(outptr,"</b:ShortTitle>\n");}}}elseif(shrttl){-output_titleinfo(shrtnsrt,shrttl,shrsubttl,outptr,"b:Title",level);+output_titleinfo(shrttl,shrsubttl,outptr,"b:Title",level);}}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is a fine way to get patches to me. And your modifications look really good in general.
So I've never seen a MODS file with a nonSort tag in the title. (I'd love to see an example.)
Based on the way you've written this patch, you are maintaining nonSort titles as a separate entity and it looks like it's just a special form of a title prefix.
If this is correct, I think the one change I'll make to your patch is to call the nonSort internally a "title prefix", which is the more general concept and reduces the "leakage" of MODS-specific things into the rest of the code.
One thing that I noticed in the output: it appears that no whitespace is added between the nonSort title and the main title. Is this correct? Should whitespace be added if the last character of the nonSort title isn't whitespace? Again, I don't have any nonSort examples.
Thanks for all of your effort on this.
Chris.
P.S. I'll put this in the queue for the next release, but I have a bit of churn that's currently going on that needs to get finished first.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Based on the way you've written this patch, you are maintaining nonSort titles as a separate entity and it looks like it's just a special form of a title prefix.
Essentially my understanding as well. They are used to as a control of sorts, and are designed to be ignored in the sort process. You may be interested in the documentation on the nonSort element [1]
If this is correct, I think the one change I'll make to your patch is to call the nonSort internally a "title prefix", which is the more general concept and reduces the "leakage" of MODS-specific things into the rest of the code.
Fair enough.
One thing that I noticed in the output: it appears that no whitespace is added between the nonSort title and the main title. Is this correct? Should whitespace be added if the last character of the nonSort title isn't whitespace? Again, I don't have any nonSort examples.
Yes this is accurate and to spec. [1] You do not want to add whitespaces between the two.
specifically:
Punctuation may or may not be included within the non-sort value depending upon whether it is part of the sorting or non-sorting data. For instance, "The" as an initial article is input with space following the characters, while other data might not require a space (e.g. "L'").
I'll put this in the queue for the next release, but I have a bit of churn that's currently going on that needs to get finished first.
Thanks, no rush. I appreciate it.
I should note that the userguide I linked to has other parts included in the title. For example, <partNumber> and <partName>. The documentation includes examples of each. This can be left as a todo, but our records do not make use of these tags. Additionally, this will only work for xml2* and not anything to xml. So RIS to MODS for example will not attempt to parse the title in such a way as to create the nonSort element.
Hi All,
When transforming valid mods XML to RIS (or other formats) the nonSort portion of the title is dropped. I would expect it to appear preceding the main title.
I believe I have implemented the proper changes to make this happen. But should note that I haven't worked with C since I last contributed to this project in 2014 [1].
Can you inform me of the process of submitting patches?
Thanks,
Matt
[1] - https://sourceforge.net/p/bibutils/discussion/general/thread/cbd9e838/
Proposed patch: http://ix.io/2qvJ
This is a fine way to get patches to me. And your modifications look really good in general.
So I've never seen a MODS file with a nonSort tag in the title. (I'd love to see an example.)
Based on the way you've written this patch, you are maintaining nonSort titles as a separate entity and it looks like it's just a special form of a title prefix.
If this is correct, I think the one change I'll make to your patch is to call the nonSort internally a "title prefix", which is the more general concept and reduces the "leakage" of MODS-specific things into the rest of the code.
One thing that I noticed in the output: it appears that no whitespace is added between the nonSort title and the main title. Is this correct? Should whitespace be added if the last character of the nonSort title isn't whitespace? Again, I don't have any nonSort examples.
Thanks for all of your effort on this.
Chris.
P.S. I'll put this in the queue for the next release, but I have a bit of churn that's currently going on that needs to get finished first.
Hi Chris,
Thanks for your feedback. I'll adress your comments below inline :)
https://lccn.loc.gov/a40003181/mods
Essentially my understanding as well. They are used to as a control of sorts, and are designed to be ignored in the sort process. You may be interested in the documentation on the nonSort element [1]
Fair enough.
Yes this is accurate and to spec. [1] You do not want to add whitespaces between the two.
specifically:
Thanks, no rush. I appreciate it.
I should note that the userguide I linked to has other parts included in the title. For example,
<partNumber>
and<partName>
. The documentation includes examples of each. This can be left as a todo, but our records do not make use of these tags. Additionally, this will only work forxml2*
and not anything to xml. So RIS to MODS for example will not attempt to parse the title in such a way as to create the nonSort element.Best,
Matt
[1] - https://www.loc.gov/standards/mods/userguide/titleinfo.html#nonSort