Menu

xml2bib reorders given name

Dan Gildea
2016-09-12
2016-09-13
  • Dan Gildea

    Dan Gildea - 2016-09-12

    xml2bib seems to be re-ordering components of a given name if there
    are spaces in the field. For example, with the input file:

    <?xml version='1.0'?>
    <mods ID='J14-1002' version='2016-09-11 21:27:59 +0200'>
      <titleInfo><title>Frame-Semantic Parsing</title></titleInfo>
      <name type='personal'>
        <namePart type='given'>Noah A.</namePart>
        <namePart type='family'>Smith</namePart>
        <role><roleTerm authority='marcrelator' type='text'>author</roleTerm></role>
      </name>
      <genre>academic journal</genre>
    </mods>
    

    I get the output file:

    @Article{J14-1002,
    author="Smith, A. Noah",
    title="Frame-Semantic Parsing"
    }
    

    Is this a bug?

    Thanks.

     
  • Chris Putnam

    Chris Putnam - 2016-09-12

    It's unexpected behavior, so it's a bug.

    The fix is a little tricky due to the recursive algorithm that lib/modsin.c uses on names. (The MODS files that bibutils writes are parsed a bit more finely than your example, which is why I haven't noticed this bug before. But bibutils should "do the right thing" with that file too.) I just fixed it after changing the way the algorithm works. The new version (5.9) should fix these cases.

    Thanks for letting me know.

     
  • Dan Gildea

    Dan Gildea - 2016-09-13

    Thank you so much! That really helps me out.

     

Log in to post a comment.