Export (0) Print
Expand All

XslCompiledTransform.TemporaryFiles Property

Gets the TempFileCollection that contains the temporary files generated on disk after a successful call to the Load method.

Namespace:  System.Xml.Xsl
Assembly:  System.Xml (in System.Xml.dll)

public TempFileCollection TemporaryFiles { get; }

Property Value

Type: System.CodeDom.Compiler.TempFileCollection
The TempFileCollection that contains the temporary files generated on disk. This value is null if the Load method has not been successfully called, or if debugging has not been enabled.

This property identifies the files that were generated during XSLT processing. The files are placed in your Temp directory (specified by the %TEMP% environment variable) You can delete these files after the XSLT processing has completed.

The following example writes the names of temporary files to the console.

NoteNote

Temporary files are created only when loading style sheets with <msxsl:script> blocks.

// 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);

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft