• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

xsl:apply-templates element  RSS feed

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am bit confused with the working of the <xsl:apply-templates> element
. When to use this element? What effect does it produce? Can someone please clarify?

Thanks,
Shiva.
 
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<xsl:apply-templates> is used for the processing of the children....otherwise the processing will stop there

e.g ur xml is:-
<html>
<body
<table>
<tr>....</tr>
</table>
</body>
</html>


XSL:

<xsl:template match="html">
......ur statements here....
</xsl:template>

<xsl:template match="body">
......ur statements here....
</xsl:template>

<xsl:template match="table">
......ur statements here....
</xsl:template>


after matching the <html> the processing will stop as children are not called...

<xsl:template match="html">
......ur statements here....
<xsl:apply-templates/>

</xsl:template>

<xsl:template match="body">
......ur statements here....
<xsl:apply-templates/>

</xsl:template>

<xsl:template match="table">
......ur statements here....
<xsl:apply-templates/>
</xsl:template>


<xsl:apply-templates/> in <html> match will call for the procesing of <body> child
<xsl:apply-templates/> in <body> match will call for the procesing of <table> child and so on...
i hope i m clear.
 
Shiva Samala
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your explanation made it clear Andy. Thanks very much.

Shiva.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!