velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <ge...@optonline.net>
Subject Re: [DVSL] named templates and <xsl:call-template> pendant ...
Date Sun, 07 Apr 2002 16:15:17 GMT
On 4/7/02 12:07 PM, "Peter Sojan" <ilikeunix@gmx.net> wrote:

> On Sun, Apr 07, 2002 at 11:52:07AM -0400, Geir Magnusson Jr. wrote:
> 
>> You mean just something like :
>>    $context.callTemplate( $node.selectNode("foo/bar"), "templatename")
>> 
> 
> As far as I can see, there is only one attribute in the call-template
> directive in XSLT and optional parameters in the body:
> 
> -------------------------------------------
> <xsl:call-template
> name = qname>
> <!-- Content: xsl:with-param* -->
> </xsl:call-template>
> ------------------------------------------
> 
> 
>> How do you think the syntax should be?
> 
> In DVSL a template definition begins with the #match clause, so that must
> be extended to support an optional name for the template:
> 
> #match(<matching-element>, [<templatename>])
> 
> which could then be called via:
> 
> $context.callTemplate(<templatename>)

That's easily doable - I assume the current value of $node would then be the
value of $node which called it?

So you might phrase as

  $context.callTemplate( $node, templatename)

As you then can do things like

  #foreach($n in $node.selectNodes("foo/bar"))
      $context( $n, "foobartempalte")
  #end


> I have absolutely no clue how parameters which are enclosed in the body
> of the XSLT call-template tag should be handled in DVSL.


Well, we could have that as an attribute map of some type?

Thx

> 
> see http://www.w3.org/TR/xslt#element-with-param for an example how this
> is done in XSLT ...
> 
> so long 
> Peter
> 
> 
> 
> --
> To unsubscribe, e-mail:
> <mailto:velocity-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:velocity-user-help@jakarta.apache.org>
> 

-- 
Geir Magnusson Jr.                                     geirm@optonline.net
System and Software Consulting
Be a giant.  Take giant steps.  Do giant things...


--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message