View Single Post
  #2 (permalink)  
Old February 9th, 2007, 03:46 PM
mhkay's Avatar
mhkay mhkay is offline
Wrox Author
Points: 18,481, Level: 59
Points: 18,481, Level: 59 Points: 18,481, Level: 59 Points: 18,481, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,960
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You can't change the values of variables in a declarative language. So the answer to your question is that you need to think about the problem a different way. If you describe the problem, rather than the way you would tackle it in Java, then it might be possible to suggest the right approach in XSLT.

However, you're already using recursion so it seems you are part way there. Usually in this kind of problem it's just a question of calculating the values of parameters to pass to the recursive templates.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote