1.XmlDocument类或XDocument类中有没有什么成员可以设置xml文档的样式文件,即xml文档内容的第二行有<?xml-stylesheet type="text/xsl" href="xsl样式文件"?>2.生成xml除了context.Response.Write(xmlDoc.ToString());还有什么方法,我用xmlDoc.WriteTo(XmlWriter.Create(context.Response.OutputStream));为什么没有用
解决方案 »
- 问个很弱智css的问题,连续两个.class是什么意思呢?怎么用呢?
- 全局性的安全变量
- asp.net c#里如何实现类似openfiledialog,savafiledialog对话框的功能?
- 系统为什么总是要回收应用池才可以用啊!
- 【我是菜鸟我是菜鸟,大虾在哪里大虾在哪里,问题简单!!】
- 为什么我的treeview在工具箱中是灰色不能用的状态?
- 求基于WEB的图片上传代码
- 有人知道这个是什么命令?具体什么意思${category[:]@@1@}??
- 一个ActiveX控件的事件处理问题
- 求教,用aspnet MVC开发的一个系统,其中使用百度地图api不能显示三维地图
- 简单问题。。!!!!!!!!!!!!!!
- 本地IIS,上传文件,找不到路径的一部分。
string path = string.Empty;
path = Server.MapPath("~/community/xml/" + _xmlFileName);
if (File.Exists(path))
{
File.Delete(path);
}
StreamWriter sw = File.CreateText(path);
try
{
sw.WriteLine(); sw.WriteLine("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
sw.WriteLine("<time>2</time>");
sw.WriteLine("<type>4</type>"); foreach (Model.AdService adServiceModel in adServiceModels)
{
sw.WriteLine("<step>");
sw.WriteLine(string.Format(" <img>{0}{1}</img>", this.UploadFileVAds, adServiceModel.AdIMG));
sw.WriteLine(string.Format(" <url>{0}</url>", "http://" + adServiceModel.AdURL));
sw.WriteLine(" <tar>_blank</tar>");
sw.WriteLine("</step>");
} }
catch (Exception ex)
{
throw new Exception(ex.Message);
}
finally
{
sw.Flush();
sw.Close();
}
}
我只是想把生成好了的xml文档写入到网页输出流,xmlDoc.WriteTo(XmlWriter.Create(context.Response.OutputStream))哪里有问题啊