On 12-11-05 10:31, Henri-Damien LAURENT wrote:
> I have managed to create marcrecord from epub files fairly easily :
> a) unzip my_epub.epub content.opf
> b) xsltproc DC2MARC21slim.xsl content.opf >my_epub.marcxml
> And you get a fairly good MARC21slim bibliorecord. Thanks Library of
> Congress for your wonderful xslts.
> Some notes :
> ** EPUB files happen to contain my_epub.opf rather than content.opf,
> but this is rather anecdotic. One could use
> for i in *.epub
> unzip $i *.opf -d `basename $i epub`
> and get a list of directories containing the *.opf file.
The OPF file in an EPUB can have any name at all. The correct way to
find the OPF file is top open the container.xml file in the EPUB and
parse it, looking for the <rootfile> tag that specifies the OPF name.