System.Xml.Xsl.XslTransform.Transform Method

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

Syntax

public System.Xml.XmlReader Transform (System.Xml.XPath.XPathNavigator input, XsltArgumentList args)

Parameters

input
An System.Xml.XPath.XPathNavigator containing the data to be transformed.
args
An System.Xml.Xsl.XsltArgumentList containing the namespace-qualified arguments used as input to the transformation.

Returns

An System.Xml.XmlReader containing the results of the transformation.

Remarks

Note:

The System.Xml.Xsl.XslTransform class is obsolete in the .NET Framework version 2.0. The System.Xml.Xsl.XslCompiledTransform class is the new XSLT processor. For more information, see Using the XslCompiledTransform Class and Migrating From the XslTransform Class.

System.Xml.Xsl.XslTransform supports the XSLT 1.0 syntax. The XSLT style sheet must include the namespace declaration xmlns:xsl= http://www.w3.org/1999/XSL/Transform.

The args are matched with the xsl:param elements defined in the style sheet. The transformation selections apply to the document as a whole. In other words, if the current node is set on a node tree other than the document root node, this does not prevent the transformation process from accessing all nodes in the loaded document. After the transformation has been performed, the System.Xml.XPath.XPathNavigator remains in its original state. This means that the node, which is current before the transformation process, remains the current node after the XslTransform.Transform(System.Xml.XPath.XPathNavigator, XsltArgumentList) method has been called.

Because System.Xml.XmlReader provides read-only output, the xsl:output element is ignored. See Outputs from an XslTransform for more information.

This method enables you to do an asynchronous transformation of the source document.

Note:

This method is obsolete. The setting of the XslTransform.XmlResolver property determines how the XSLT document() function is resolved. The recommended practice is to use the erload:System.Xml.Xsl.XslTransform.Transform method which takes an System.Xml.XmlResolver object as one of its arguments.

Requirements

Namespace: System.Xml.Xsl
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0