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
Ïà¹ØÎĵµ£º
¡¡¡¡±¾ÎÄÌÖÂÛSQL Server 2005µÄй¦ÄÜ£¬ËüÔÊÐíÄ㽫XMLÊý¾Ý·Ö½âµ½¹ØÏµ¸ñʽÖУ¬¶ø²»±ØºÄÓÃÌ«¶àÄÚ´æ¡£
¡¡¡¡±¾ÎÄÌÖÂÛSQL Server 2005µÄй¦ÄÜ£¬ËüÔÊÐíÄ㽫XMLÊý¾Ý·Ö½âµ½¹ØÏµ¸ñʽÖУ¬¶ø²»±ØºÄÓÃÌ«¶àÄÚ´æ¡£
¡¡¡¡ÔÚ¾ÙÀý˵Ã÷ÈçºÎ·Ö½âÉÏһƪÎÄÕÂÖеÄÊý¾Ýʱ£¬ÎÒÃÇÊ×ÏÈÁ˽âÒ»ÏÂXQueryºÍËüÔÚSQL Server 2005ÖÐΪ¿ª·¢ÕßÌṩµÄ¹¦ÄÜ¡£
¡ ......
ÔÚʹÓÃGoddadyÖ÷»úʹÓÃ
Google XML
Sitemaps²å¼þµÄʱºò£¬×ÜÌáʾÎÞȨÏÞ£¬¶øÊµ¼ÊÉÏÎÒÊÇÁËȨÏ޵ģ¬°Ñ²å¼þÏÂÔØµ½±¾µØ£¬Ò²ÊÇ¿ÉÒÔÕý³£Éú³ÉsitemapµÄ£¬Ôõô°ì£¿×ÔÈ»²»ÄÜÄѵ¹ÔÛ
Iter¡£
¼ìË÷¶à·½¼ì²é£¬·¢ÏÖÔÚ·þÎñÆ÷ÉÏ£¬¼ì²é·¾¶Ò»ÏîΪsitemap.xml£¬¶øÔÚ±¾µØ£¬¼ì²é·¾¶
Ϊd:\workstation\site\iove.net\sitemap.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 ......
°üÀ¨Èý¸öÎļþ£ºstudentInfo.xml(´ý½âÎöµÄxmlÎļþ), Dom4jReadExmple.java(½âÎöµÄÖ÷ÒªÀà), TestDom4jReadExmple.java(²âÊÔ½âÎöµÄ½á¹û) £¨ÓÉÓÚʹÓÃcsdn blog×Ô´øµÄ´úÂëÕ³Ìù¹¤¾ß»á³¯Àï¼ÓÈëһЩ"..."×Ö·û£¬ËäÈ»ÀûÓڲ鿴£¬µ«ÊDz»ÀûÓÚ°Ñ´úÂëcopy³öÀ´ÔËÐУ¬¶øÇ××ÔÔËÐдúÂë¶Ô³ÌÐòÔ±À´ËµÊǺÜÖØÒªµÄ£¬¹ÊûÓÐʹÓÃcsdn blog×Ô´øµÄ´úÂëÕ³ ......
windows xpÏÂIIS°²×°ºó¡£
¿ªÊ¼ÏÔʾµÄ´íÎóΪ
ÎÞ·¨ÏÔʾ XML Ò³¡£
ʹÓà Ñùʽ±íÎÞ·¨²é¿´ XML ÊäÈë¡£Çë¸üÕý´íÎóÈ»ºóµ¥»÷ ˢа´Å¥£¬»òÒÔºóÖØÊÔ¡£
------------------------------------------------------------------------- ......