how to pass a parameter and use that in my xslt

混江龙づ霸主 提交于 2019-12-10 03:34:29

问题


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?


回答1:


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"/>


来源:https://stackoverflow.com/questions/4322807/how-to-pass-a-parameter-and-use-that-in-my-xslt

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!