[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

apply-templates instead of for-each

Subject: apply-templates instead of for-each
From: xptm <xptm@xxxxxxx>
Date: Mon, 20 Sep 2004 11:39:53 +0100
xpage templates
<xsl:variable name='gtmenu' select="document('..\pages\gtmenu.xml')/XPage/MenuBar/Menu/MenuItem" />
<xsl:for-each select="$gtmenu">
<Event method="menuAction" target="{@name}" type="MenuHandler" />

where gtmenu.xml is

<?xml version="1.0" encoding="ISO-8859-1"?>
<XPage op-menus="AmbitoLista,DocumentoSerieLista,DocumentoTipoListaRef,EntidadeListaDoc,SessaoLista,TarefaTipoListaRef">
<Menu name="mnuFile" content="File">
<MenuItem name="mnuOp1" content="AmbitoLista" />
<MenuItem name="mnuOp2" content="DocumentoSerieLista" />
<MenuItem name="mnuOp3" content="DocumentoTipoListaRef" />
<MenuItem name="mnuOp4" content="EntidadeListaDoc" />
<MenuItem name="mnuOp5" content="SessaoLista Serie" />
<MenuItem name="mnuOp6" content="TarefaTipoListaRef" />
<MenuItem name="mnuExit" content="Exit" op-menu="0"/>

to produce

   <Event type="MenuHandler" target="mnuOp1" method="menuAction"/>
   <Event type="MenuHandler" target="mnuOp2" method="menuAction"/>
   <Event type="MenuHandler" target="mnuOp3" method="menuAction"/>
   <Event type="MenuHandler" target="mnuOp4" method="menuAction"/>
   <Event type="MenuHandler" target="mnuOp5" method="menuAction"/>
   <Event type="MenuHandler" target="mnuOp6" method="menuAction"/>
   <Event type="MenuHandler" target="mnuExit" method="menuAction"/>

that is working ok. But then i try to replace the for-each to

<xsl:apply-templates select="$gtmenu" mode="event"/>

 <xsl:template match="$gtmenu" mode="event">
  <Event method="menuAction" target="{@name}" type="MenuHandler" />

but thos wonm't work. What am i thinking wrong?


Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.