cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ard Schrijvers" <a.schrijv...@hippo.nl>
Subject RE: disable-output-escaping htmlserializer
Date Sat, 07 Jan 2006 11:25:19 GMT

> 
> yes, that should work.  Good thinking, Joose.  Just curious, though, -
> won't this be a considerable performance hit?

You won't notice for xml files of ordinary length (and I doubt you would for even large ones).
What I do prefer by the way is to have it generic with multiple apply-templates calling themselves
but that is probable something you could call favor

> 
> On 1/6/06, Joose Vettenranta <joose@iki.fi> 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 >&lt;tr
> > > 
> class="Highlight"&gt;<?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: users-unsubscribe@cocoon.apache.org
> > > For additional commands, e-mail: users-help@cocoon.apache.org
> > >
> >
> > --
> > "Always remember that you are unique, just like everyone else!"
> > * http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *
> >
> >
> > 
> ---------------------------------------------------------------------
> > 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
> 
> 

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


Mime
View raw message