You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Christian Barth <co...@barth-zone.de> on 2006/01/17 20:00:04 UTC
What's wrong with my XSL??
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@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: What's wrong with my XSL??
Posted by Geert Josten <Ge...@daidalos.nl>.
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@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: What's wrong with my XSL??
Posted by Christian Barth <co...@barth-zone.de>.
Oh man, what a silly mistake. Thanks anyway.
I think it's enough for today.
See you guys tomorrow.
G'Night,
Barthi
> -----Original Message-----
> From: Aurélien DEHAY [mailto:ad@zorel.org]
> Sent: Tuesday, January 17, 2006 8:08 PM
> To: users@cocoon.apache.org
> Subject: Re: What's wrong with my XSL??
>
> Hello.
>
> Christian Barth a écrit :
> > 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>
> >
> The
> <xsl:when>...</xsl:when><xsl:otherwise>...</xsl:otherwise>
> should be in a <xsl:choose> element:
> http://zvon.org/xxl/XSLTreference/OutputExamples/example_13_59
> _frame.html
>
> Regards.
> Aurélien.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: What's wrong with my XSL??
Posted by Aurélien DEHAY <ad...@zorel.org>.
Hello.
Christian Barth a écrit :
> 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>
>
The <xsl:when>...</xsl:when><xsl:otherwise>...</xsl:otherwise> should be
in a <xsl:choose> element:
http://zvon.org/xxl/XSLTreference/OutputExamples/example_13_59_frame.html
Regards.
Aurélien.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org