Apache

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • What's wrong with my XSL?

    1 answers - 1216 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    I want to do something like the first one.
    <table>
    <tbody>
    <xsl:for-each select="*">
    <xsl:when test="local-name() = 'abweichungen'">
    <tr>
    <th>Achtung Abweichungen:</th><th></th>
    </tr>
    </xsl:when>
    <xsl:otherwise>
    <tr>
    <td><xsl:value-of select="local-name()" /></td><td><xsl:value-of
    select="."/></td>
    </tr>
    </xsl:otherwise>
    </xsl:for-each>
    <tbody>
    <table>
    But neither the 'when' nor the 'otherwise' are executed. Strange!
    This one here is working:
    <table>
    <tbody>
    <xsl:for-each select="*">
    <tr>
    <td><xsl:value-of select="local-name()" /></td>
    <td><xsl:value-of select="."/></td>
    </tr>
    </xsl:for-each>
    </tbody>
    </table>
    So, what's wrong?
    Thanks,
    BArthi
    To unsubscribe, e-mail: users-unsubscribe (AT) cocoon (DOT) apache.org
    For additional commands, e-mail: users-help (AT) cocoon (DOT) apache.org
  • No.1 | | 529 bytes | |

    You'd better revert to the xsl-list with these questions

    Anyhow:

    You have to wrap xsl:when and xsl:otherwise elements in a xsl:choose element to make them work.

    <xsl:when test="local-name() = 'abweichungen'">

    Besides: you can use test="self::abweichungen" if your elements are not namespaced

    Cheers,
    Geert

    To unsubscribe, e-mail: users-unsubscribe (AT) cocoon (DOT) apache.org
    For additional commands, e-mail: users-help (AT) cocoon (DOT) apache.org

Re: What's wrong with my XSL?


max 4000 letters.
Your nickname that display:
In order to stop the spam: 3 + 3 =
QUESTION ON "Apache"

EMSDN.COM