Monthly archives: October 2007

 

 

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 [...]