xsl:choose und Attribute
Von: , Frage gestellt am Mo, 8. Mai 2006
Hi Zusammen,
ich möchte in XSLT Elemente in Abhängigkeit vom Attribut ausgeben. Versucht habe ich es bisher so:
<xsl:template match="Symbol">
<xsl:choose>
<xsl:when test="@stopp" >
<fo:list-block
start-indent="30pt"
provisional-distance-between-starts="20pt"
provisional-label-separation="10pt">
<fo:list-item>
<fo:list-item-label >
<fo:block>S </fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block><xsl:value-of select="."/></fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
</xsl:when>
<xsl:otherwise>
<fo:list-block
start-indent="30pt"
provisional-distance-between-starts="20pt"
provisional-label-separation="10pt">
<fo:list-item>
<fo:list-item-label >
<fo:block>N </fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block><xsl:value-of select="."/></fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Funktioniert aber leider nicht.
Kann mir jemand sagen warum?
Grüße
Tobey
ich möchte in XSLT Elemente in Abhängigkeit vom Attribut ausgeben. Versucht habe ich es bisher so:
<xsl:template match="Symbol">
<xsl:choose>
<xsl:when test="@stopp" >
<fo:list-block
start-indent="30pt"
provisional-distance-between-starts="20pt"
provisional-label-separation="10pt">
<fo:list-item>
<fo:list-item-label >
<fo:block>S </fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block><xsl:value-of select="."/></fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
</xsl:when>
<xsl:otherwise>
<fo:list-block
start-indent="30pt"
provisional-distance-between-starts="20pt"
provisional-label-separation="10pt">
<fo:list-item>
<fo:list-item-label >
<fo:block>N </fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block><xsl:value-of select="."/></fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Funktioniert aber leider nicht.
Kann mir jemand sagen warum?
Grüße
Tobey
