View Single Post
 
Old September 29th, 2006, 02:19 PM
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

On the first question, try to get into the habit of using xsl:apply-templates rather than xsl:for-each. Put the code for handling phone numbers in a separate template, and apply-templates whenever you want to invoke it. The details depend on whether the various phone numbers use the same element name or different element names, but the general approach works either way. If you want to invoke the template from more that one stylesheet, put it in a separate module which you can pull in using xsl:import or xsl:include.

On the second question, there's a lot of support for date and time manipulation in XSLT 2.0, but none in 1.0. If you're using a 1.0 processor you have to do it the hard way, or by calling out to another language.

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