Somehow I tuned out your CDATA discussion, sorry.

Jim wrote:
What about:
<t:comment><!-- <t:put something here ... --></t:comment> ?

Haven't touched T5 yet, but this is working for me in T4:

<div jwcid="@If" condition="ognl:false">
 <!-- COMMENT: blah blah
 <span jwcid="@Insert" value=
 -->
</div>

This has the bonus of making (most of) the section syntax-highlighted.

Jim

Josh Canfield wrote:
Neither approach really solves the problem all the way. They both
require that the commented out section is valid code.

<t:comment>
<t:put something here...
</t:comment>

Won't parse.

It would be convenient to be able to mark a component as containing
CDATA so that the template parser would leave it alone.

for instance, if the above were equivalent to:

<t:comment><![CDATA[
<t:put something here...
]]></t:comment>

which does compile.

Especially cool if you could grab the body of the cdata element as a
string and do something with it.

<t:xml.transform xml="responseXml">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:template match="/catalog/cd">
    <tr>
      <td><xsl:value-of select="title"/></td>
      <td><xsl:value-of select="artist"/></td>
    </tr>
</xsl:template>
</xsl:stylesheet>
</t:xml.transform>

Josh

On Fri, Apr 11, 2008 at 12:11 PM, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:
You can "simulate" a comment directive as a component:


public class Comment
{
 boolean setupRender() { return false;  }
}


This is a no-op component, it skips directly from the SetupRender
phase to the CleanupRender phase, rendering nothing.  This is even
less work than <t:if test="false">.


On Fri, Apr 11, 2008 at 12:03 PM, nicholas Krul <[EMAIL PROTECTED]> wrote:
Good to know that it works, but I would think thats a little dangerous...

If its not commented, I always assume its live code. There should be a way
 to comment properly.

I can do it in the jsps I stare at all day long... I'd think it reasonable
 T5 does real comments.

*I haven't tested any of this, nor have I needed to put in server side comments... I find they tend to contain old code that may be needed again
 (or 'uncomment this for...')

 --just a thought.

 --nK
 nicholas Krul



 On Fri, Apr 11, 2008 at 7:57 PM, Jim <[EMAIL PROTECTED]> wrote:

 > That's perfect, thanks Josh.
 >
 > Josh Canfield wrote:
 >
> > How about just doing whatever the equivalent to <t:if test="false"> is
 > > in T4?
 > >
 > > On Fri, Apr 11, 2008 at 11:31 AM, Jim <[EMAIL PROTECTED]> wrote:
 > >
 > >
> > > Is there a way to do server-side commenting, ala <%-- --> in JSPs?
 > > >  i.e. to
> > > comment sections that you (temporarily) don't wish to be dynamically
 > > > processed server-side?
 > > >
> > > Adding <!-- --> only precludes client-side processing, of course, and
 > > > if I
 > > > try to surround a template section (which contains Tapestry
 > > > components) with
> > > $remove$ tags, I get: "Tag __ on line __ is a dynamic component, and
 > > > may not
> > > appear inside an ignored block." Is there another way? I've been
 > > > resorting
 > > > to pasting into a separate file.
 > > >
 > > > Thanks,
 > > > Jim
 > > >
> > > ---------------------------------------------------------------------
 > > > 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]
 >
 >


--
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind


---------------------------------------------------------------------
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]

Reply via email to