hi, I'm using the docbook5 1.79 stylesheets to create epub3.

When I use the standard styles I get no errors, but when I add my custom
layer I get a bunch of errors that look like this:

No template for "/book/chapter/section/section/info"

(or any of its leaves) exists in the context named

"title" in the "en" localization


I've narrowed it down to the following template.

The purpose of the template is to change the title of sections with
the remap attribute set to "Example" to prepend the word "Example" and
the number. So a section titled 'How to Wash Your Dog' might become
"Example 13.2 How to Wash Your Dog".


If you can see what I've done wrong here, please send me a clue!

thanks,

--Tim


<xsl:template match="d:section[@remap='Example']"
mode="object.title.markup" priority="1">
    <xsl:variable name="chapternode"
select="(ancestor::d:chapter|ancestor::d:appendix)[1]" />
    <xsl:text>Example </xsl:text>
    <xsl:choose>
      <xsl:when test="count($chapternode) &gt; 0">
        <xsl:apply-templates select="$chapternode" mode="label.markup" />
        <xsl:apply-templates select="$chapternode"
mode="intralabel.punctuation" />
        <xsl:choose>
          <xsl:when test="local-name($chapternode) = 'chapter'">
            <xsl:number level="any" format="1"
count="d:section[@remap='Example']" from="d:chapter" />
          </xsl:when>
          <xsl:when test="local-name($chapternode) = 'appendix'">
            <xsl:number level="any" format="1"
count="d:section[@remap='Example']" from="d:appendix" />
          </xsl:when>
        </xsl:choose>
      </xsl:when>
      <xsl:otherwise>
        <xsl:number format="1" from="d:book|d:article" level="any" />
      </xsl:otherwise>
    </xsl:choose>
    <xsl:text> </xsl:text>
    <xsl:apply-imports/>
  </xsl:template>

Reply via email to