System.Xml.Xsl.XslCompiledTransform.Transform Method

Executes the transform using the input document specified by the System.Xml.XPath.IXPathNavigable object and outputs the results to an System.Xml.XmlWriter. The System.Xml.Xsl.XsltArgumentList provides additional run-time arguments.

Syntax

public void Transform (System.Xml.XPath.IXPathNavigable input, XsltArgumentList arguments, System.Xml.XmlWriter results)

Parameters

input
An object implementing the System.Xml.XPath.IXPathNavigable interface. In the Microsoft .NET Framework, this can be either an System.Xml.XmlNode (typically an System.Xml.XmlDocument), or an System.Xml.XPath.XPathDocument containing the data to be transformed.
arguments
An System.Xml.Xsl.XsltArgumentList containing the namespace-qualified arguments used as input to the transform. This value can be null.
results
The System.Xml.XmlWriter to which you want to output.

Remarks

If the XSLT document() function is enabled, it is resolved using an System.Xml.XmlUrlResolver with no user credentials. If the external resource is located on a network resource that requires authentication, use the overload that takes an System.Xml.XmlResolver as one of its arguments and specify an System.Xml.XmlResolver with the necessary credentials.

This method does not support the xsl:strip-space element. If your compiled style sheet included the xsl:strip-space element, you must use the erload:System.Xml.Xsl.XslCompiledTransform.Transform overload which takes an System.Xml.XmlReader as the input argument.

The System.Xml.XPath.IXPathNavigable interface is implemented in the System.Xml.XmlNode and System.Xml.XPath.XPathDocument classes. These classes represent an in-memory cache of XML data.

Transformations apply to the document as a whole. In other words, if you pass in a node other than the document root node, this does not prevent the transformation process from accessing all nodes in the loaded document. To transform a node fragment, you must create an object containing just the node fragment, and pass that object to the XslCompiledTransform.Transform(System.Xml.XPath.IXPathNavigable, XsltArgumentList, System.Xml.XmlWriter) method. For more information, see How To: Transform a Node Fragment.

Requirements

Namespace: System.Xml.Xsl
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0