用response输出XML
来源:互联网 发布:cassandra数据库简介 编辑:程序博客网 时间:2024/05/16 14:11
直接在代码中组织xml:
string strXML = "<?xml version=/"1.0/"?>";
strXML+="<books><bookdata id=/"1/">";
strXML+="<title>C# premier</title>";
strXML += "<year>2005</year>";
strXML+="<publisher> Qinghua University Press</publisher>";
strXML+="<Author>hou </Author>";
strXML+="<pagers>500 </pagers>";
strXML+="<description> c# fundation knowledge</description>";
strXML+="<Price>50.00</Price>";
strXML+="</bookdata>";
strXML+="<bookdata id=/"2/">";
strXML+="<title>xml premier</title>";
strXML+="<year>2005</year>";
strXML+="<publisher> Peking University Press</publisher>";
strXML+="<Author>Leo </Author>";
strXML+="<pagers>400 </pagers>";
strXML+="<description> xml fundation knowledge</description>";
strXML+="<Price>45.00</Price>";
strXML+="</bookdata>";
strXML+="<bookdata id=/"3/">";
strXML+="<title>UML</title>";
strXML+="<year>2005</year>";
strXML+="<publisher> Peking University Press</publisher>";
strXML+=" <Author>James </Author>";
strXML+=" <pagers>650 </pagers>";
strXML+=" <description>UML fundation knowledge</description>";
strXML += " <Price>85.00</Price>";
strXML+=" </bookdata></books>";
Response.ContentType = "text/xml";
Response.Charset = "UTF-8";
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.LoadXml(strXML);
doc.Save(Response.OutputStream);
Response.End();
读取现有的xml:
Response.ContentType = "text/xml";
Response.Charset = "UTF-8";
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
string strPath = @"~/login/xmlfile";
doc.Load(Server.MapPath(strPath + "/books.xml"));//requests.xml是服务器上xml文件
Response.Write(doc.DocumentElement.OuterXml);
Response.End();
- 用response输出XML
- 用response输出XML
- 用response向客户端输出中文数据
- Response输出javascript语句
- Response输出图像
- response.write()输出""
- response流输出
- servlet request response 输出
- response输出乱码问题
- response输出乱码问题
- response输出随机图片
- java response 输出js
- response得输出
- Java技巧:AJAX向Response留中输出Xml的办法
- response对象(一)response 输出流
- 直接用Response输出可以加批注的Excel
- Response 返回xml,json
- response直接响应xml
- MSSQL安装出现 “运行安装程序之前必须重新启动计算机” 的解决办法
- ClassFormatError 117
- Hibernate3和hibernate2中检索策略的变更
- css写JS
- 神舟七号飞船即将发射,中国走在“太空药”领域世界前沿
- 用response输出XML
- 地理信息科学家——David M. Mark
- BAT编写详细手册
- 流程图技术汇总链接大全
- 如何使用java向mysql存取二进制图片
- 《Squid 中文权威指南》(下)-向译者彭勇华致敬!!!
- Windows端口大全及端口关闭方法
- 高手过招谈Linux环境下的高级隐藏技术
- 专业测试人员的素质