使用Powershell,我正在尝试在内存中加载XSLT文件,在转换中修改并使用它,但我继续得到“XSLT编译错误”。 XSLT文件包含导入(xsl:import href =),当我将路径设为绝对路径时,它开始工作,但是,这并不理想。所有文件都在同一目录中。
$processor = New-Object System.Xml.Xsl.XslCompiledTransform;
$settings = New-Object System.Xml.Xsl.XsltSettings;
$resolver = New-Object System.Xml.XmlUrlResolver;
[xml]$xsltdoc = Get-Content "transformMe.xslt"
# do some xml manipulations....
$processor.Load($xsltdoc, $settings, $resolver);
# I left out some things here to keep the code simple but the error happens on Load()