Transform Method (String, XsltArgumentList, Stream)

XslCompiledTransform.Transform Method (String, XsltArgumentList, Stream)


Executes the transform using the input document specified by the URI and outputs the results to stream. The XsltArgumentList provides additional run-time arguments.

Namespace:   System.Xml.Xsl
Assembly:  System.Xml (in System.Xml.dll)

public void Transform(
	string inputUri,
	XsltArgumentList arguments,
	Stream results


Type: System.String

The URI of the input document.

Type: System.Xml.Xsl.XsltArgumentList

An XsltArgumentList containing the namespace-qualified arguments used as input to the transform. This value can be null.

Type: System.IO.Stream

The stream to which you want to output.

Exception Condition

The inputUri or results value is null.


There was an error executing the XSLT transform.


The inputUri value includes a filename or directory cannot be found.


The inputUri value cannot be resolved.


An error occurred while processing the request


inputUri is not a valid URI.


There was a parsing error loading the input document.

This method uses a default XmlUrlResolver with no user credentials to resolve the input document and any instances of the XSLT document() function found in the style sheet. If any of these resources are located on a network resource that requires authentication, use the overload that takes an XmlResolver as one of its arguments and specify an XmlResolver with the necessary credentials.

An XmlReader with default settings is used to load the input document. DTD processing is disabled on the XmlReader. If you require DTD processing, create an XmlReader with this feature enabled, and pass it to the Transform method.

.NET Framework
Available since 2.0
Return to top
© 2015 Microsoft