How to specify a conditional test in a choose element?
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 16
- Joined: Wed Nov 24, 2010 12:37 pm
How to specify a conditional test in a choose element?
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
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: How to specify a conditional test in a choose element?
Post by sorin_ristache »
Hello,
Is that a DITA OT transformation that you run in Oxygen? If not please specify the name and version of the XSLT processor that runs the transformation.
In either case: what is the message displayed by an xsl:message inserted before xsl:choose?
Regards,
Sorin
Is that a DITA OT transformation that you run in Oxygen? If not please specify the name and version of the XSLT processor that runs the transformation.
In either case: what is the message displayed by an xsl:message inserted before xsl:choose?
Code: Select all
<xsl:message>LOGOTYPE = <xsl:value-of select="$logotype"/></xsl:message>
<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>
Regards,
Sorin
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service