XML参数化模板的问题!

xiaowangzi 2002-08-14 05:08:42
。。。。
<sql:header>
<sql:param name='CustomerID'>A</sql:param>
</sql:header>
。。。。
在这段XML片段中A是固定的参数,我现在想让这个参数值的根据前面ASP传来的参数。
但是如何来接受这样的参数?分数不够可以加!
...全文
98 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
孟子E章 2002-08-14
  • 打赏
  • 举报
回复
addParameter Method [Visual Basic]
Adds parameters into an XSL Transformations (XSLT) style sheet.

[Script]
Script Syntax
objXSLProcessor.addParameter(baseName, parameter, namespaceURI);
Parameters
baseName
The name that will be used inside the style sheet to identify the parameter context.
parameter
A number, Boolean, string, IXMLDOMNodeList, or IXMLDOMNode. Passing in a single node will produce a node list that contains one node (shortcut).
namespaceURI (optional)
An optional namespace.
Example
var xslt = new ActiveXObject("Msxml2.XSLTemplate");
var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
var xslProc;
xslDoc.async = false;
xslDoc.load("sample.xsl");
xslt.stylesheet = xslDoc;
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
xmlDoc.async = false;
xmlDoc.load("books.xml");
xslProc = xslt.createProcessor();
xslProc.input = xmlDoc;
xslProc.addParameter("param1", "Hello");
xslProc.transform();
alert(xslProc.output);
File Name: Sample.xsl

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:param name="param1"/>
<xsl:template match="/">
The parameter value was: <xsl:value-of select="$param1"/>
</xsl:template>
</xsl:stylesheet>

8,906

社区成员

发帖
与我相关
我的任务
社区描述
XML/XSL相关问题讨论专区
社区管理员
  • XML/XSL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