XML求助(在线等) string process ="type='text/xsl'"+" href="+"'moban001.xsl'"; xw.WriteProcessingInstruction("xml-stylesheet",process); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string xml = "<?xml version=\"1.0\" encoding=\"gb2312\"?><Text><Textxml> <Name> 知道天高地厚</Name></Textxml></Text> ";System.Xml.XmlDocument doc = new System.Xml.XmlDocument();doc.LoadXml(xml);Response.Clear();Response.Write (Server.HtmlEncode(doc.OuterXml));Response.Write ("<hr>");System.Xml.XmlProcessingInstruction newPI;String PItext = "type='text/xsl' href='Text.xsl'";newPI = doc.CreateProcessingInstruction("xml-stylesheet", PItext);doc.InsertBefore(newPI,doc.DocumentElement);System.Xml.XmlNode nod = doc.SelectSingleNode("//Textxml");System.Xml.XmlNode newNode = doc.CreateNode(System.Xml.XmlNodeType.Element,"Content","");System.Xml.XmlCDataSection CData;CData = doc.CreateCDataSection(" 真是不知高地厚 的东西我的心情好 ");newNode.AppendChild(CData);nod.AppendChild(newNode);Response.Write (Server.HtmlEncode(doc.OuterXml)); 上面的xw是XmlTextWriter的一个实例XmlTextWriter xw=new XmlTextWriter(dir,null); XmlTextWriter xw=new XmlTextWriter(dir,null);xw.WriteStartDocument();// 写入处理指令string process ="type='text/xsl'"+" href="+"'moban001.xsl'";xw.WriteProcessingInstruction("xml-stylesheet",process);明白了吧 控件克隆怎么弄 求:字符串中固定的位置的变量替换成需要的变量,大家讨论下.(求高手) winform中执行存储过程后在数据库中显示无效,该如何处理? 安装Visual Studio 2008过程出现这样错误,求解,谢谢! c# webbrowser刷新,在线等! 怎么计算速度? 并非所有的代码路径都返回值 WPF stackpanel中布局问题 求个正则表达式 在使用打印预览和打印出现的问题 请大家帮忙看看 窗体间变量传递问题 如何在asp.net中使用 log4net组件?
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.LoadXml(xml);
Response.Clear();
Response.Write (Server.HtmlEncode(doc.OuterXml));
Response.Write ("<hr>");
System.Xml.XmlProcessingInstruction newPI;
String PItext = "type='text/xsl' href='Text.xsl'";
newPI = doc.CreateProcessingInstruction("xml-stylesheet", PItext);
doc.InsertBefore(newPI,doc.DocumentElement);
System.Xml.XmlNode nod = doc.SelectSingleNode("//Textxml");
System.Xml.XmlNode newNode = doc.CreateNode(System.Xml.XmlNodeType.Element,"Content","");
System.Xml.XmlCDataSection CData;
CData = doc.CreateCDataSection(" 真是不知高地厚 的东西我的心情好 ");
newNode.AppendChild(CData);
nod.AppendChild(newNode);
Response.Write (Server.HtmlEncode(doc.OuterXml));
XmlTextWriter xw=new XmlTextWriter(dir,null);
xw.WriteStartDocument();
// 写入处理指令
string process ="type='text/xsl'"+" href="+"'moban001.xsl'";
xw.WriteProcessingInstruction("xml-stylesheet",process);明白了吧