Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# XSL处理器出现问题';s添加参数函数_C#_Xslt_Parameter Passing_Msxml - Fatal编程技术网

C# XSL处理器出现问题';s添加参数函数

C# XSL处理器出现问题';s添加参数函数,c#,xslt,parameter-passing,msxml,C#,Xslt,Parameter Passing,Msxml,我有一些代码多年来运行良好,但最近在更新到Windows10V1709之后停止了。使用XSLTemplate60.CreateProcessor()返回的处理器时,IXSLProcessor.addParameter函数已停止工作。下面是一个简单的控制台代码段,显示了问题: C#: XSLT: 正如我所提到的,这可以正常工作,我可以使用Windows10V1603重新创建正确的行为。关于可能发生的事情,我能找到的唯一提示是在过去的三月份提到了MSXML库的安全修复。有没有人知道我可以做些什么来让

我有一些代码多年来运行良好,但最近在更新到Windows10V1709之后停止了。使用XSLTemplate60.CreateProcessor()返回的处理器时,IXSLProcessor.addParameter函数已停止工作。下面是一个简单的控制台代码段,显示了问题:

C#:

XSLT:


正如我所提到的,这可以正常工作,我可以使用Windows10V1603重新创建正确的行为。关于可能发生的事情,我能找到的唯一提示是在过去的三月份提到了MSXML库的安全修复。有没有人知道我可以做些什么来让这项工作再次发挥作用,而不包括切换我正在使用的XML/XSL库?

我使用的是Windows版本1803,但也可以确认该版本上的问题。然而,这里的一个测试取代了

    oXSLProcessor.addParameter("myParameter", "Override");

为我修复了这个问题,因此您可以尝试,也就是说,不提供名称空间,而是显式传递空字符串中的第三个参数

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" omit-xml-declaration="yes" indent="no" />
    <xsl:param name="myParameter" select="'Default'" />
    <xsl:template match="/">
        My parameter is set to: <xsl:value-of select="$myParameter" />
    </xsl:template>
</xsl:stylesheet>
This should say that the value of myParameter is "Default":

            My parameter is set to: Default

This should say that the value of myParameter is "Override":

            My parameter is set to: Default
    oXSLProcessor.addParameter("myParameter", "Override");
        oXSLProcessor.addParameter("myParameter", "Override", "");