Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
Previous Versions
.NET Framework 2.0
System.Xml.Xsl
XsltSettings Class

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
.NET Framework Class Library
XsltSettings Class

Note: This class is new in the .NET Framework version 2.0.

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
Visual Basic (Usage)
Dim instance As XsltSettings
C#
public sealed class XsltSettings
C++
public ref class XsltSettings sealed
J#
public final class XsltSettings
JScript
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 System.Xml.Xsl.XslCompiledTransform.Load method.

Security noteSecurity 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.

Visual Basic
' 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())
C#
// 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 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

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

.NET Framework

Supported in: 2.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker