XPathDocument Input to XslTransform

The XPathDocument is a read-only cache, for processing documents with XslTransform. It is structurally similar to the XML Document Object Model (DOM), but it is highly optimized for Extensible Stylesheet Language for Transformations (XSLT) processing and the XML Path Language (XPath) data model using the XPath optimization functions on the XPathNavigator.

Note Note

The XslTransform class is obsolete in the .NET Framework 2.0. You can perform Extensible Stylesheet Language for Transformations (XSLT) transformations using the XslCompiledTransform class. See Using the XslCompiledTransform Class and Migrating From the XslTransform Class for more information.

The following code sample creates an XPathDocument as input to a transform.

XslTransform xslt = new XslTransform();
Xslt.Load(someStylesheet);
XPathDocument doc = XPathDocument("books.xml");
StringWriter fs = new StringWriter();
Xslt.Transform(doc, null, fs, null);
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft