cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sreedhar Chintalapaty" <schintalap...@ptc.com>
Subject RE: [OT] uneven tags inside XSLT conditionals
Date Sun, 17 Mar 2002 16:33:46 GMT
Tom,

It's not clear what how you want to differentiate between when and
otherwise, so my answer may be way off; however, if you want to
differentiate at the cell (<td>) level, then try with the <tr> tags outside
the test:

	<tr>
  		<xsl:when test="position() mod 2">
			<td>
				<xsl:value-of select="@name"/>
			</td>
		</xsl:when>
		<xsl:otherwise>
			<td>
				<xsl:value-of select="@name"/>
			</td>
		</xsl:otherwise>
	</tr>

HTH,

Sreedhar


-----Original Message-----
From: tvon@etria.org [mailto:tvon@etria.org]
Sent: Sunday, March 31, 2002 11:16 AM
To: cocoon-users@xml.apache.org
Subject: [OT] uneven tags inside XSLT conditionals


Hey,

  I've done some googling and I cant find the answer to this.

  I basically want to do:

<xsl:choose>
  	<xsl:when test="position() mod 2">
		<tr>
			<td>
				<xsl:value-of select="@name"/>
			</td>
	</xsl:when>
	<xsl:otherwise>
			<td>
				<xsl:value-of select="@name"/>
			</td>
		</tr>
	</xsl:otherwise>
</xsl:choose>


So basically there will be two columns of @name printed.  The problem with
this setup is that the <tr> and </td> make the whole thing
malformed/invalid due to the broken nesting.  Is there a way to get around
this, or maybe a more "proper" way of achieving the same end?

-Tom




---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>




---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message