i have a xml file and a related xslt file. I am using msxsl.exe and i need to pass a parameter as a command line argument and use that in my xslt file. how can i do that???
command:
msxsl.exe country.xml sheet.xslt -o country_sheet.html p1="india"
how to retrieve the value india
in my xslt file?
You can pass parameters to XSLT, how this is done depends on your XSLT processor, but usually as additional command arguments, if it's a command-line processor. But by filtering and formatting, you are mixing two concerns in one file.
You are applying templates selecting folders , but have a template matching on folder . Either change it to folder , or if you have a folders template make sure that it passes the var1 parameter value down to the folder template. Your with-param @select uses '{var}' , which selects that literal string {var} .
Answer. In order to pass multiple parameters to XSLT from BP you'll need to pass '=' as a separator.
The content model of both elements is the same. The way these elements declare variables is the same. However, the value of the variable declared using <xsl:param> is only a default that can be changed with the <xsl:with-param> element, while the <xsl:variable> value cannot be changed.
try this
<xsl:param name="p1" select="p1"/>
this would be outside any templates, acting somewhat like a global variable
yes then to use the contents of this you could use this inside a template
<xsl:value-of select="$p1"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With