Java BibTex throwing EOF error

324 views Asked by At

I am using org.jbibtex(Java BibTex) to parse BibeTex file for citeproc-Java Library. I am getting following exception:

Encountered " "," ", "" at line 7, column 2.
Was expecting one of:
    <EOF> 

Following re file entries belong to zotero based bib file

@book{arxiv.org_65_2007,
    title = {65 Admin Withdrawals},
    author = {{arXiv.org}},
    year = {2007},
    note = {Published: Online Source
Retrieved}
},
@book{american_national_standards_institute_ansi_1986,
    title = {{ANSI} X3.4-1986 - American National Standard for Information Systems — Coded Character Sets — 7-Bit American National Standard Code for Information Interchange (7-Bit {ASCII)}},
    author = {American National Standards Institute, Inc.},
    year = {1986},
    note = {Published: Standard (withdrawn Oct 11 1994, incoporated into Unicode Standard)}
}

I can see it gives error on comma but I believe this is part of bib format which I am not aware much. Following is my code:

String s = null;
         BibTeXConverter bibC = new BibTeXConverter();
         try
         {
             BibTeXDatabase db = bibC.loadDatabase(new FileInputStream("C:\\zotero.bib"));
             BibTeXItemDataProvider provider = new BibTeXItemDataProvider();
            provider.addDatabase(db);
            CSL citeproc = new CSL(provider, "ieee");
            citeproc.setOutputFormat("text");
            provider.registerCitationItems(citeproc);
            Bibliography bibl = citeproc.makeBibliography();
           System.out.println(bibl.makeString());
            for (String entry : bibl.getEntries()) {
                System.out.println(entry);
                s+=s+entry+"\n";
            }
         }
         catch(Exception ex)
         {
             System.out.println(ex.getMessage());
         }
0

There are 0 answers