예제 #1
0
        public void FstProcessor_Rusmarc()
        {
            IrbisConnection connection = Connection.ThrowIfNull();
            IrbisProvider   provider   = new ConnectedClient(connection);

            FileSpecification specification = new FileSpecification
                                              (
                IrbisPath.MasterFile,
                "IBIS",
                "rmarci.fst"
                                              );
            FstProcessor processor = new FstProcessor(provider, specification);

            MarcRecord record;
            string     fileName = Path.Combine
                                  (
                DataPath.ThrowIfNull("DataPath"),
                "TEST1.ISO"
                                  );

            using (Stream stream = File.OpenRead(fileName))
            {
                record = Iso2709.ReadRecord
                         (
                    stream,
                    IrbisEncoding.Ansi
                         )
                         .ThrowIfNull("Iso2709.ReadRecord");
            }
            MarcRecord transformed = processor.TransformRecord
                                     (
                record,
                processor.File
                                     );

            Write(transformed);
        }