0
XSLT我有以下VBScript代码:获取类型不匹配问题,同时添加参数使用VBScript
<%
Option Explicit
#importXSLT "tcm:228-190529-2048" As expandXSLT
#importXSLT "tcm:228-642694-2048" As renderXSLT
Dim xml, currentDateTime
Set xml = getNewDomDocument()
xml.loadXML TDSE.GetListPublications(3)
expandXSLT.input = xml
Call expandXSLT.addParameter("publication", Component.Publication.Id)
expandXSLT.transform
xml.loadXML(expandXSLT.output)
'WriteOut xml.xml
currentDateTime = now
renderXSLT.input = xml
Call renderXSLT.addParameter("currentPublishedDate", currentDateTime)
renderXSLT.transform
WriteOut renderXSLT.output
Set xml = Nothing
%>
你可以看到在两个语法,其中我加入XSLT参数,第一个是做工精细即
expandXSLT.input = xml
Call expandXSLT.addParameter("publication", Component.Publication.Id)
expandXSLT.transform
然而,新的要求是,我们需要从这里发送当前日期时间的XSLT,所以我增加了相同的逻辑为当前日期&时间发送到我的XSL T,下面由我添加的代码
currentDateTime = now
renderXSLT.input = xml
Call renderXSLT.addParameter("currentPublishedDate", currentDateTime)
renderXSLT.transform
但是,当我试图运行上面的代码它得到下述错误:
类型不匹配。 (来源:调用renderXSLT.addParameter(“publishedDate”,currentDateTime))。
请建议!!