惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
S
Schneier on Security
H
Help Net Security
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MongoDB | Blog
MongoDB | Blog
云风的 BLOG
云风的 BLOG
H
Hacker News: Front Page
C
Check Point Blog
P
Privacy International News Feed
IT之家
IT之家
爱范儿
爱范儿
AWS News Blog
AWS News Blog
The Hacker News
The Hacker News
Stack Overflow Blog
Stack Overflow Blog
Project Zero
Project Zero
Microsoft Azure Blog
Microsoft Azure Blog
量子位
The Cloudflare Blog
P
Proofpoint News Feed
Hugging Face - Blog
Hugging Face - Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
C
Cybersecurity and Infrastructure Security Agency CISA
I
Intezer
Martin Fowler
Martin Fowler
Scott Helme
Scott Helme
酷 壳 – CoolShell
酷 壳 – CoolShell
A
Arctic Wolf
T
Threat Research - Cisco Blogs
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
The Exploit Database - CXSecurity.com
B
Blog
Simon Willison's Weblog
Simon Willison's Weblog
U
Unit 42
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Security Blog
Microsoft Security Blog
博客园_首页
J
Java Code Geeks
K
Kaspersky official blog
Webroot Blog
Webroot Blog
C
CERT Recently Published Vulnerability Notes
H
Heimdal Security Blog
G
Google Developers Blog
T
Tor Project blog
W
WeLiveSecurity
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Blog — PlanetScale
Blog — PlanetScale
小众软件
小众软件
有赞技术团队
有赞技术团队

博客园 - 秋枫

使用BizTalk Server常见问题处理 BizTalk Server中简单xml架构使用举例 CodeProject.com上微软BizTalk平台技术文章集锦 BizTalk Server 2006中使用MQSeries适配器问题处理 基于.Net平台应用程序唯一运行实例实现 使用BizTalk Server的Sql适配器出现“新事务不能登记到指定的事务处理器中”异常的处理 谈基于.net平台windows开发中的模式窗体 小提国内一些提供RSS服务的网站生成Rss文件问题 Visual studio .net 的“隐蔽性”和容易“忽略”的功能 使用sqlcmd(osql) 实用工具列出本地网内的Sql Server 服务器 《敏捷注册表》1.0使用说明书 《敏捷注册表》1.0概述 使用从BindingManagerBase.PositionChanged 事件的注意点 使用Microsoft SQL Server 2000的XML查询 asp.net中显示DataGrid控件列序号的几种方法 使用.net framewrok 1.1版System.Windows.Forms.TreeView的一个问题 使用.net framewrok 1.1版注册表API的局限和解决 使用SaveFileDialog需要注意的情况 使用.net framework中常用类在2.0版中的新功能
Visual studio 2005下xml的xsl转换调试
秋枫 · 2006-04-19 · via 博客园 - 秋枫

.net Framework 2.0中,使用XslCompiledTransform类取代了原来1.x中的XslTransform类,笔者测试了一下对xml的转换处理性能确实提高许多。XslCompiledTransform支持 XSLT 1.0 语法的 XSLT。突出的新功能是她提供了在VS 2005中对xslt样式表文件的调试能力。编写代码过程相当简单。

XslCompiledTransform xslt = new XslCompiledTransform(true);

只要在XslCompiledTransform类的构造函数中传入是否启用调试参数就行。默认构造函数不开启调试模式。注意需要引用System.Xml.Xsl命名空间。

以下是调试过程中的两幅截图。
xslt_debug1.jpg

(1,变量智能感应)

xslt_debug2.jpg
(
2,局部变量窗口)

整个代码也就几行。

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();

        }      

    }         

}