Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
Previous Versions
.NET Framework 1.1
.NET Framework
 XPathDocument Input to XslTransform
This page is specific to
Microsoft Visual Studio 2003/.NET Framework 1.1

Other versions are also available for the following:
.NET Framework Developer's Guide
XPathDocument Input to XslTransform

The XPathDocument is a read-only cache, for processing documents with XslTransform. It is structurally similar to the XML DOM, but it is highly optimized for XSLT processing and the XPath data model using the XPath optimization functions on the XPathNavigator.

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

[Visual Basic]
Dim xslt as XslTransform = new XslTransform()
Xslt.Load(someStylesheet)
Dim doc as XPathDocument = New XPathDocument("books.xml")
Dim fs as StringWriter = new StringWriter()
Xslt.Transform(doc, Nothing, fs, Nothing);
[C#]
XslTransform xslt = new XslTransform();
Xslt.Load(someStylesheet);
XPathDocument doc = XPathDocument("books.xml");
StringWriter fs = new StringWriter();
Xslt.Transform(doc, null, fs, null);

See Also

XslTransform Class Implements the XSLT Processor

© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker