docbook-apps

Re: generating meta attributes for epub

  • 1.  Re: generating meta attributes for epub

    Posted 01-07-2011 10:59
    I've already solved this.
    Inside <xsl:template name="head.content"> I apply templates with:
    <xsl:apply-templates select="d:info/d:biblioid" mode="html.header"/>

    Then outside the template head.content, I have the following code to
    generate the meta content for biblioid:
    <xsl:template match="d:biblioid" mode="html.header">
    <xsl:if test="@class='doi' and self::node() != ''">

    <xsl:attribute name="scheme">
    <xsl:text>DCTERMS.DOI</xsl:text>
    </xsl:attribute>
    <xsl:attribute name="content">
    <xsl:value-of select="."/>
    </xsl:attribute>

    </xsl:if>

    <xsl:if test="@class='isbn' and self::node() != ''">

    <xsl:attribute name="scheme">
    <xsl:text>DCTERMS.ISBN</xsl:text>
    </xsl:attribute>
    <xsl:attribute name="content">
    <xsl:value-of select="."/>
    </xsl:attribute>

    </xsl:if>

    <xsl:if test="@class='issn' and self::node() != ''">

    <xsl:attribute name="scheme">
    <xsl:text>DCTERMS.ISSN</xsl:text>
    </xsl:attribute>
    <xsl:attribute name="content">
    <xsl:value-of select="."/>
    </xsl:attribute>

    </xsl:if>
    </xsl:template>

    This gives me the meta tag in XHTML of:
    content="9780643096059"/>

    It's nice coding because it also tests whether the biblioid tag has content;
    if not, it won't output.

    Dave Gardiner