Check the {@link org.marc4j.marc} package for examples about the use of the {@link org.marc4j.marc.Record} object model.
You can also pre-process the source to create MARC XML from a different format using an XSLT stylesheet. The following example creates an iterator over a collection of MARC records in MARC XML format from a MODS source and outputs MARC records in MARC21 format:
InputStream in = new FileInputStream("modsfile.xml"); MarcStreamWriter writer = new MarcStreamWriter(System.out, Constants.MARC8); MarcXmlReader reader = new MarcXmlReader(in, "http://www.loc.gov/standards/marcxml/xslt/MODS2MARC21slim.xsl"); while (reader.hasNext()) { Record record = reader.next(); writer.write(record); } writer.close();@author Bas Peters @version $Revision: 1.4 $
|
|
|
|