File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes recursion and apply-templates Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "recursion and apply-templates" Watch "recursion and apply-templates" New topic
Author

recursion and apply-templates

Tina Desai
Ranch Hand

Joined: Mar 13, 2003
Posts: 365
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


Alongwith being a good coder, try to be a good professional as well!
Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
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

Joined: Nov 14, 2000
Posts: 1953
Call it before you close the </xsl:template> of the first child.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: recursion and apply-templates