yes, that should work. Good thinking, Joose. Just curious, though, - won't this be a considerable performance hit?
On 1/6/06, Joose Vettenranta <[EMAIL PROTECTED]> wrote: > why don't you do like this: > > <xsl:for-each> > <xsl:variable name="pos" select="position()" /> > <xsl:if test="$pos mod 2 = 1"> > <tr> > <td> > <xsl:copy-of select="." /> > </td> > <td> > <xsl:copy-of select="../list[position() = ($pos + 1)]" /> > </td> > </tr> > </xsl:if> > </xsl:for-each> > > - Joose > > Ben Anderson kirjoitti 6.1.2006 kello 16:33: > > > Hi, > > I believe I have one of the exceptional cases where I need to use the > > xsl:test element with disable-output-escaping="yes". Here's my > > dilemma: > > > > <xsl:for-each ... > > <xsl:variable name="pos" select="position()"/> > > <xsl:variable name="cellContent"> > > <!-- some snazzy html --> > > </xsl:variable> > > <xsl:choose> > > <xsl:when test="($pos mod 2) = 1"> > > <xsl:text disable-output-escaping="yes"><![CDATA[<tr>]] > > ></xsl:text> > > <xsl:copy-of select="$cellContent"/> > > </xsl:when> > > <xsl:otherwise> > > <xsl:copy-of select="$cellContent"/> > > <xsl:text disable-output-escaping="yes"><![CDATA[</tr>]] > > ></xsl:text> > > </xsl:otherwise> > > </xsl:choose> > > > > The only reason I tried using xsl:text is because without it, my xsl > > document is not valid xml. Is there a way around this? If not is > > there any particular reason I'm getting this as my output: > > > > <?javax.xml.transform.disable-output-escaping ><tr > > class="Highlight"><?javax.xml.transform.enable-output-escaping > > > as my output? > > > > I'm using saxon... and I found a note by Michael Kay that says > > something like "your serializer probably doesn't support the > > disable-output-escaping interface". > > > > Any ideas? I'm guessing this is a common use case and maybe I'm > > completely missing a much easier way to do it? > > > > Thanks, > > Ben > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > -- > "Always remember that you are unique, just like everyone else!" > * http://iki.fi/joose/ * [EMAIL PROTECTED] * +358 44 561 0270 * > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]