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

プロパティ値

ディスク上に作成された一時ファイルを格納する TempFileCollectionLoad メソッドの呼び出しが正常に完了しなかった場合、またはデバッグが有効になっていない場合は、この値は null になります。

次の例では、一時ファイルの名前をコンソールに書き込みます。

Note

一時ファイルは、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 ディレクトリ (%TEMP% 環境変数で指定) に配置されます。XSLT の処理が完了したら、これらのファイルを削除できます。

適用対象

こちらもご覧ください