Specifies the XSLT features to support during execution of the XSLT style sheet.
Namespace:
System.Xml.Xsl
Assembly:
System.Xml (in System.Xml.dll)
Visual Basic (Declaration)
Public NotInheritable Class XsltSettings
Dim instance As XsltSettings
public sealed class XsltSettings
public ref class XsltSettings sealed
public final class XsltSettings
Embedded script blocks and the XSLT document() function are optional features on the XslCompiledTransform class. These features are disabled by default. The XsltSettings class specifies which of these optional features to support. Features are enabled or disabled using the class properties. The XsltSettings object is then passed to the XslCompiledTransform..::.Load method.
Security Note: |
|---|
XSLT style sheets can include references to other files and embedded script blocks. A malicious user can exploit this by supplying you with data or style sheets that when executed can cause your system to process until the computer runs low on resources. Do not enable scripting or the document() function unless the style sheet comes from a trusted source. If you cannot verify the source of the style sheet, or if the style sheet does not come from a trusted source, use the default XSLT settings. |
The following example loads a style sheet and enables XSLT script support.
' Create the XsltSettings object with script enabled.
Dim settings As New XsltSettings(False, True)
' Create the XslCompiledTransform object and load the style sheet.
Dim xslt As New XslCompiledTransform()
xslt.Load("sort.xsl", settings, New XmlUrlResolver())
// Create the XsltSettings object with script enabled.
XsltSettings settings = new XsltSettings(false,true);
// Create the XslCompiledTransform object and load the style sheet.
XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load("sort.xsl", settings, new XmlUrlResolver());
System..::.Object
System.Xml.Xsl..::.XsltSettings
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, 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
Reference
Other Resources