← Prev in month ← Prev in thread

Adding releaseinfo to variable (to display in footer)

From
Jen <>
Date
2013-10-14T12:52:05+00:00
ID
Thread
Adding releaseinfo to variable (to display in footer)
Hi everyone,

Hoping for a little help yet again :) I'd like my footers to display the value of the <releaseinfo> element (in the example below, 3.2), but they are empty in PDF output. I'm pretty sure that the variable that should hold the version never gets populated, but I don't understand why.

(In the future, I'd like to have productname+releaseinfo, but I got stuck before having to figure out concatenations.)

In my XML, I have this:

<book xmlns="http://docbook.org/ns/docbook" version="5.0">

<info>

<title>CTU User Guide</title>

<releaseinfo>3.2</releaseinfo>

<productname>CTU></productname>

</info>

[...]

</book>

In my XSL, I have:

		<xsl:variable name="Version">

				<xsl:when test="//releaseinfo">

			<xsl:choose>

					<xsl:text>CTU </xsl:text>

					<xsl:value-of select="//releaseinfo"/>

				</xsl:when>

				<xsl:otherwise>

                  CTU 3.0

				</xsl:otherwise>

			</xsl:choose>

		</xsl:variable>

		<xsl:choose>

			<xsl:when test="$sequence='blank'">

				<xsl:choose>

					<xsl:when test="$double.sided != 0 and $position = 'left'">

						<xsl:value-of select="$Version"/>

					</xsl:when>

					<xsl:when test="$double.sided = 0 and $position = 'center'">

						<!-- nop -->

					</xsl:when>

					<xsl:otherwise>

						<fo:page-number/>

					</xsl:otherwise>

				</xsl:choose>

			</xsl:when>

			<xsl:when test="$pageclass='titlepage'">

				<!-- nop: other titlepage sequences have no footer -->

			</xsl:when>

			<xsl:when test="$double.sided != 0 and $sequence = 'even' and $position='left'">

				<fo:page-number/>

			</xsl:when>

			<xsl:when test="$double.sided != 0 and $sequence = 'odd' and $position='right'">

				<fo:page-number/>

			</xsl:when>

			<xsl:when test="$double.sided = 0 and $position='right'">

				<fo:page-number/>

			</xsl:when>

			<xsl:when test="$double.sided != 0 and $sequence = 'odd' and $position='left'">

				<xsl:value-of select="$Version"/>

			</xsl:when>

			<xsl:when test="$double.sided != 0 and $sequence = 'even' and $position='right'">

				<xsl:value-of select="$Version"/>

			</xsl:when>

			<xsl:when test="$double.sided = 0 and $position='left'">

				<xsl:value-of select="$Version"/>

			</xsl:when>

			<xsl:otherwise>

				<!-- nop -->

			</xsl:otherwise>

		</xsl:choose>

	</xsl:template>

(This part is a bit messy, I think, but I inherited the customization layer and I don't want to mess with it too much.)

If anyone can shed any light, it would help a ton - I'm very new to all this and it gets confusing at times.

Thanks,

Jen
← Prev in month ← Prev in thread