I do the same "ugly hack", but it doesn't seem that awful to me.  If you
wanted to use a more concrete example, perhaps someone could offer a way to
make it less painful - reduce the number of parameters, etc.  It sounds as
if you are trying to decompose your templates to reduce redundant code (a
laudable plan).  XSLT lets you do it, but it doesn't make it easy.

I imagine from Cocoon's perspective, if it allowed recursive application of
logicsheets, what would be the stop condition?  It is perfectly valid to
tell Cocoon to apply a logicsheet by declaring the namespace for that
logicsheet, but then to have no elements using that namespace in the XSP
program - the logicsheet can work directly on the xsp:page element, for
instance.  Lack of namespace elements, then, is not a valid stop condition.
So what would the indication be that a logicsheet should stop being
applied?

-Christopher



                                                                                       
                                               
                      Ed Sinjiashvili                                                  
                                               
                      <[EMAIL PROTECTED]        To:       "[EMAIL PROTECTED]" <[EMAIL 
PROTECTED]>                          
                      ergo.ru>                 cc:                                     
                                               
                                               Subject:  Recursive logicsheets         
                                               
                      10/20/2003 06:10                                                 
                                               
                      AM                                                               
                                               
                      Please respond to                                                
                                               
                      users                                                            
                                               
                                                                                       
                                               
                                                                                       
                                               




Hello,

I'm using logicsheets extensively in my cocoon application.
I don't know - maybe I use them for the things that should be done in
some other way - but that does not bother me for now (I'm trying to grok
cocoon).

Here's the problem:
Let's say I have a template in my logicsheet called <my:first/>.
I would like to create another template in my logicsheet called
<my:second/> which uses <my:first/>. The following (naive?) approach
does not seem to work:

<xsl:template match="my:second">
  <my:first/>
</xsl:template>

I can use other logicsheets' elements in my logicsheet - but seems like
I just can't use definitions from the logicsheet that is applied at the
time (don't know how to call it - template-time? ;).
My guess is that XSP processor applies every logicsheet needed just once
and does not care that there might be a need to make another run.

I'd like to know what you guys do in those situations?

For now I'm using quite an ugly hack - I name templates so I could call
them later:
<xsl:template match="my:first" name="my:first">
 <!-- ... something here ... -->
</xsl:template>

<xsl:template match="my:second">
  <xsl:call-template name="my:first">
</xsl:template>

That rapidly becomes more ugly when I need to pass parameters to those
templates.

I guess I could also use <xsp:element name="my:first"/>.

Any ideas would be appreciated,

-- Ed



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to