易截截图软件、单文件、免安装、纯绿色、仅160KB

Retrieving an XML document using Ajax


Retrieving an XML document using Ajax
http://www.javascriptkit.com/dhtmltutors/ajaxgetpost3.shtml
When making a server request in Ajax, the data returned can be in either
plain text/html, or an XML document instead. The later is technically
just a text file as well, but with some special instructions, Ajax can
retrieve that well formed XML text file and return it back to you as a
XML object. This enables the XML data to be easily parsed using
standard DOM
methods
.
Here's a simple XML document in RSS format I'll be using for illustration (lets name it "javascriptkit.xml
"):
<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="0.91">
<channel>
<title>JavaScriptKit.com</title>
<link>http://www.javascriptkit.com</link>
<description>JavaScript tutorials and over 400+ free scripts!</description>
<language>en</language>

<item>
<title>Document Text Resizer</title>
<link>http://www.javascriptkit.com/script/script2/doctextresizer.shtml</link>
<description>This script adds the ability for your users to toggle your
webpage's font size, with persistent cookies then used to remember the
setting</description>
</item>

<item>
<title>JavaScript Reference- Keyboard/ Mouse Buttons Events</title>
<link>http://www.javascriptkit.com/jsref/eventkeyboardmouse.shtml</link>
<description>The latest update to our JS Reference takes a hard look at
keyboard and mouse button events in JavaScript, including the unicode value
of each key.</description>
</item>

<item>
<title>Dynamically loading an external JavaScript or CSS file</title>
<link>http://www.javascriptkit.com/javatutors/loadjavascriptcss.shtml</link>
<description>External JavaScript or CS


相关文档:

使用JDOM解析XML(转载,简单又详细)


使用JDOM解析XML(转载,简单又详细)
http://www.blogjava.net/haha/archive/2006/09/01/67153.html
一、前言
    JDOM是Breet Mclaughlin和Jason Hunter两大Java高手的创作成果,2000年初,JDOM作为一个开放源代码项目正式开始研发。JDOM是一种解析XML的Java工具包。
   &nbs ......

Java生成XML的缩进和换行

一 DOM 以下代码用DOM是生成一个XML文档
package xml;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
imp ......

使用dom4j解析XML例子

包括三个文件:studentInfo.xml(待解析的xml文件), Dom4jReadExmple.java(解析的主要类), TestDom4jReadExmple.java(测试解析的结果) (由于使用csdn blog自带的代码粘贴工具会朝里加入一些"..."字符,虽然利于查看,但是不利于把代码copy出来运行,而亲自运行代码对程序员来说是很重要的,故没有使用csdn blog自带的代码粘 ......

C#获取XML文件指定节点的数据

实例说明会更清楚些,假设有如下XML文件:
 File: message_hutaow.xml
<?xml version="1.0" encoding="UTF-8"?>
<hutaow:Message version="1.0" xmlns:hutaow="http://wangtao.cublog.cn">
<hutaow:Head>
<hutaow:Date>20080502</hutaow:Date>
<hutaow:Source>
......

改进的Java XML文件合并工具类

工作中遇到需要合并XML的问题,遂从网上查找相关资料,
1、 《 XML merging made easy  


2 、《java中合并xml文档的设计与实现 

测试后发现均不符合实际需求,实际需求如下:
file1.xml: 
<root>
<a>
<b name="1"/>
</a>
<d /& ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号