XsltSettings Constructors

Definition

Initializes a new instance of the XsltSettings class.

Overloads

XsltSettings()

Initializes a new instance of the XsltSettings class with default settings.

XsltSettings(Boolean, Boolean)

Initializes a new instance of the XsltSettings class with the specified settings.

XsltSettings()

Source:
XsltSettings.cs
Source:
XsltSettings.cs
Source:
XsltSettings.cs

Initializes a new instance of the XsltSettings class with default settings.

C#
public XsltSettings();

Remarks

The new XsltSettings object does not support the XSLT document() function or embedded script blocks.

Important

XSLT scripting should be enabled only if you require script support and you are working in a fully trusted environment. If you enable the document() function, you can restrict the resources that can be accessed by passing an XmlSecureResolver object to the Transform method.

See also

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

XsltSettings(Boolean, Boolean)

Source:
XsltSettings.cs
Source:
XsltSettings.cs
Source:
XsltSettings.cs

Initializes a new instance of the XsltSettings class with the specified settings.

C#
public XsltSettings(bool enableDocumentFunction, bool enableScript);

Parameters

enableDocumentFunction
Boolean

true to enable support for the XSLT document() function; otherwise, false.

enableScript
Boolean

true to enable support for embedded scripts blocks; otherwise, false.

Examples

The following example loads a style sheet and enables XSLT script support.

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

Remarks

Important

XSLT scripting should be enabled only if you require script support and you are working in a fully trusted environment. If you enable the document() function, you can restrict the resources that can be accessed by passing an XmlSecureResolver object to the Transform method.

See also

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1