Package org.marc4j

Examples of org.marc4j.MarcReader


        InputStream input = ReadMarcExample.class
                .getResourceAsStream("resources/brkrtest.mrc");

        OutputStream out = new FileOutputStream("c:/temp/summerland.xml");

        MarcReader reader = new MarcStreamReader(input);
        MarcWriter writer = new MarcXmlWriter(out, true);

        AnselToUnicode converter = new AnselToUnicode();
        writer.setConverter(converter);

        while (reader.hasNext()) {
            Record record = reader.next();
            writer.write(record);
        }
        writer.close();
    }
View Full Code Here


        Hashtable table = new Hashtable();

        int counter = 0;

        MarcReader reader = new MarcStreamReader(input);
        while (reader.hasNext()) {
            counter++;

            Record record = reader.next();

            List fields = record.getVariableFields();
            Iterator i = fields.iterator();
            while (i.hasNext()) {
                VariableField field = (VariableField) i.next();
View Full Code Here

    public static void main(String args[]) throws Exception {

        InputStream input = ReadMarcExample.class
                .getResourceAsStream("resources/summerland.mrc");
       
        MarcReader reader = new MarcStreamReader(input);

        String stylesheetUrl = "http://www.loc.gov/standards/mods/v3/MARC21slim2MODS3.xsl";
        Source stylesheet = new StreamSource(stylesheetUrl);
       
        DOMResult result = new DOMResult();
        MarcXmlWriter writer = new MarcXmlWriter(result, stylesheet);
        writer.setConverter(new AnselToUnicode());
        while (reader.hasNext()) {
            Record record = (Record) reader.next();
            writer.write(record);
        }
        writer.close();

        Document doc = (Document) result.getNode();
View Full Code Here

TOP

Related Classes of org.marc4j.MarcReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.