A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.microsoft.com/en-us/dotnet/api/system.xml.xsl.xsltransform below:

XslTransform Class (System.Xml.Xsl) | Microsoft Learn

XslTransform Class Definition

Transforms XML data using an Extensible Stylesheet Language for Transformations (XSLT) style sheet.

public ref class XslTransform sealed
public sealed class XslTransform
[System.Obsolete("This class has been deprecated. Please use System.Xml.Xsl.XslCompiledTransform instead. http://go.microsoft.com/fwlink/?linkid=14202")]
public sealed class XslTransform
type XslTransform = class
[<System.Obsolete("This class has been deprecated. Please use System.Xml.Xsl.XslCompiledTransform instead. http://go.microsoft.com/fwlink/?linkid=14202")>]
type XslTransform = class
Public NotInheritable Class XslTransform
Inheritance
Attributes

XslTransform supports the XSLT 1.0 syntax. The XSLT style sheet must use the namespace http://www.w3.org/1999/XSL/Transform.

Additional arguments can also be added to the style sheet using the XsltArgumentList class. This class contains input parameters for the style sheet and extension objects which can be called from the style sheet.

To transform XML data:

  1. Create an XslTransform object.

  2. Use the Load method to load the style sheet for the transformation. This method has several overloads and can load a style sheet using an XmlReader, XPathNavigator, IXPathNavigable, or a URL with the location of the file.

  3. Use the Transform method to transform the XML data. This method has several overloads and can handle different types of input and output. You can also specify an XsltArgumentList containing additional arguments to use as input during the transformation.

Security Considerations

When creating an application that uses the XslTransform class, you should be aware of the following items and their implications:

These security issues can be mitigated by not accepting XslTransform objects, XSLT style sheets, or XML source data from untrusted sources.

Scripting Support

This class supports embedded scripting using the msxsl:script element.

In version 1.1 of the .NET Framework, the evidence of the style sheet determines what permissions are given to embedded scripts.

Semi-trusted callers: UnmanagedCode permission is required to compile the embedded script. ControlEvidence permission is required to provide Evidence to the Load method. A SecurityException is thrown if the caller does not have the necessary permissions. See System.Security.Permissions.SecurityPermission and System.Security.Permissions.SecurityPermissionFlag for more information.

The msxsl:script element has the following requirements:

Note

It is recommended that you wrap script blocks in a CDATA section.

<msxsl:script implements-prefix='xy' language='C#'>  
 <![CDATA[  
 // Add code here.  
 ]]>
</msxsl:script>  

Functions can be declared within the msxsl:script element. The following table shows the namespaces that are supported by default.

Supported Namespaces Description System System classes. System.Collection Collection classes. System.Text Text handling classes. System.Xml Core XML classes. System.Xml.Xsl XSLT classes. System.Xml.XPath XML Path Language (XPath) classes.

The supplied arguments and return values defined by the script functions must be one of the World Wide Web Consortium (W3C) types listed below. The following table details the mapping between the W3C types, either XPath or XSLT, and the corresponding .NET Framework classes.

W3C Type Equivalent .NET class String (XPath) System.String Boolean (XPath) System.Boolean Number (XPath) System.Double Result Tree Fragment (XSLT) System.Xml.XPath.XPathNavigator Node Set (XPath) System.Xml.XPath.XPathNodeIterator

If the script function utilizes one of the following numeric types: Int16, UInt16, Int32, UInt32, Int64, UInt64, Single, or Decimal, these types are coerced to Double, which maps to the W3C XPath type number.

An exception is thrown when a function is called that cannot convert the argument result to one of the required types.

Note

msxsl:script and msxsl:node-list are the only functions from the urn:schemas-microsoft-com:xslt namespace that are supported by the XslTransform class.

XslTransform has the ability to utilize common language runtime (CLR) code as an extension mechanism. This is accomplished by passing an instance of a class to the XslTransform class and calling its public methods within an XSLT style sheet. Methods that are defined with the params keyword, which allows an unspecified number of parameters to be passed, do not work correctly in this scenario. See params for more details.

For more information see XSLT Transformations with the XslTransform Class.

Constructors Properties Methods Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object) GetHashCode()

Serves as the default hash function.

(Inherited from Object) GetType()

Gets the Type of the current instance.

(Inherited from Object) Load(IXPathNavigable, XmlResolver, Evidence)

Loads the XSLT style sheet contained in the IXPathNavigable. This method allows you to limit the permissions of the style sheet by specifying evidence.

Load(IXPathNavigable, XmlResolver)

