[daisy] customizing template for particular document type

Wojciech Ciesielski ccmail at interia.pl
Mon Feb 4 08:49:03 CST 2008


Marc Portier wrote:
>
>
> Wojciech Ciesielski wrote:
>> Hi all,
>>
>> I remember that I've found a document describing how to customize 
>> template for a given document type - but unfortunately I can't find 
>> it now :( Can anybody provide me with a link?
>>
>
> http://cocoondev.org/daisydocs-2_1/374-cd/g1/26-cd.html
>
> HTH,

Thanks a lot. One - I hope last - thing... I can't manage to display my 
content via XSL :-/ I've tried to modify document-to-html.xsl in 
following way:

<xsl:template match="d:part">
    <xsl:choose>
      <xsl:when test="@daisyHtml = 'true'">
        <xsl:apply-templates select="html/body/node()" mode="PartContent"/>
      </xsl:when>
      <xsl:when test="@name = 'LiteralHtmlData' and @inlined='true'">
        <xsl:copy-of select="html/body/node()"/>
      </xsl:when>


      <xsl:when test="@name = 'PlainTextEmailContent'">
        <xsl:value-of select="'this works - to see if xsl:when works'" />
        <!-- !!!!!
           PlainTextEmailContent is a name of my custom plain-text part 
        -->
        <!-- Neither this: -->
        <xsl:value-of select="." />
        <!-- nor this: -->
        <xsl:apply-templates select="." mode="PartContent" />
        <!-- is displaying contents of my plain text part :( -->

      </xsl:when>
      <xsl:otherwise>
        <p>
          <xsl:variable name="fileName">
            <xsl:if test="@fileName != ''"><xsl:value-of select="concat('/', @fileName)"/></xsl:if>
          </xsl:variable>
          <xsl:value-of select="@label"/>: <a href="{$documentBasePath}{$document/@id}/version/{$document/@dataVersionId}/part/{@typeId}/data{$file$
          (<xsl:value-of select="@mimeType"/>,
            <xsl:call-template name="formatSize">
              <xsl:with-param name="size" select="@size"/>
            </xsl:call-template>
          <xsl:text>)</xsl:text>
        </p>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

What am I doing wrong? :-/

TIA,
Wojtek



----------------------------------------------------------------------
Sprawdz, czy pasujesz do swojego partnera!
http://link.interia.pl/f1ce7



More information about the daisy mailing list