Share via


XslCompiledTransform 建構函式

定義

初始化 XslCompiledTransform 類別的新執行個體。

多載

XslCompiledTransform()

初始化 XslCompiledTransform 類別的新執行個體。

XslCompiledTransform(Boolean)

使用指定的偵錯設定,初始化 XslCompiledTransform 類別的新執行個體。

XslCompiledTransform()

Source:
XslCompiledTransform.cs
Source:
XslCompiledTransform.cs
Source:
XslCompiledTransform.cs

初始化 XslCompiledTransform 類別的新執行個體。

public:
 XslCompiledTransform();
public XslCompiledTransform ();
Public Sub New ()

另請參閱

適用於

XslCompiledTransform(Boolean)

Source:
XslCompiledTransform.cs
Source:
XslCompiledTransform.cs
Source:
XslCompiledTransform.cs

使用指定的偵錯設定,初始化 XslCompiledTransform 類別的新執行個體。

public:
 XslCompiledTransform(bool enableDebug);
public XslCompiledTransform (bool enableDebug);
new System.Xml.Xsl.XslCompiledTransform : bool -> System.Xml.Xsl.XslCompiledTransform
Public Sub New (enableDebug As Boolean)

參數

enableDebug
Boolean

true 表示產生偵錯資訊,否則為 false。 將它設為 true,可讓您用 Microsoft Visual Studio 偵錯工具對樣式表進行偵錯。

範例

下列範例示範如何啟用 XSLT 偵錯。

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

備註

必須符合下列條件,才能逐步執行程式碼並偵錯樣式表單:

另請參閱

適用於