xsl-list
[Top] [All Lists]

Re: [xsl] Passing parameters to an indirectly called template after matching.

2008-04-17 04:39:09
Thank you Martin for the reply.

Can I pass parameters like this.

Calling_Point => A_Named_Template, do apply-templates => {One or more
matching Templates } => A_Named_Template.

I tried to do this by passing parameters along with apply-templates,
and then passing it again from all matched templates to a named
template where I finally need it, it ended up in infinite loop. When I
just taken out the parameter passing and used global variables it
worked fine.

Thanks,
Kannan

On Thu, Apr 17, 2008 at 7:06 AM, Martin Honnen 
<Martin(_dot_)Honnen(_at_)gmx(_dot_)de> wrote:
Kannan wrote:


   <xsl:template match="ATag">
       <xsl:call-template name="ReplaceInXMLString">
           <xsl:with-param name="theNodeMatch" select="./*"/>
           <xsl:with-param name="stringToBeReplaced"
select="&quot;'&quot;"/>
           <xsl:with-param name="replacementString"
select="&quot;''&quot;"/>


 If you want to pass parameters to a named template then that named template
should have xsl:param declarations e.g.



   <xsl:template name="ReplaceInXMLString">
       <xsl:param name="theTagMatch"/>


          <xsl:param name="stringToBeReplaced"/>
          <xsl:param name="replacementString"/>

 You can also define default values e.g.
          <xsl:param name="stringToBeReplaced" select="&quot;'&quot;"/>


 --

        Martin Honnen
        http://JavaScript.FAQTs.com/

 --~------------------------------------------------------------------
 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
 To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
 or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
 --~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--