View Single Post
Old September 29th, 2006, 01:27 PM
prithvi28 prithvi28 is offline
Registered User
Join Date: Sep 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default My first XSLT - 2 questions

     I am developing my first XSLT scripts. I have 2 questions. Any help will be appreciated.
1. I have a phone number element in the input XML which must be reformatted. The phone # apperas multiple times(mobile , work, home). I have the following to transform the phone number which is working fine:
    <xsl:for-each select="n1:mobile">
                                        <xsl:variable name="curr_val" select="."/>
                                        <xsl:variable name="del_char" select="'()-'"/>
                                        <xsl:variable name="replace_char" select="''"/>
                                        <xsl:variable name="translate_result" select="translate($curr_val, $del_char, $replace_char)"/>
                                            <xsl:value-of select="$translate_result"/>
Now my question is, is there a way to reuse this transformation by having it saved in some common place accessible to multiple XSLT files? Do I have to rewrite this code for every phone element?

2.I have another field for system time. The current specifications don't say the format of the time. I have to convert that to GMT timezone. How can I do this.

I tried to find something on internet. So far didn't find anything.