欢迎您访问我爱IT技术网,今天小编为你分享的编程技术是:【用XsltArgumentList实现xsl的参数调用】,下面是详细的分享!
用XsltArgumentList实现xsl的参数调用
XmlDocument XmlDoc=new XmlDocument(); XslTransform xslt=new XslTransform(); XsltArgumentList xslArg=new XsltArgumentList(); StringBuilder sb=new StringBuilder(""); |
这是xsl文件
<?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:param name="Key1"/> <xsl:param name="Path"/> <xsl:template match="/"> <xsl:apply-templates select="/DB/L[@Key=$Key1]" /> </xsl:template> <xsl:template match="L[@Type='1']"> <a target="_blank"> <xsl:attribute name="href"><xsl:value-of select="@Link" /></xsl:attribute> <img border="0"> <xsl:attribute name="width"><xsl:value-of select="@width" /></xsl:attribute> <xsl:attribute name="height"><xsl:value-of select="@height" /></xsl:attribute> <xsl:attribute name="src"><xsl:value-of select="$Path" />Res/AD/<xsl:value-of select="@File" /></xsl:attribute> </img> </a> </xsl:template> <xsl:template match="L[@Type='2']"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" > <xsl:attribute name="width"><xsl:value-of select="@width" /></xsl:attribute> <xsl:attribute name="height"><xsl:value-of select="@height" /></xsl:attribute> <param name="movie"><xsl:attribute name="value"><xsl:value-of select="$Path" />Res/AD/<xsl:value-of select="@File" /></xsl:attribute></param> <param name="quality" value="http://www.chinaz.com/high"/> <embed quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"> <xsl:attribute name="width"><xsl:value-of select="@width" /></xsl:attribute> <xsl:attribute name="height"><xsl:value-of select="@height" /></xsl:attribute> <xsl:attribute name="src"><xsl:value-of select="$Path" />Res/AD/<xsl:value-of select="@File" /></xsl:attribute> </embed> </object> </xsl:template> </xsl:stylesheet> |
xml文件
<?xml version="1.0" encoding="GB2312"?> |
以上所分享的是关于用XsltArgumentList实现xsl的参数调用,下面是编辑为你推荐的有价值的用户互动:
相关问题:请问XSLT中如何实现通过点击链接调用javascript控...
答:首先: 其次: 应该改为: ... >>详细
相关问题:如何在XSLT里调用C#的代码
答:有两种方法:1)内嵌脚本, 2)使用扩展对象 使用内嵌脚本的方法,MSDN上已经有比较清楚的描述: Script Blocks Using msxsl:script。但对扩展对象的描述好像并不清晰。其实扩展对象比内嵌更为强大。举个例子,假设我们想知道自己所关心城市的天... >>详细
相关问题:我需要将在一个xslt文件里引用多个外部xslt文件,...
答:我有现成的xsl引用的例子,作用是将原来XML转换成TXT文件.有没有QQ或者邮箱,可以发送给你做个参考. >>详细
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
