Xml序列化时怎么添加文件引用声明 xml序列化 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 WriteProcessingInstruction这个方法有没有重载,选择追加位置? writer.WriteStartDocument(); //添加此行writer.WriteProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"form/record.xsl\""); 这样不行的,Serialize方法本来就自动添加了<?xml version="1.0" encoding="utf-8"?>,如果再写WriteStartDocument就变成了这样:<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xsl" href="form/record.xsl"?><?xml version="1.0" encoding="utf-8"?> 换个思路,读出xml,在<?xml version="1.0" encoding="utf-8"?>之后插入<?xml-stylesheet type="text/xsl" href="form/index2.xsl"?> 找一个折中的方法,在你所要序列化的类中添加一个字符串字段,[XmlText]public string styleShee="<?xml-stylesheet type="text/xsl" href="form/record.xsl"?>"如果还不行,那就自己控制序列化过程。 问题解决了 参照这里http://www.cnblogs.com/fish-li/archive/2013/05/05/3061816.html c# 多线程异步操作Dictionary' C# SQL数据库更新超时求教!! 处理销售价格套餐的思路 请帮忙解答先谢了 问个关于datagrid打印问题,谁能提供个打印类!万分感谢! 进来看看能否实现 请问unicode编码和utf-8编码是同一种编码吗?在线等解 如何获得当前程序的文件名? 关于在WEBFORM中使用LISTBOX的问题 如何实现拷贝整个目录和子目录? c#开发源代码项目,现在征集小组成员 把一个实例克隆出一个新的实例(副本),有的类提供了copy的方法,但有很多又没有提供,怎么办?
writer.WriteProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"form/record.xsl\"");
<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xsl" href="form/record.xsl"?><?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="form/index2.xsl"?>
[XmlText]
public string styleShee="<?xml-stylesheet type="text/xsl" href="form/record.xsl"?>"
如果还不行,那就自己控制序列化过程。
http://www.cnblogs.com/fish-li/archive/2013/05/05/3061816.html