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
Msxml上XSLT内部JScript上相对寻址的默认值_Xslt_Asp Classic_Jscript_Msxml - Fatal编程技术网

Msxml上XSLT内部JScript上相对寻址的默认值

Msxml上XSLT内部JScript上相对寻址的默认值,xslt,asp-classic,jscript,msxml,Xslt,Asp Classic,Jscript,Msxml,在WindowsServer2003或2008上的XSLT中使用JScript,使用msxml,我现在尝试完成一些简单的文件操作。JScript相对寻址初始化的默认位置是什么?我本以为它是运行XSLT的同一个位置?我要查找的文件绝对存在,但函数永远不会正确返回FileExists <msxsl:script language="JScript" implements-prefix="user"> <![CDATA[ function filecheck(x) {

在WindowsServer2003或2008上的XSLT中使用JScript,使用msxml,我现在尝试完成一些简单的文件操作。JScript相对寻址初始化的默认位置是什么?我本以为它是运行XSLT的同一个位置?我要查找的文件绝对存在,但函数永远不会正确返回FileExists

<msxsl:script language="JScript" implements-prefix="user">
    <![CDATA[
    function filecheck(x) {
        var f = 'default.asp';
        fso = new ActiveXObject('Scripting.FileSystemObject');
        s = fso.FileExists(f);
        return(s);
    }
    ]]>
</msxsl:script>  
对它的调用看起来很好,调用/返回工作正常。我遇到的问题在于JScript


谢谢你

我发现,在产生XSLT转换的经典ASP VB代码中使用xslProc.addParameter PhysicalApplicationPath,Server.MapPath~/可能不是解决这个问题的唯一方法。这将生成一个字符串,例如I:\Websites\foo\bar\,一旦对该字符串进行了解码和转换,JScript就可以将其用作所需完整路径的开始。我似乎无法在JScript本身中完成这项工作。我还没有在各种Windows服务器和承载Windows子元素的应用程序上测试过它,所以我不能说它是否能普遍工作或返回各种结果。

Add var oShell=new-ActiveXObjectWScript.Shell;WScript.EchooShell.CurrentDirectory;对你的剧本-它显示了什么?嗨,海伦。它返回值c:\windows\system32\inetsrv这是一个很好的线索,有什么建议可以继续吗?我使用的JScript中的代码看起来像shell=newActiveXObject'WScript.shell';s=shell.CurrentDirectory;回报;这是JScript代码的工作文件夹。不过,我不知道对于像您这样的案例,此路径是否为默认路径。但是CurrentDirectory是读写的,所以您可以根据需要更改它:var shell=new ActiveXObject'WScript.shell';shell.CurrentDirectory=C:\\MyFolder\\;