This sample illustrates how to apply an Extensible Stylesheet Language Transformation (XSLT) file to an XML document using the XslTransform class.
This sample consists of a method, ReadTransformWrite, with two sections. The first part of the method simply reads an XML document and then transforms the data using an XSLT file. The second part reads an XML document, transforms the data, and then writes a new XML document from the transformed data.
The sample applies this method to three sets of documents:
The sample source is found in sscli\samples\howto\xml\xmltransform.
The source file is:
The other support files for this sample are:
The build output location is %TARGETCOMPLUS%\samples\xml\xmltransform. The output file is an executable assembly named xmltransform.exe.
All samples are built from the buildall script.
You can also build all the
samples by switching to the root of the sample directory, sscli\samples, and typing
build -c.
You can build this specific sample by switching to the sample directory and typing
build -c.
These steps require that the Shared Source CLI (SSCLI) be already built and functional.
clix xmltransform.exe
When the sample runs, several transformed XML files are generated:
Copyright (c) 2002 Microsoft Corporation. All rights reserved.