XslCompiledTransform 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 XslCompiledTransform 类的新实例。
重载
| 名称 | 说明 |
|---|---|
| XslCompiledTransform() |
初始化 XslCompiledTransform 类的新实例。 |
| XslCompiledTransform(Boolean) |
使用指定的调试设置初始化类的新实例 XslCompiledTransform 。 |
XslCompiledTransform()
- Source:
- XslCompiledTransform.cs
- Source:
- XslCompiledTransform.cs
- 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
- 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()
注解
必须满足以下条件才能单步执行代码并调试样式表:
enableDebug参数设置为true。样式表作为 URI 或实现接口的Load类的XmlReader实现传递给IXmlLineInfo方法。 该 IXmlLineInfo 接口在所有文本分析 XmlReader 对象上实现。
换句话说,如果使用对象(如或)或IXPathNavigable未实现XmlDocument接口的实现加载XPathDocument样式表,则无法调试样式XmlReader表。IXmlLineInfo
XmlResolver用于加载样式表的样式表是基于文件的XmlResolver,例如XmlUrlResolver(这是类使用XmlResolver的默认XslCompiledTransform格式)。
样式表位于本地计算机或 Intranet 上。