[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Using Transforms and #include file

Subject: Using Transforms and #include file
From: "Hellstern, Manny" <manny.hellstern@xxxxxxxxxxxxxx>
Date: Tue, 13 Nov 2001 09:57:22 -0600
clienteventhandlersjs
I have a default.asp page on a web site that has the following:

	<script ID="clientEventHandlersJS" LANGUAGE="javascript">
		<!--#include file="JScripts/Buttons.js"-->
		<!--#include file="JScripts/Tabs.js"-->
		<!--#include file="JScripts/Functions.js"-->
	</script>

I am driving the content of this page by writing to ".innerHTML" of various
tags on the page using XML/XSL.  What I'd like to do is have my javascript
included with the appropriate output instead of everything loading
automatically when the default page loads.

Is it possible to have something like the following output from XSL so that
the actual script gets inserted?  I was trying to avoid actually putting all
of my script into the XSL file.

XSL snippet
     <div>
	<xsl:attribute name="Id">
	  <xsl:value-of select="JSSource" />
	</xsl:attribute>
	<script>
              <xsl:attribute name="Id">
	    <xsl:value-of select="clientEventHandlersJS" />
	  </xsl:attribute>
	  <xsl:attribute name="Language">
	    <xsl:value-of select="javascript" />
	  </xsl:attribute>
	  <xsl:copy-of select="document(<!--#include
file="JScripts/Buttons.js"-->)" / >
	</script>
    </div>

HTML output
   <div Id="JSSource">
   <script Id="clientEventHandlersJS" Language="javascript">
       function f1()
       {
           ....
       }
       function f2()
       {
           ....
       }
   </script>
   </div>

Thanks in advance.

Manny Hellstern

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.