Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: call javascript function in xsl [Thread Next] Re: call javascript function in xslTo: NULL Date: 2/7/2005 4:19:00 PM Probably those script definitions need to be available to the stylesheet when it's first parse, not when it's actually transforming the XML. So in that case, stuff inside <xsl:if> and <xsl:choose> would be unavailable to the stylesheet as extension functions. In that case I'd suggest trying <xsl:include /> or <xsl:import /> to bring in your function library at the start of the stylesheet (outside xsl:template elements), and see if that helps : http://www.w3schools.com/xsl/el_include.asp http://www.w3schools.com/xsl/el_import.asp Cheers - Neil On Mon, 7 Feb 2005 07:59:04 -0800, brian_harris <brianharris@d...> wrote: >I believe that I mean extension functions in XSL. These functions are >executed to create specific data that creates data for HTML document being >created. So they are executed in processing of XSL, not later when HTML >document being executed > >"Neil Smith [MVP Digital Media]" wrote: > >> Do you mean extension functions for XSL ? Or more likely did you mean >> javascript embedded in HTML documents ? In case 2, I would just add at >> the top of the stylesheet, in the HTML <head></head> tags, >> >> <script src="http://path/to/your/javascript-file.js" >> language="javascript1.2" type="text/javascript"></script> >> >> And then host your javascript-file.js in an appropriate place on your >> server ;-) >> >> Cheers - Neil >> >> On Thu, 3 Feb 2005 09:29:01 -0800, brian_harris >> <brian_harris@d...> wrote: >> >> >I have an application that has several XSL style sheets. In the style sheets >> >I am using the xsl:select tag to define javascript functions. At this time I >> >have duplicated many of the same javascript functions in seperate style >> >sheets, as per book examples. But I now would like to have only 1 definition >> >of the functions and include it into each style sheet. I would like to know >> >if there is a way to do this. The main reason I want to do this is that in >> >one of these functions I have found a bug which will need to be fixed in each >> >XSL, so for future portability I would like to have these functions only >> >programmed once. >> >> | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
