How to specify a conditional test in a choose element?
Posted: Mon Feb 07, 2011 5:53 pm
Hi,
I am creating a PDF and want to use a logo on the cover that depends on information in the booktitlealt element of the ditamap. This is what I have done:
<xsl:variable name ="logotype">
<xsl copy-of select="/bookmap/booktitle/booktitlealt'/>
</xsl:variable>
<xsl:choose>
<xsl:when test="contains($logotype,'Windows')">
<fo:external-graphic-------------/>
</xsl:when>
<xsl:when test="contains($logotype,'Unix')">
<fo:external-graphic-------------/>
</xsl:when>
<xsl:otherwise>
<fo:external-graphic-------------/>
</xsl:otherwise>
</xsl:choose>
When I publish the PDF, the logo used is always the one in the otherwise section, even though I know that the booktitlealt contains Windows or Unix. Can anyone tell me what I am doing wrong?
Thanks,
John
I am creating a PDF and want to use a logo on the cover that depends on information in the booktitlealt element of the ditamap. This is what I have done:
<xsl:variable name ="logotype">
<xsl copy-of select="/bookmap/booktitle/booktitlealt'/>
</xsl:variable>
<xsl:choose>
<xsl:when test="contains($logotype,'Windows')">
<fo:external-graphic-------------/>
</xsl:when>
<xsl:when test="contains($logotype,'Unix')">
<fo:external-graphic-------------/>
</xsl:when>
<xsl:otherwise>
<fo:external-graphic-------------/>
</xsl:otherwise>
</xsl:choose>
When I publish the PDF, the logo used is always the one in the otherwise section, even though I know that the booktitlealt contains Windows or Unix. Can anyone tell me what I am doing wrong?
Thanks,
John