Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

XML ½âÎöc++Ô´Â루ԴÎļþ£©

/*
 * XMLTool.cpp ÅäÖÃÎļþ½âÎö¶¯Ì¬¿â×ÊÔ´Îļþ
 *  Ö÷ÒªÊä³öº¯Êý½Ó¿Ú·Ö±ðʵÏÖ¶ÔÅäÖÃÎļþµÄ¶ÁÈ¡ºÍдÈ룬Õë¶Ô½á¹û¼¯µÄ¸´ÖÆÇå¿Õ£¬ºÍÁ½¸ö×Ö·û´®´¦Àíº¯Êý
 *  ¶ÁÈ¡ÅäÖÃÎļþ½Ó¿Ú £ºint ReadXMLFile(XML_Node_Vector *XmlNodeVector, string filepath);
 *  Ð´ÈëÅäÖÃÎļþ½Ó¿Ú £ºint WriteXMLFile(XML_Node_Vector *XmlNodeVector, string filepath,bool is_addend = true);
 *  ¸´Öƽṹ¼¯½Ó¿Ú  £ºbool VecDataCopy(XML_Node_Vector *XmlNodeVectorDest,const XML_Node_Vector *XmlNodeVectorSource);
 *  Çå¿Õ½á¹¹¼¯½Ó¿Ú      £ºbool VecDataClean(XML_Node_Vector *XmlNodeVector);
 *  ×Ö·û´®°²È«¿½±´½Ó¿Ú £ºbool strncpy_ex(char *pStrDest,const char *pStrSource,int nDestSize);
 *  ×Ö·û´®°²È«´¦Àí½Ó¿Ú  £ºbool printf_ex(char* szBuf,int nDestSize,char *szFormat, ...);
 *
 * ÅäÖÃÎļþÐÅÏ¢½á¹¹´ó¸ÅÈçÏ עÒâ <> ·ûºÅ°üÀ¨ÆäÖеÄ×Ö·û´®½öΪÏÖÔÚ˵ÃûÐÅÏ¢
 *
 * |[1234<½ÚµãÍ·Êý¾Ý>]<½ÚµãÍ·>
 * |abc<½ÚµãÇ°ÐÅÏ¢ÌåÊý¾Ý>=123<½ÚµãºóÐÅÏ¢ÌåÊý¾Ý>
 * |123<½ÚµãÇ°ÐÅÏ¢ÌåÊý¾Ý>=890<½ÚµãºóÐÅÏ¢ÌåÊý¾Ý>
 * | 
 * ×¢Ò⣺
 *  0.ËùÓÐÓÐЧÐÐÊý¾Ý±ØÐ붥¸ñÊéд·ñÕß½«²»»á¶ÁÈ¡¸ÃÐÐÊý¾Ý£¬½«×÷ΪÎÞЧÊý¾Ý´¦Àí (ËùÓÐÎÞЧÊý¾Ý½«²»Óè¶ÁÈ¡
 *   0.1£º²»¶¥¸ñÊéд
 *   0.2£º¶¥¸ñµÚÒ»¸ö×Ö·ûΪ # »ò $
 *   0.3£º¶¥¸ñµÚÒ»¸ö×Ö·ûΪ =
 *  1.½ÚµãÇ°ÐÅÏ¢ÌåÊý¾ÝÔÚ¶ÁÈ¡Êý¾ÝµÄʱºò×Ô¶¯ÉáÈ¥¿Õ¸ñ£¬¶ø½ÚµãºóÐÅÏ¢ÌåÊý¾Ý²»×ö´¦Àí£¬½«Ô­Ñù¶ÁÈ¡
 *  2. # ºÍ $ ·ûºÅΪע½â·û Óöµ½ËûÃÇ¿ªÊ¼µÄÐн«²»¶ÁÈ¡ËûÃǵÄÊý¾Ý »òÕßÔÚ²»¶¥ÐÐÊéд
 *  3.¾ßÌåÊý¾Ý½á¹¹Çë¶ÔÕÕ¶¨Òå
 *
 * createtime:2010-1-26
 * edittime:2010-1-27
 * creator:seky.gu
 * editor;seky.gu
 * mingyao.gu@hp.com
 */
#include "XMLTool.h"
#include <stdarg.h>
#include <iostream>
#include <


