Category archives: Tech Tips

 

 

183

VBScript: save the output as a file

To save as Excel CSV file: Response.ContentType=”application/csv” Response.AddHeader “Content-Disposition”, “filename=myfile.csv” To save as any type: Response.ContentType=”application/x-msdownload” Response.AddHeader “Content-Disposition”, “filename=sitemap.xml”

 

 

 

187

Check for HTTPS

VBScript: If LCase(request.ServerVariables(“HTTPS”)) = “off” Then response.write “Error: access denied” response.end End If JavaScript: if(location.protocol != “https:”) { alert(“Error”); }

 

150

Pass a command line parameter to an XSL stylesheet

It’s possible depending on the parser. And Saxon does support it!!! 1) Declare parameter in the stylesheet: <xsl:param name=\"x\"/> (XSLT version 1.0) <xsl:param name=\"x\" as=\"xs:integer\" required=\"yes\"/> (version 2.0) 2) Invoke Saxon as java -jar saxon8.jar source.xml style.xsl x=Atlanta In my example, I wanted to loop through the list of metro areas and create a separate [...]