Share via


XslCompiledTransform.TemporaryFiles 属性

定义

获取包含临时文件的 TempFileCollection,这些临时文件是在成功调用 Load 方法后在磁盘上生成的。

public:
 property System::CodeDom::Compiler::TempFileCollection ^ TemporaryFiles { System::CodeDom::Compiler::TempFileCollection ^ get(); };
public System.CodeDom.Compiler.TempFileCollection TemporaryFiles { get; }
member this.TemporaryFiles : System.CodeDom.Compiler.TempFileCollection
Public ReadOnly Property TemporaryFiles As TempFileCollection

属性值

TempFileCollection 包含在磁盘上生成的临时文件。 如果调用 Load 方法不成功或者尚未启用调试,则此值为 null

示例

以下示例将临时文件的名称写入控制台。

注意

仅当使用 <msxsl:script> 块加载样式表时,才会创建临时文件。

// Create the XslCompiledTransform object.
XslCompiledTransform xslt = new XslCompiledTransform(true);

// Load the style sheet and enable scripts.
// Temporary files are created only for style sheets with <msxsl:script> blocks.
xslt.Load("output.xsl", XsltSettings.TrustedXslt, new XmlUrlResolver());

// Transform the file.
xslt.Transform("books.xml", "output.xml");

// Output names of temporary files.
foreach (string filename in xslt.TemporaryFiles)
    Console.WriteLine(filename);
' Create the XslCompiledTransform object.
Dim xslt As New XslCompiledTransform(True)

' Load the style sheet and enable scripts.
' Temporary files are created only for style sheets with <msxsl:script> blocks.
xslt.Load("output.xsl", XsltSettings.TrustedXslt, New XmlUrlResolver())

' Transform the file.
xslt.Transform("books.xml", "output.xml")

' Output names of temporary files.
Dim filename As String
For Each filename In xslt.TemporaryFiles
    Console.WriteLine(filename)
Next filename

注解

此属性标识在 XSLT 处理期间生成的文件。 这些文件放置在由 %TEMP% 环境变量指定的临时目录中 () 可以在 XSLT 处理完成后删除这些文件。

适用于

另请参阅