Hi Sharif,

On Tue, Apr 20, 2010 at 12:08 PM, Sharif Islam <mis...@illinois.edu> wrote:
> Hi,
>
> Has anyone used the XML::XSLT module to convert onix data to marc.
>
> I tried using the xsl from the loc:
> http://www.loc.gov/standards/marcxml/xslt/ONIX2MARC21slim.xsl
>
> #!/usr/bin/perl
> use strict;
> use XML::XSLT ;
>
> my $xmlFilename = "onix.xml" ;
> my $xslFilename =  "ONIX2MARC21slim.xsl" ;
>
> my $xslt = XML::XSLT->new($xslFilename, warnings => 1);
> $xslt->transform($xmlFilename);

To get a MARC record, assuming you want the ISO2709 serialization, the
program could continue as follows:

my $marcxml = $xslt->toString;
use MARC::Record;
use MARC::File::XML;
my $marcrec = MARC::Record->new_from_xml($marcxml, 'UTF-8');
print $marcrec->as_usmarc();

Regards,

Galen
-- 
Galen Charlton
gmcha...@gmail.com

Reply via email to