Article ID: 815653 - Last Review: November 14, 2007 - Revision: 6.3 How to apply an XSL transformation from one XML document to another by using Visual C++ .NET or Visual C++ 2005On This Page For a Microsoft Visual C# version of this article,
see
307322
(http://support.microsoft.com/kb/307322/EN-US/
)
. For a Microsoft Visual Basic .NET version of this
article, see
300929
(http://support.microsoft.com/kb/300929/EN-US/
)
. This article refers to the following Microsoft .NET Framework Class Library namespaces:
IN THIS TASK SUMMARYThis step-by-step article describes how to apply an
Extensible Stylesheet Language (XSL) Transformation (XSLT) to an XML document
by using the XslTransform class to create a new XML document. XSL is an XML-based language
that is designed to transform one XML document into another XML document, or to
transform an XML document into any other structured
document. RequirementsThe following list outlines the recommended hardware, software, network infrastructure, and service packs that you need:
Steps to Build the SampleThis example uses two files named Books.xml and Books.xsl. You can create your own Books.xml and Books.xsl files, or you can use the sample files that are included with the .NET Software Development Kit (SDK) QuickStarts. Copy the Books.xml and Books.xsl files to the folder where you create this project. You can find these files in the following folder:\Program Files\Microsoft Visual Studio
.NET\FrameworkSDK\Samples\QuickStart\Howto\Samples\Xml\Transformxml\Cs
Complete Code Sample
/clr (Common Language Runtime Compilation) These steps apply to the whole article.http://msdn2.microsoft.com/en-us/library/k8d11d4s.aspx (http://msdn2.microsoft.com/en-us/library/k8d11d4s.aspx) NOTE: While compiling above code in Visual C++ .NET 2003, you may receive C4996 compiler warning. This is due to 'System::Xml::Xsl::XslTransform::Transform' is declared deprecated. Use following code so that you may not get C4996 compiler warning. Replace: With REFERENCESFor more information about the XslTransform class, see the following Microsoft .NET Framework Class Library
documentation:For more information about the XslTransform class with the XslTransform object, see the following Microsoft .NET Framework Developer's
Guide documentation: For a practical comparison of XSLT and ASP .NET, see the following
MSDN Online Voices Extreme XML column: For more information about XML in .NET, see the "XML in .NET: .NET
Framework XML Classes and C# Offer Simple, Scalable Data Manipulation" article
from MSDN Magazine at the following Microsoft Web site: For more general information about Visual C++ .NET or XML in .NET,
see the following Usenet newsgroups: | Article Translations
|
Back to the top
