Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
 XslCompiledTransform Constructor (B...
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
XslCompiledTransform Constructor (Boolean)

Updated: November 2007

Initializes a new instance of the XslCompiledTransform class with the specified debug setting.

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

Visual Basic (Declaration)
Public Sub New ( _
    enableDebug As Boolean _
)
Visual Basic (Usage)
Dim enableDebug As Boolean

Dim instance As New XslCompiledTransform(enableDebug)
C#
public XslCompiledTransform(
    bool enableDebug
)
Visual C++
public:
XslCompiledTransform(
    bool enableDebug
)
J#
public XslCompiledTransform(
    boolean enableDebug
)
JScript
public function XslCompiledTransform(
    enableDebug : boolean
)

Parameters

enableDebug
Type: System..::.Boolean

true to generate debug information; otherwise false. Setting this to true enables you to debug the style sheet with the Microsoft Visual Studio Debugger.

The following conditions must be met in order to step into the code and debug the style sheet:

The following example shows how to enable XSLT debugging.

Visual Basic
' Enable XSLT debugging.
Dim xslt As New XslCompiledTransform(true)

' Load the style sheet.
xslt.Load("output.xsl")

' Create the writer.
Dim settings As New XmlWriterSettings()
settings.Indent=true
Dim writer As XmlWriter = XmlWriter.Create("output.xml", settings)

' Execute the transformation.
xslt.Transform("books.xml", writer)
writer.Close()

C#
// Enable XSLT debugging.
XslCompiledTransform xslt = new XslCompiledTransform(true);

// Load the style sheet.
xslt.Load("output.xsl");

// Create the writer.
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent=true;
XmlWriter writer = XmlWriter.Create("output.xml", settings);

// Execute the transformation.
xslt.Transform("books.xml", writer);
writer.Close();

Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

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

.NET Framework

Supported in: 3.5, 3.0, 2.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Memory leak possibility      OJoergensen   |   Edit   |  

When setting the constructor argument to true, you might very well encounter a memory usage that is quite simply staggering.

If your application seems to be leaking memory at a rapid pace when running, and you use XslCompiledTransform, try calling the constructor with false as an explicit parameter. This will reduce the memory overhead.

Tags What's this?: leak (x) memory (x) Add a tag
Flag as ContentBug
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker