资源简介
Xml+Xslt测试工具

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.xml;
namespace xml_Xslt
{
public class Formater
{
public static void Formatxml(ICSharpCode.TextEditor.TextEditorControl text)
{
string xml = text.Text;
var xd = new xmlDocument();
xd.Loadxml(xml);
var sb = new StringBuilder();
var sw = new StringWriter(sb);
xmlTextWriter xtw = null;
try
{
xtw = new xmlTextWriter(sw);
xtw.Formatting = Formatting.Indented;
xtw.Indentation = 1;
xtw.IndentChar = ‘\t‘;
xd.WriteTo(xtw);
}
finally
{
if (xtw != null)
xtw.Close();
}
text.Text = sb.ToString();
}
///
/// 格式化HTML输出
///
///
/// 是否缩进
///
public static string FormatHtml(string str bool bLineAndIndent)
{
xmlDocument document1 = ConvertToxmlDocument(str);
if (bLineAndIndent)
{
var builder1 = new StringBuilder();
var writer1 = new xmlTextWriter(new StringWriter(builder1));
writer1.IndentChar = ‘ ‘;
writer1.Indentation = 4;
writer1.Formatting = Formatting.Indented;
document1.DocumentElement.WriteContentTo(writer1);
return builder1.ToString();
}
return document1.DocumentElement.Innerxml;
}
///
/// 转换为整理后的xml文档
///
///
///
private static xmlDocument ConvertToxmlDocument(string str)
{
var document1 = new xmlDocument();
document1.Loadxml(“l/>“);
SafeHtmlParser.ParseHtml(document1.DocumentElement str);
return document1;
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 982 2013-07-21 15:37 xm
文件 654 2013-07-21 15:37 xm
文件 328 2013-07-21 15:45 xm
文件 1216 2013-07-21 15:45 xm
文件 192512 2013-07-21 09:42 xm
文件 393216 2013-07-21 09:42 xm
文件 800256 2013-07-21 15:45 xm
文件 77312 2013-07-21 15:45 xm
文件 11608 2013-07-21 15:45 xm
文件 490 2012-06-06 02:06 xm
文件 2307 2013-07-21 11:06 xm
文件 192512 2013-07-21 09:42 xm
文件 393216 2013-07-21 09:42 xm
文件 4944 2013-07-21 15:45 xm
文件 15784 2013-07-21 15:45 xm
文件 565517 2013-07-21 15:45 xm
文件 7200 2013-07-21 09:44 xm
文件 6666 2013-07-21 15:45 xm
文件 1034 2013-07-21 15:45 xm
文件 908 2013-07-21 15:45 xm
文件 9982 2013-07-21 09:47 xm
文件 800256 2013-07-21 15:45 xm
文件 77312 2013-07-21 15:45 xm
文件 373092 2013-07-21 15:45 xm
文件 180 2013-07-21 15:37 xm
文件 372526 2013-07-21 15:37 xm
文件 492 2013-07-21 09:24 xm
文件 1348 2013-07-21 09:09 xm
文件 2868 2013-07-21 09:09 xm
文件 5612 2013-07-21 09:09 xm
............此处省略19个文件信息
相关资源
- IAR FOR 430 破解工具
- WCE注入工具
- PNG加密解密工具73383
- 电信中兴光猫超密获取工具使用方法
- ddos压力测试工具99657
- 商品查询录入工具(e4a.e4a)
- IEEE754 浮点转换工具
- Hash1.04(md5校验工具) 绿色免费版
- usb hid调试工具
- Eeupdate.exe
- Alcor(安国)SC908SNAU6989SN主控量产工具
- SD卡,TF卡修复工具 能够恢复SD卡的真
- 局域网硬件信息收集工具
- 抓包工具 sniffer
- VisualStudioUninstaller vs卸载工具
- 编译原理实验工具及参考源码(lex&
- E盾偷后台工具源码
- Zprotect专业版(无限制) 一机一码E
- 炬力固件提取工具4.0版
- Phoenix BIOS Editor.rar
- silicon lab公司的收音IC SI47XX全套开发工
- mp3解析文档及其分析工具
- Img2Lcd(将图片转换为数组的工具)
- HOOK小工具(进程、窗口、全局)
- IP地址转换整形工具
- 隐藏任务栏图标工具(hot)
- HP笔记本BIOS丢失解决方法,DMI TOOLK
- Google Earth KML文件生成工具
- J2EE 配置文件
-
开源tinyxm
l
评论
共有 条评论