以文本方式查看主题 - 计算机科学论坛 (http://bbs.xml.org.cn/index.asp) -- 『 DOM/SAX/XPath 』 (http://bbs.xml.org.cn/list.asp?boardid=11) ---- 输出xml内容到页面上?在线等回复... (http://bbs.xml.org.cn/dispbbs.asp?boardid=11&rootid=&id=20552) |
-- 作者:john_lan -- 发布时间:7/21/2005 2:51:00 PM -- 输出xml内容到页面上?在线等回复... <%@page import="org.jdom.output.*"%> <%@page import="org.jdom.*"%> <%@page import="java.io.*"%> <% Document document=new Document(new Element("Root"));//创建文档 format.setEncoding("gb2312"); //设置xml文件的字符为gb2312 format.setIndent(" "); //设置xml文件的缩进为4个空格 FileOutputStream aa = new FileOutputStream("d:/new.xml"); %> |
-- 作者:john_lan -- 发布时间:7/21/2005 3:38:00 PM -- 这论坛上难道没人? |
-- 作者:binaryluo -- 发布时间:7/21/2005 11:50:00 PM -- 运行上面的页面,假设你的服务器地址是http://localhost/document.jsp,那么解析方法为; 1.先创建一个http连接到你的服务器地址,即上述的 URL; 2.将http连接的输出流(InputStream)作为解析器的输入创建Document对象。 3.解析。 |
W 3 C h i n a ( since 2003 ) 旗 下 站 点 苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》 |
62.500ms |