Xml is a meta-markup language that provides a format for describing data. Xslt is one way to consume and transform this data into a variety different formats, including Xml, html and wml. In this article we shall learn how to transform a simple Xml document using Xslt.
The .NET framework provides rich support for the manipulation of Xml documents.
The main namespaces that provide us with the needed classes are:
You could use the provided sampledoc.xml and sample.xsl to have a go at it. You should
see a 'result.html' in the same folder as the application with the results of the
using System ;
using System.IO ;
using System.Xml ;
using System.Xml.Xsl ;
using System.Xml.XPath ;
XPathDocument myXPathDoc = new XPathDocument(sXmlPath) ;
XslTransform myXslTrans = new XslTransform() ;
//load the Xsl
This action might not be possible to undo. Are you sure you want to continue?