国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > XML > 正文

在XsltArgumentList中調(diào)用xsl參數(shù)

2024-09-05 20:54:29
字體:
供稿:網(wǎng)友

XmlDocument XmlDoc=new XmlDocument();
XmlDoc.Load(strFilePath);

XslTransform xslt = new XslTransform();
xslt.Load(strXslPath);

XsltArgumentList xslArg = new XsltArgumentList();
xslArg.AddParam("Key1", "",IXPath);
xslArg.AddParam("Path", "",strPath);

StringBuilder sb = new StringBuilder("");
StringWriter sw = new StringWriter(sb);
XmlTextWriter writer = new XmlTextWriter(sw);
xslt.Transform(XmlDoc,xslArg,writer,null);
writer.Close();
HXML.InnerHtml=sb.ToString();

這是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://m.survivalescaperooms.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"?>
<DB>
<L Name="測(cè)試1" height="100" width="100" Link="http://m.survivalescaperooms.com" File="20056171345164340.gif" Key="200561713451653143405" Type="1" />
</DB>

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 平乡县| 交城县| 琼结县| 青海省| 尚志市| 都匀市| 米易县| 深州市| 余江县| 越西县| 会昌县| 莎车县| 罗源县| 类乌齐县| 昌吉市| 攀枝花市| 辽阳县| 根河市| 开原市| 中牟县| 清徐县| 谢通门县| 黎川县| 平邑县| 黔西| 东乌珠穆沁旗| 商洛市| 锡林郭勒盟| 乌恰县| 壤塘县| 富平县| 富宁县| 萨嘎县| 永仁县| 湘阴县| 太仓市| 鄢陵县| 威信县| 旬阳县| 德庆县| 乳山市|