]> granicus.if.org Git - docbook-dsssl/commitdiff
Improved opf.spine with info variable
authorThomas Schraitle <tom_schr@web.de>
Thu, 2 May 2013 06:33:45 +0000 (06:33 +0000)
committerThomas Schraitle <tom_schr@web.de>
Thu, 2 May 2013 06:33:45 +0000 (06:33 +0000)
xsl/epub/docbook.xsl

index 5af8d0fb52158d70644cb586ae22ef73c5011010..cd34e966427a5c3b3948fa0016b1f30873dcc739 100644 (file)
   </xsl:template>
 
   <xsl:template name="opf.spine">
-
+    <xsl:variable name="info" select="*/*[contains(local-name(.), 'info')][1]"/>
     <xsl:element namespace="http://www.idpf.org/2007/opf" name="spine">
       <xsl:attribute name="toc">
         <xsl:value-of select="$epub.ncx.toc.id"/>
       </xsl:attribute>
 
-      <xsl:if test="/*/*[cover or contains(name(.), 'info')]//mediaobject[@role='cover' or ancestor::cover]"> 
+      <xsl:if test="$info/cover or $info//mediaobject[@role='cover' or ancestor::cover]"> 
         <xsl:element namespace="http://www.idpf.org/2007/opf" name="itemref">
           <xsl:attribute name="idref">
             <xsl:value-of select="$epub.cover.id"/>