visual|xml| Conversion
In the. NET Framework 2.0, the XslCompiledTransform class was used to replace the XslTransform class in the original 1.x, and the author tested the conversion processing performance of XML to a lot of improvements. XslCompiledTransform supports XSLT in XSLT 1.0 syntax. The highlight of the new feature is that she provides the ability to debug XSLT style sheet files in vs 2005. The process of writing code is fairly straightforward.
XslCompiledTransform XSLT = new XslCompiledTransform (true);
You can just pass in the constructor of the XslCompiledTransform class to enable debugging parameters. The default constructor does not open debug mode. Note that you need to reference the SYSTEM.XML.XSL namespace.
Here are two screenshots of the debugging process.
(Figure 1, Variable intelligent sensing)
(Figure 2, local variables window)The entire code is just a few lines. Using system;using system.xml;using system.xml.xsl;/*=============================================== 郑佐 2006-04-19 http://blog.csdn.net/zhzuo ==================================== =============*/namespace zhzuo.vs2005test.consoletest{ class program { static void Main (string[] args) { /Enable XSLT debugging. XslCompiledTransform XSLT = new XslCompiledTransform (true); //Load the style sheet. XSLT. Load ("D:\\emserpmessage.xslt"); //Create the writer. //xmlwritersettings settings = new XmlWriterSettings (); //settings. Indent = true; //xmlwriter writer = XmlWriter.Create ("D:\\output.xml", settings); Execute the transformation. //xslt. Transform ("D:\\20060418030410.xml", writer); / /writer. Close (); XSLT. Transform ("D:\\20060418030410.xml", "D:\\output.xml"); console.readline (); } } }