use of bibtex.dom.BibtexFile in project mycore by MyCoRe-Org.
the class MCRBibTeX2MODSTransformer method transform.
@Override
public MCRJDOMContent transform(MCRContent source) throws IOException {
String input = source.asString();
input = fixMissingEntryKeys(input);
BibtexFile bibtexFile = parse(input);
Element collection = new MCRBibTeXFileTransformer().transform(bibtexFile);
return new MCRJDOMContent(collection);
}
use of bibtex.dom.BibtexFile in project mycore by MyCoRe-Org.
the class MCRBibTeX2MODSTransformer method parse.
private BibtexFile parse(String input) throws IOException {
BibtexFile bibtexFile = new BibtexFile();
BibtexParser parser = new BibtexParser(false);
parser.setMultipleFieldValuesPolicy(BibtexMultipleFieldValuesPolicy.KEEP_ALL);
try {
parser.parse(bibtexFile, new StringReader(input));
} catch (ParseException ex) {
MCRMessageLogger.logMessage(ex.toString());
}
return bibtexFile;
}
Aggregations