Ïà¹ØÎĵµ£º

XMLÎļþѧϰ

XML CDATA Îı¾
ËùÓÐ XML ÎĵµÖеÄÎı¾¾ù»á±»½âÎöÆ÷½âÎö¡£
Ö»ÓÐ CDATA Çø¶Î£¨CDATA section£©ÖеÄÎı¾»á±»½âÎöÆ÷ºöÂÔ¡£
Parsed Data
XML ½âÎöÆ÷ͨ³£»á½âÎö XML ÎĵµÖÐËùÓеÄÎı¾¡£
µ±Ä³¸ö XML ÔªËر»½âÎöʱ£¬Æä±êÇ©Ö®¼äµÄÎı¾Ò²»á±»½âÎö£º
<message>´ËÎı¾Ò²»á±»½âÎö</message>
½âÎöÆ÷Ö®ËùÒÔÕâô×öÊÇÒòÎ ......

javascript½«×Ö·û´®ÀàÐÍת»»ÎªXML¶ÔÏó

try { //Internet Explorer
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.loadXML(data);
} catch(e) { //Other Browsers
parser=new DOMParser();
xmlDoc=parser.parsefromString(data,"text/xml");
} ......

Ajax ºÍ XML: ÎåÖÖ³£¼û Ajax ģʽ

Asynchronous JavaScript + XML£¨Ajax£©ÎÞÒÉÊÇ 2006 Äê×îÈÈÃŵļ¼ÊõÊõÓÇÒÓÐÍûÔÚ
2007 µÃµ½½øÒ»²½·¢Õ¹¡£µ«ÊǶÔÄúµÄÓ¦ÓóÌÐòÀ´ËµËü¾¿¾¹ÓÐʲôÒâÒåÄØ£¿Ajax Ó¦ÓóÌÐòÖÐÄÄÒ»ÖÖ³£¼û¼Ü¹¹Ä£Ê½Ó¦ÓÃ×î¹ã·ºÄØ£¿±¾ÎĽ«½éÉÜÎåÖÖ³£¼û
Ajax Éè¼Æģʽ£¬¿ÉÒÔʹÓÃËüÃÇ×÷Ϊ¹¤×÷µÄ»ù´¡¡£
µÄÈ·£¬Ajax
ÊÇ Web 2.0
ÈÈÃÅÊõÓËùÓÐÈ˶¼Ï£Íû ......

JavaScriptÈëÃÅÓëÆä¿ò¼ÜJQuery£¬JSONºÍXMLµÄ±È½Ï

µ±Ò³ÃæÔØÈëʱ£¬»áÖ´ÐÐλÓÚ body ²¿·ÖµÄ JavaScript¡£
µ±±»µ÷ÓÃʱ£¬Î»ÓÚ head ²¿·ÖµÄ JavaScript ²Å»á±»Ö´ÐС£
2006Äê1ÔÂ14ÈÕ£¬John Resig ÔÚBarCampNYCÉϵÚÒ»´Î·¢²¼ÁËjQuery¡£
 
JSON(JavaScript Object Notation) ÊÇÒ»ÖÖÇáÁ¿¼¶µÄÊý¾Ý½»»»¸ñʽ¡£Ò×ÓÚÈËÔĶÁºÍ±àд¡£Í¬Ê±Ò²Ò×ÓÚ»úÆ÷½âÎöºÍÉú³É¡£Ëü»ùÓÚJavaScript£¨St ......

XML ½âÎöc++Ô´Â루ͷÎļþ£©

/*
 * XMLTool.h ÅäÖÃÎļþ½âÎö¶¯Ì¬¿âÍ·Îļþ
 *  Ö÷ÒªÊä³öº¯Êý½Ó¿Ú·Ö±ðʵÏÖ¶ÔÅäÖÃÎļþµÄ¶ÁÈ¡ºÍдÈ룬Õë¶Ô½á¹û¼¯µÄ¸´ÖÆÇå¿Õ£¬ºÍÁ½¸ö×Ö·û´®´¦Àíº¯Êý
 *  ¶ÁÈ¡ÅäÖÃÎļþ½Ó¿Ú £ºint ReadXMLFile(XML_Node_Vector *XmlNodeVector, string filepath);
 *  Ð´ÈëÅäÖ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