XslCompiledTransform.Transform Method (IXPathNavigable, XsltArgumentList, TextWriter)
This page is specific to:.NET Framework Version:2.03.03.54.0
.NET Framework Class Library
XslCompiledTransform.Transform Method (IXPathNavigable, XsltArgumentList, TextWriter)

Note: This method is new in the .NET Framework version 2.0.

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

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

Syntax

'Usage

Dim instance As XslCompiledTransform
Dim input As IXPathNavigable
Dim arguments As XsltArgumentList
Dim results As TextWriter

instance.Transform(input, arguments, results)

'Declaration

Public Sub Transform ( _
    input As IXPathNavigable, _
    arguments As XsltArgumentList, _
    results As TextWriter _
)
public void Transform (
    IXPathNavigable input, 
    XsltArgumentList arguments, 
    TextWriter results
)

Parameters

input

An object implementing the IXPathNavigable interface. In the Microsoft .NET Framework, this can be either an XmlNode (typically an XmlDocument), or an XPathDocument containing the data to be transformed.

arguments

An XsltArgumentList containing the namespace-qualified arguments used as input to the transform. This value can be a null reference (Nothing in Visual Basic).

results

The TextWriter to which you want to output.

Exceptions

Exception typeCondition

ArgumentNullException

The input or results value is a null reference (Nothing in Visual Basic).

XsltException

There was an error executing the XSLT transform.

Remarks

If the XSLT document() function is enabled, it is resolved using an XmlUrlResolver with no user credentials. If the external resource is 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.

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 Transform overload which takes an XmlReader as the input argument.

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

  • The XmlNode class is based on the W3C Document Object Model (DOM) and includes editing capabilities.

  • The XPathDocument class is a read-only data store based on the XPath data model. XPathDocument is the recommended class for XSLT processing. It provides faster performance when compared to the XmlNode class.

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 Transform method. For more information, see How to: Transform a Node Fragment.

Platforms

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

Version Information

.NET Framework

Supported in: 2.0
See Also

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View