Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

recursion and apply-templates

 
Tina Desai
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..
In each of the examples I have checked of recursion, it is acomplished using call templates.
In no case, apply templates can be used?
like if I wish the same template to be called ater I do some processing on the first tag encountered and then the next one by just apply templates of following-sibling?
Any example will be helpful.
Thanks in advance
Tina
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tina Desai:
In each of the examples I have checked of recursion, it is acomplished using call templates.
In no case, apply templates can be used?
like if I wish the same template to be called ater I do some processing on the first tag encountered and then the next one by just apply templates of following-sibling?
Any example will be helpful.

Why not? After you process the first child, just do
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Call it before you close the </xsl:template> of the first child.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic