ʹÓÃXMLHttpRequest´¦ÀíxmlÊý¾Ý£¨¶þ£©
Ê×ÏÈдһ¸öhtmlÒ³Ãæuserxmlajax.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Óû§Ð£ÑéajaxʵÀý</title>
<!-- ajax·½Ê½Ï²»ÐèҪʹÓÃ±íµ¥À´½øÐÐÊý¾ÝÌá½»£¬Òò´Ë²»ÓÃд±íµ¥±êÇ©form -->
<!-- ajax·½Ê½²»ÐèÒªnameÊôÐÔ£¬ÐèÒªÒ»¸öidÊôÐÔ -->
<script type="text/javascript" src="js/validatexmlajax.js"></script>
</head>
<body>
Óû§ÃûУÑéAJAXʵÀý£¬ÇëÊäÈëÓû§Ãû£º</br>
<input type="text" id="userName"><br>
<input type="button" value="¼ì²é" onclick="validatexmlajax()">
<!--Õâ¸ödivÓÃÓÚ´æ·Å·þÎñÆ÷·µ»ØµÄÐÅÏ¢£¬¿ªÊ¼Îª¿Õ-->
<!--idÊôÐÔ¶¨ÒåÊÇΪÁËÀûÓÃdomµÄ·½Ê½ÕÒµ½Ä³Ò»½Úµã£¬½øÐвÙ×÷-->
<div id="result"></div>
<!--<div id="result"></div><div>456</div>-->
<!--<span>123</span><span>456</span>-->
<!--divºÍspanµÄÖ±¹Û²îÒ죬divÖеÄÄÚÈݶÀÕ¼ÐУ¬span»áºÍÇ°ºóÄÚÈÝÏàÁ¬½Ó-->
</body>
</html>
ÔÙдһ¸öservletÀàAJAXServletXML
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import java.io.IOException;
import java.io.PrintWriter;
//ÓÃÓÚ¶ÁÈ¡xml
public class AJAXServletXML extends HttpServlet{
@Override
protected void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException {
try{
//Ð޸ĵ
Ïà¹ØÎĵµ£º
ÔÚhtmlÎļþÖÐǶÈëµÄ´úÂëÈçÏÂ:
<script type="text/javascript">
var xmlUrl="news.xml";
var swfURL="news.swf";
var img_Speed=2;
var page_Speed=3000;
var TextPosition="down";
var HeadlineColor="#ff0000";
var HeadlineFont="14px";
va ......
ÀûÓÃXPath¶ÁÈ¡XmlÎļþ
Ö®ËùÒÔÒªÒýÈëXPathµÄ¸ÅÄĿµÄ¾ÍÊÇΪÁËÔÚÆ¥ÅäXMLÎĵµ½á¹¹Ê÷ʱÄܹ»×¼È·µØÕÒµ½Ä³Ò»¸ö½ÚµãÔªËØ¡£¿ÉÒÔ°ÑXPath±È×÷Îļþ¹ÜÀí·¾¶£ºÍ¨¹ýÎļþ¹ÜÀí·¾¶£¬¿ÉÒÔ°´ÕÕÒ»¶¨µÄ¹æÔò²éÕÒµ½ËùÐèÒªµÄÎļþ£»Í¬Ñù£¬ÒÀ¾ÝXPathËùÖƶ¨µÄ¹æÔò£¬Ò²¿ÉÒԺܷ½±ãµØÕÒµ½XML½á¹¹ÎĵµÊ÷ÖеÄÈκÎÒ»¸ö½Úµã.
¡¡¡¡²»¹ý£¬ÓÉÓÚXPath¿ÉÓ¦Ó ......
XML¼´extensibe markup languageµÄËõд£¬Ò²¾ÍÊÇ¿ÉÀ©Õ¹±êʶÓïÑÔ¡£ÓÉÓÚÆ俪·ÅÐÔ£¬Ô½À´Ô½¶àµÄÈí¼þ²ÉÓÃËü×÷ΪÃèÊöÓïÑÔ£»ÓÉÓÚÆäƽ̨ÎÞ¹ØÐÔ£¬Ô½À´Ô½¶àµÄϵͳ²ÉÓÃËü×÷ΪÊý¾Ý´«µÝÖн顣¼ÆËã»úÐÐÒµÒѾ°ÑXMLΪÊý¾Ý½»»»µÄ±ê×¼£¬²¢ÌṩÁËÏ൱ÊýÁ¿µÄÖ§³Ö¹¤¾ß¡£µ« ......
ÒýÓÃÀà¿â£º
using System;
using System.Data;
using System.IO;
using System.Xml;
using System.Text;
// ÏàÓ¦C#´úÂ룺
private string ConvertDataTableToXML(DataTable xmlDS)
{
MemoryStream stream = null;
XmlTextWriter writer = null;
try
......
Èý¡¢ÑµÁ··ÖÀàÆ÷
Ñù±¾´´½¨Ö®ºó£¬½ÓÏÂÀ´ÒªÑµÁ··ÖÀàÆ÷£¬Õâ¸ö¹ý³ÌÊÇÓÉhaartraining ³ÌÐòÀ´ÊµÏֵġ£
Haartraining µÄÃüÁîÐвÎÊýÈçÏ£º
£data<dir_name>
´æ·ÅѵÁ·ºÃµÄ·ÖÀàÆ÷µÄ·¾¶Ãû¡£
£vec<vec_file_name>
ÕýÑù±¾ÎļþÃû£¨ÓÉtrainingssamples ³ÌÐò»òÕßÓÉÆäËûµÄ·½·¨´´½¨µÄ£©
£bg<background_file_name& ......