Thread: re write a code
View Single Post
  #4 (permalink)  
Old August 1st, 2007, 07:40 AM
mhkay's Avatar
mhkay mhkay is offline
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I wouldn't attempt a refactoring without knowing a lot more about the application as a whole. But when I see two bits of code as similar as the two you showed, and especially if there were several more that followed the same pattern, then I would be looking for another layer of template that takes fewer parameters.

However, XSLT 1.0 is always going to be verbose, there's no way around it. Move to 2.0 if you can.

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