Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Referencing environment variables in XSLT [Thread Next] Re: Referencing environment variables in XSLTTo: NULL Date: 5/5/2005 2:36:00 PM Jason wrote: > Thanks for the reply. How would I use XSLT extensions to access environment > variables? This is a controlled envrionment in which I can guarantee I will > always run under IE6. Here it is: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:user="http://mycompany.com/mynamespace" xmlns:msxsl="urn:schemas-microsoft-com:xslt" > <msxsl:script language="JScript" implements-prefix="user"> function getEnvVar(name) { var wshell = new ActiveXObject('WScript.Shell'); var env = wshell.Environment('System'); return env(name); } </msxsl:script> <xsl:template match="/"> <xsl:value-of select="user:getEnvVar('PATH')"/> </xsl:template> </xsl:stylesheet> PS. And beware of security issues. -- Oleg Tkachenko [XML MVP, MCP] http://blog.tkachenko.com | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
