You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Christian Tanzmann <ch...@t-online.de> on 2005/05/03 13:21:41 UTC

Velocity and XSL

Hi,
I would combine an XSL File with Velocity Statements but it dont work.
Because the XSL Transformer cant interprete velocity. 
I have following file:

<xsl:template match="site">
    <!-- IncludeTop Begin -->
	<html>
      <head>
        <title>BLA</title>
      </head>

	  <body bgcolor="#CCCCBB">
        <table border="0" cellspacing="0" cellpadding="5" width="100%">
          <tbody>
            <tr>
              <td bgcolor="#DDDDDD" align="left"><img border="0"
src="images/topLogo.gif" /></td>
            </tr>
          </tbody>
        </table>	
	
      <table border="0" width="100%" bgcolor="#CCCCAA" cellpadding="3">
         <tr>
	       <td>	
             <table border="0" align="center" cellspacing="0"
cellpadding="0" width="150">
               <tbody>
    	         <tr>
    		       <td valign="top"><img
src="images/menu/QH_Seperator.gif" /></td>
-->			   #foreach($i in $quickHeaderMenuList)
-->                    <td>
-->  	                   <a
href="viewQuickHeaderContent.do?quickHeaderMenuID=$i.menuid">
-->                        <img border="0" src="$i.picturesrc"
alt="$i.name"/>
-->                      </a>
-->                   </td>
-->              	    <td valign="top"><img
src="images/menu/QH_Seperator.gif" /></td>
-->	   		   #end
    	             </tr>	
                 </tbody>
               </table>
             </td>
           </tr>
         </table>
	<xsl:apply-templates/>
      </body>
    </html>
  </xsl:template>

It is possible that I can use the foreach Velocity Statement in a XSL
File???

Or how can I get the similar with a other solution?

Greets
Christian


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


Re: Velocity and XSL

Posted by Chris Maloney <co...@chrismaloney.com>.
Why not use the <xsl:for-each>?  What is $quickHeaderMenuList? 
Is it a node list?

Christian Tanzmann wrote:

>Hi,
>I would combine an XSL File with Velocity Statements but it dont work.
>Because the XSL Transformer cant interprete velocity. 
>I have following file:
>
><xsl:template match="site">
>    <!-- IncludeTop Begin -->
>	<html>
>      <head>
>        <title>BLA</title>
>      </head>
>
>	  <body bgcolor="#CCCCBB">
>        <table border="0" cellspacing="0" cellpadding="5" width="100%">
>          <tbody>
>            <tr>
>              <td bgcolor="#DDDDDD" align="left"><img border="0"
>src="images/topLogo.gif" /></td>
>            </tr>
>          </tbody>
>        </table>	
>	
>      <table border="0" width="100%" bgcolor="#CCCCAA" cellpadding="3">
>         <tr>
>	       <td>	
>             <table border="0" align="center" cellspacing="0"
>cellpadding="0" width="150">
>               <tbody>
>    	         <tr>
>    		       <td valign="top"><img
>src="images/menu/QH_Seperator.gif" /></td>
>-->			   #foreach($i in $quickHeaderMenuList)
>-->                    <td>
>-->  	                   <a
>href="viewQuickHeaderContent.do?quickHeaderMenuID=$i.menuid">
>-->                        <img border="0" src="$i.picturesrc"
>alt="$i.name"/>
>-->                      </a>
>-->                   </td>
>-->              	    <td valign="top"><img
>src="images/menu/QH_Seperator.gif" /></td>
>-->	   		   #end
>    	             </tr>	
>                 </tbody>
>               </table>
>             </td>
>           </tr>
>         </table>
>	<xsl:apply-templates/>
>      </body>
>    </html>
>  </xsl:template>
>
>It is possible that I can use the foreach Velocity Statement in a XSL
>File???
>
>Or how can I get the similar with a other solution?
>
>Greets
>Christian
>
>
>---------------------------------------------------------------------
>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