Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
XsltSettings Class
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
XsltSettings Class

Updated: November 2007

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
Visual 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 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.

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 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
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker