• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is xsl:apply-templates exactly the same as function calls ?

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is xsl:apply-templates exactly the same as function calls ?
I mean can we use xsl:apply-templates in a tamplate which is
itself referred by another template using xsl:apply-templates...
please note that i'm using XT, does it support such hierarchy ?
and does anybody know about any program that can form a
a single, standard html table from the input XML document ?
i mean that program may have a built-in generic style sheet for
this transformation.....
thanx in advance for any suggessions, help...
Asim Zafar
 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Give the template you want to call within the other template a name attrib and then use xsl:call-template. eg:-
<xsl:template match="record">
<tr>
<xsl:call-template name="Contents"/>
</tr>
</xsl:template>
I dunno about your other thing - sounds like you should make an xsl doc to handle that for you...
Brendan.
 
Asim Zafar
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanx for your reply,
actually my questions is for hierarcial calls, what i mean here is that in the example you've given i.e
<xsl:template match="record">
<tr>
<xsl:call-template name="Contents"/>
</tr>
</xsl:template>
here "Contents" is a template, can we call another template say "Third" from our "Contents" template and so on... as we do in function calls, like a called function can call other functions and so on.. can we do it in templates ?
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you can call a template from within another 'called' template similar to functions or stored procedure calls in conventional programming. This is how you use recursion to process a node-set.
 
Asim Zafar
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
but does [XT] support this
XT is not giving any errors but its also not showing the output of third level template, any suggessions, tips ?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic