XSL transformation debugging for XML under Visual Studio 2005

Source: Internet
Author: User
Tags constructor net xsl xslt visual studio
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 ();       }          }         } 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.