Menu

#1152 epub files fail to create for some components

output: ePub
open
ePub (12)
5
2011-01-01
2010-11-26
No

epub files fail to generate correctly when I transform Docbook 'glossary' and 'index' chunks. The output file - which should be the mimetype file that contains only one line: <?xml version="1.0" encoding="UTF-8"?> - instead also contains a DTD and HTML code of the transformed chunk. Also, there is no HTML file generated in folder OEBPS which should contain the HTML code - only 'content.opf' and 'toc.ncx' are created in OEBPS.

I am using 1.76.1 stylesheets, and transforming using Saxon 6.5.5 through oXygen XML Editor version 12. I have changed only two parameters for the epub transformation:
epub.metainf.dir : /META-INF/
epub.oebps.dir : /OEBPS/

The mimetype file contains this code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE div
PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<div xmlns="http://www.w3.org/1999/xhtml" class="glossary" title="Acronyms and abbreviations"><div class="titlepage"><div><div><h1 class="title"><a id="acronyms"/>Acronyms and abbreviations</h1></div></div></div><dl><dt><a id="acris"/>ACRIS</dt><dd><p>Australian Collaborative Rangeland Information System</p></dd><dt><a id="bif"/>BIF</dt><dd><p>Banded ironstone formation</p></dd><dt><a id="bp"/>b.p.</dt><dd><p>Before present</p></dd><dt><a id="camba"/>CAMBA</dt><dd><p>China–Australia Migratory Bird Agreement</p></dd><dt><a id="car"/>CAR</dt><dd><p>Comprehensive, adequate and representative</p></dd><dt><a id="cites"/>CITES</dt><dd><p>Convention on International Trade in Endangered Species</p></dd><dt><a id="cn"/>C–N</dt><dd><p>Carbon to nitrogen ratio</p></dd><dt><a id="coag"/>COAG</dt><dd><p>Council of Australian Governments</p></dd><dt><a id="cru"/>CRU</dt><dd><p>Climate Research Unit</p></dd><dt><a id="csiro"/>CSIRO</dt><dd><p>Commonwealth Scientific and Industrial Research Organisation</p></dd><dt><a id="ctbcc"/>CTBCC</dt><dd><p>Centre for Tropical Biodiversity and Climate Change</p></dd><dt><a id="dcc"/>DCC</dt><dd><p>Department of Climate Change</p></dd><dt><a id="dest"/>DEST</dt><dd><p>Department of the Environment, Sport and Territories</p></dd><dt><a id="eac"/>EAC</dt><dd><p>East Australian Current</p></dd><dt><a id="eag"/>EAG</dt><dd><p>Expert Advisory Group</p></dd><dt><a id="enso"/>ENSO</dt><dd><p>El Niño–Southern Oscillation</p></dd><dt><a id="epa"/>EPA</dt><dd><p>Environmental Protection Authority</p></dd><dt><a id="esd"/>ESD</dt><dd><p>Environmental sex determination</p></dd><dt><a id="esrl"/>ESRL</dt><dd><p>Earth System Research Laboratory</p></dd><dt><a id="gbr"/>GBR</dt><dd><p>Great Barrier Reef</p></dd><dt><a id="gbrmpa"/>GBRMPA</dt><dd><p>Great Barrier Reef Marine Park Authority</p></dd><dt><a id="gcm"/>GCM</dt><dd><p>General Circulation Model</p></dd><dt><a id="ibra"/>IBRA</dt><dd><p>Interim Biogeographic Regionalisation for Australia</p></dd><dt><a id="ipcc"/>IPCC</dt><dd><p>Intergovernmental Panel on Climate Change</p></dd><dt><a id="iucn"/>IUCN</dt><dd><p>International Union for the Conservation of Nature</p></dd><dt><a id="jamba"/>JAMBA</dt><dd><p>Japan–Australia Migratory Bird Agreement</p></dd><dt><a id="knp"/>KNP</dt><dd><p>Kakadu National Park</p></dd><dt><a id="ngo"/>NGO</dt><dd><p>Non-governmental organisation</p></dd><dt><a id="noaa"/>NOAA</dt><dd><p>National Oceanic and Atmospheric Administration</p></dd><dt><a id="nrm"/>NRM</dt><dd><p>Natural resource management</p></dd><dt><a id="nrs"/>NRS</dt><dd><p>National Reserve System</p></dd><dt><a id="nrsmpa"/>NRSMPA</dt><dd><p>National Representative System of Marine Protected Areas</p></dd><dt><a id="nscabd"/>NSCABD</dt><dd><p>National Strategy for the Conservation of Australia’s Biological Diversity</p></dd><dt><a id="ppm"/>ppm</dt><dd><p>Parts per million</p></dd><dt><a id="psu"/>psu</dt><dd><p>Practical salinity unit</p></dd><dt><a id="rokamba"/>ROKAMBA</dt><dd><p>Republic of Korea–Australia Migratory Bird Agreement</p></dd><dt><a id="soi"/>SOI</dt><dd><p>Southern Oscillation Index</p></dd><dt><a id="sres"/>SRES</dt><dd><p>Special Report on Emissions Scenarios</p></dd><dt><a id="unfccc"/>UNFCCC</dt><dd><p>United Nations Framework Convention on Climate Change</p></dd><dt><a id="wons"/>WONS</dt><dd><p>Weeds of National Significance</p></dd><dt><a id="wwf"/>WWF</dt><dd><p>World Wide Fund for Nature </p></dd></dl></div>

Discussion

  • David Gardiner

    David Gardiner - 2010-11-26

    Input file to transform

     
  • David Gardiner

    David Gardiner - 2011-01-01

    I've partly succeeded in generating a glossary chunk. I had a close look at the stylesheet epub/docbook.xsl - there is some code under "<xsl:template name="chunk" priority="1">" that states what components are specified as chunks (and therefore processed when transformed). Both glossary and index components are treated as chunks IF they match several criteria. For glossary:
    <xsl:when test="local-name($node)='glossary' and (local-name($node/parent::*) = 'article' or local-name($node/parent::*) = 'book' or local-name($node/parent::*) = 'part' )">1</xsl:when>

    This indicates that a glossary will only be transformed IF its parent is a book, article or part. Sure enough, when I transformed a book with a glossary include, I got a correctly formatted HTML file for the glossary. I could not, however, get the correct HTML files if I transformed a glossary chunk on its own (ie. where glossary was the root node).

    Can the stylesheets please be changed so that you can transform glossary and index for individual testing, without the need to first include these in a book component? I can't fathom why you wouldn't want this functionality anyway.

     
  • David Gardiner

    David Gardiner - 2011-01-01
    • priority: 5 --> 7
     
  • David Gardiner

    David Gardiner - 2011-01-01
    • priority: 7 --> 5