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

Re: referencing a variable of a URL in a script tag

Subject: Re: referencing a variable of a URL in a script tag
From: "Richard Lewis" <richardlewis@xxxxxxxxxxxxxx>
Date: Mon, 06 Dec 2004 16:45:02 +0000
javascript src variable
On Mon, 6 Dec 2004 11:36:37 -0500, "Graber, Jeffrey"
<jeffrey.graber@xxxxxxx> said:
> 
> > Howdy
> > in my XSL file I need to include references to some javascript files (i.e  
> > 
> >         		script language="JavaScript" src="https://mycomputer.mycompany.com:7004/myapplication/js/common.js"></script>
> > 		<script language="JavaScript" src="https://mycomputer.mycompany.com:7004/myapplication/js/containerList.js"></script>
> > 
> > This works fine... However, for production, the URL will invariably be different for each installation. So I need to replace the specific URL with a variable that could be stored in one central file and referenced
> > 
> > like <script language="JavaScript" src="https://SERVERADDRESS/myapplication/js/common.js"></script>
> > 
> > Therefore, we would only have to edit the one central files to specific the SERVERADDRESS variable (i.e. SERVERADDRESS="yourcomputer.yourcompany.com)
> > 
> > Could some be kind enough to show me how this is done.
> > 
I think you could probably have a small XSL file like this:

global-variables.xsl:
<xsl:stylesheet ...>
    <xs:variable name="SERVERADDRESS">...</xsl:variable>
</xs:stylesheet>

and then use:
<xsl:include href="global-variables.xsl" />

inside each XSL file which needs the variable.

(Otherwise you should be able to pass parameters to your XSL processor
and perhaps have an OS environment variable for SERVERADDRESS).

Cheers,
Richard
-- 
  Richard Lewis
  richardlewis@xxxxxxxxxxxxxx

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.