Obsolete.

Loads the XSLT style sheet contained in the IXPathNavigable.

Load(IXPathNavigable)

Obsolete.

Loads the XSLT style sheet contained in the IXPathNavigable.

Load(String, XmlResolver)

Loads the XSLT style sheet specified by a URL.

Load(String)

Loads the XSLT style sheet specified by a URL.

Load(XmlReader, XmlResolver, Evidence)

Loads the XSLT style sheet contained in the XmlReader. This method allows you to limit the permissions of the style sheet by specifying evidence.

Load(XmlReader, XmlResolver)

Obsolete.

Loads the XSLT style sheet contained in the XmlReader.

Load(XmlReader)

Obsolete.

Loads the XSLT style sheet contained in the XmlReader.

Load(XPathNavigator, XmlResolver, Evidence)

Loads the XSLT style sheet contained in the XPathNavigator. This method allows you to limit the permissions of the style sheet by specifying evidence.

Load(XPathNavigator, XmlResolver)

Obsolete.

Loads the XSLT style sheet contained in the XPathNavigator.

Load(XPathNavigator)

Obsolete.

Loads the XSLT style sheet contained in the XPathNavigator.

MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object) ToString()

Returns a string that represents the current object.

(Inherited from Object) Transform(IXPathNavigable, XsltArgumentList, Stream, XmlResolver)

Transforms the XML data in the IXPathNavigable using the specified args and outputs the result to a Stream.

Transform(IXPathNavigable, XsltArgumentList, Stream)

Obsolete.

Transforms the XML data in the IXPathNavigable using the specified args and outputs the result to a Stream.

Transform(IXPathNavigable, XsltArgumentList, TextWriter, XmlResolver)

Transforms the XML data in the IXPathNavigable using the specified args and outputs the result to a TextWriter.

Transform(IXPathNavigable, XsltArgumentList, TextWriter)

Obsolete.

Transforms the XML data in the IXPathNavigable using the specified args and outputs the result to a TextWriter.

Transform(IXPathNavigable, XsltArgumentList, XmlResolver)

Transforms the XML data in the IXPathNavigable using the specified args and outputs the result to an XmlReader.

Transform(IXPathNavigable, XsltArgumentList, XmlWriter, XmlResolver)

Transforms the XML data in the IXPathNavigable using the specified args and outputs the result to an XmlWriter.

Transform(IXPathNavigable, XsltArgumentList, XmlWriter)

Obsolete.

Transforms the XML data in the IXPathNavigable using the specified args and outputs the result to an XmlWriter.

Transform(IXPathNavigable, XsltArgumentList)

Obsolete.

Transforms the XML data in the IXPathNavigable using the specified args and outputs the result to an XmlReader.

Transform(String, String, XmlResolver)

Transforms the XML data in the input file and outputs the result to an output file.

Transform(String, String)

Obsolete.

Transforms the XML data in the input file and outputs the result to an output file.

Transform(XPathNavigator, XsltArgumentList, Stream, XmlResolver)

Transforms the XML data in the XPathNavigator using the specified args and outputs the result to a Stream.

Transform(XPathNavigator, XsltArgumentList, Stream)

Obsolete.

Transforms the XML data in the XPathNavigator using the specified args and outputs the result to a Stream.

Transform(XPathNavigator, XsltArgumentList, TextWriter, XmlResolver)

Transforms the XML data in the XPathNavigator using the specified args and outputs the result to a TextWriter.

Transform(XPathNavigator, XsltArgumentList, TextWriter)

Obsolete.

Transforms the XML data in the XPathNavigator using the specified args and outputs the result to a TextWriter.

Transform(XPathNavigator, XsltArgumentList, XmlResolver)

Transforms the XML data in the XPathNavigator using the specified args and outputs the result to an XmlReader.

Transform(XPathNavigator, XsltArgumentList, XmlWriter, XmlResolver)

Transforms the XML data in the XPathNavigator using the specified args and outputs the result to an XmlWriter.

Transform(XPathNavigator, XsltArgumentList, XmlWriter)

Obsolete.

Transforms the XML data in the XPathNavigator using the specified args and outputs the result to an XmlWriter.

Transform(XPathNavigator, XsltArgumentList)

Obsolete.

Transforms the XML data in the XPathNavigator using the specified args and outputs the result to an XmlReader.

Thread Safety

XslTransform objects are only thread-safe for transform operations. Other operations are not guaranteed to be thread-safe. You must ensure that no other methods are called on the object during load operations.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4