[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] handling of xsl-Variable in formatting text


Subject: [xsl] handling of xsl-Variable in formatting text
From: "Dirk Naujoks naujoks@xxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 15 Apr 2016 11:45:08 -0000

Good day,

i am a little mixed up how to use a once set xsl-variable.
I tried the following code


Start Code~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<xsl:template name="pruefung">
<xsl:variable name="outline">
<xsl:choose>
<xsl:when test="@pnr != '7000'">
normal
</xsl:when>
<xsl:otherwise>
bold
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<fo:table-row keep-with-next.within-column="always"
padding-bottom="1pt" padding-top="1.0pt">
<fo:table-cell number-columns-spanned="6"
padding-before="0pt">
<fo:block space-before="0pt">
<fo:leader leader-pattern="rule" rule-thickness="0.5pt"
leader-length="17cm" color="white" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row keep-together.within-column="always"
padding-bottom="1pt" padding-top="1pt" line-height="10pt">
<fo:table-cell padding-right="3pt">
<fo:block span="none" font-family="OfficinaSansLT"
font-size="{$schrifta}" font-weight="{$outline}" text-align="start">
<xsl:value-of disable-output-escaping="no" select="@pnr" />#
<xsl:value-of disable-output-escaping="no" select="@psem" />
<xsl:value-of disable-output-escaping="no" select="$outline" />
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="5pt">
<fo:block span="none" font-family="OfficinaSansLT"
font-size="{$schrifta}" text-align="start">
<xsl:choose>
<xsl:when test="@pnr != '7000'">
<xsl:value-of disable-output-escaping="no" select="@deTxt" />
</xsl:when>
<xsl:otherwise>
Note der fachpraktischen PrC<fung
</xsl:otherwise>
</xsl:choose>
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="5pt">
<fo:block span="none" font-family="OfficinaSansLT"
font-size="{$schrifta}" text-align="start" font-weight="">
<xsl:if test="@pstatus = 'AN'">
<xsl:value-of disable-output-escaping="no" select="@pstatus" />
</xsl:if>
<xsl:if test="@pstatus = 'EN'">
<xsl:value-of disable-output-escaping="no" select="@pstatus" />
</xsl:if>
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="3pt">
<fo:block span="none" font-family="OfficinaSansLT"
font-size="{$schrifta}" text-align="center" font-weight="">
<xsl:if test="@pnote != '' and @pnote != ' '">
<xsl:if test="@panerk = 'J'">
<xsl:variable name="anerk">
*
</xsl:variable>
<xsl:value-of
select="concat(substring(@pnote,1,1),',',substring(@pnote,2,1),' ',$anerk)" />
</xsl:if>
<xsl:if test="not(@panerk)">
<xsl:value-of
select="concat(substring(@pnote,1,1),',',substring(@pnote,2,1))" />
</xsl:if>
<xsl:if test="@panerk = 'N'">
<xsl:value-of
select="concat(substring(@pnote,1,1),',',substring(@pnote,2,1))" />
</xsl:if>
</xsl:if>
</fo:block>
</fo:table-cell>
<fo:table-cell padding-right="5pt">
<fo:block span="none" font-family="OfficinaSansLT"
font-size="{$schrifta}" text-align="start" font-weight="">
<xsl:if test="@panerk = 'J'"></xsl:if>
</fo:block>
</fo:table-cell>
</fo:table-row>
<xsl:for-each select="veranst">
<xsl:call-template name="veranst" />
</xsl:for-each>
</xsl:template>
End Code~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


The variable "schrifta" works fine it is set at the beginning of the xsl-Document.
The variable "outline" doesn't work it is set. i can confirm it by using "<xsl:value-of disable-output-escaping="no" select="$outline" />" somewhere in the code e.g. after the select of psem at the beginning of this code-sniplet.


I can't format the text for the data with the pnr=7000 in the right way. Has anybody an idea how to fix it?

Thanks for your help in advance.


Current Thread