C++ XML½âÎöÖ®TinyXMLƪ
¡¡±êÇ©£ºXML½âÎö TinyXML¡¡¡¡¡¡[ÍÆË͵½¼¼ÊõȦ]
°æȨÉùÃ÷£ºÔ´´×÷Æ·£¬ÔÊÐíתÔØ£¬×ªÔØʱÇëÎñ±ØÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕ Ôʼ³ö´¦ ¡¢×÷ÕßÐÅÏ¢ºÍ±¾ÉùÃ÷¡£·ñÔò½«×·¾¿·¨ÂÉÔðÈΡ£http://panpan.blog.51cto.com/489034/104961
×î½üʹÓÃTinyXML½øÐÐC++ XML½âÎö£¬¸Ð¾õʹÓÃÆðÀ´±È½Ï¼òµ¥£¬ºÜÈÝÒ×ÉÏÊÖ£¬±¾Îĸø³öÒ»¸öʹÓÃTinyXML½øÐÐXML½âÎöµÄ¼òµ¥Àý×Ó£¬ºÜ¶à¸´ÔÓµÄÓ¦Óö¼¿ÉÒÔ»ùÓÚ±¾Àý×ӵķ½·¨À´Íê³É¡£ÒÔºóµÄÎÄÕÂÀï»á½²½âʹÓÃXerces½øÐÐC++ XML½âÎöµÄÀý×Ó£¬Ï£Íû´ó¼ÒÒ»Æð½»Á÷¡£
TinyXMLÊÇÒ»¸ö¿ªÔ´µÄ½âÎöXMLµÄ½âÎö¿â£¬Äܹ»ÓÃÓÚC++£¬Äܹ»ÔÚWindows»òLinuxÖбàÒë¡£Õâ¸ö½âÎö¿âµÄÄ£ÐÍͨ¹ý½âÎöXMLÎļþ£¬È»ºóÔÚÄÚ´æÖÐÉú³ÉDOMÄ£ÐÍ£¬´Ó¶øÈÃÎÒÃǺܷ½±ãµÄ±éÀúÕâ¿ÃXMLÊ÷¡£
DOMÄ£Ðͼ´Îĵµ¶ÔÏóÄ£ÐÍ£¬Êǽ«Õû¸öÎĵµ·Ö³É¶à¸öÔªËØ£¨ÈçÊé¡¢Õ¡¢½Ú¡¢¶ÎµÈ£©£¬²¢ÀûÓÃÊ÷Ðͽṹ±íʾÕâЩԪËØÖ®¼äµÄ˳Ðò¹ØϵÒÔ¼°Ç¶Ì×°üº¬¹Øϵ¡£
Ê×ÏÈ´ÓÍøÉÏÏÂÔØTinyXMLµÄ¿â£¬Îļþ¼ÐµÄÃû×ÖÊÇTinyXpath£¬ÔÚ¹¤³ÌÀï×öÈçÏÂÅäÖãº
ÔÚ¸½¼Ó°üº¬Â·¾¶ÀïÌí¼Ó£ºÄãµÄtinyxpath·¾¶/tinyxpath/include
ÔÚ¸½¼Ó¿â·¾¶ÀïÌí¼Ó£ºÄãµÄtinyxpath·¾¶/tinyxpath/lib
ÔÚ¶ÔÏó/¿â·¾¶ÀïÌí¼Ó£ºtinyxpathd.lib£¬Èç¹ûʹÓÃrelease°æ±¾£¬ÔòÊÇtinyxpath.lib¡£
ÁíÍ⣬ÓÉÓÚÎÒ¿ª·¢µÄÏîÄ¿ÊǶàÏ̵߳ģ¬ËùÒÔÉèÖÃÁ˶àÏ̵߳Ļ·¾³£¬Òò´ËʹÓÃTinyXMLûÓгöÏÖÎÊÌâ¡£±¾È˽«TinyXMLдÔÚÒ»¸öµ¥¶ÀµÄC++¹¤³Ì½øÐвâÊÔ£¬·¢ÏÖÈç¹û²»ÉèÖöàÏ̵߳Ļ·¾³£¬»á³öÏÖÁ´½Ó´íÎó¡£ÎÒ¾õµÃÔÒò¿ÉÄÜÊÇTinyXMLʹÓÃÁ˶àÏ̻߳·¾³£¬Òò´ËÐèÒªÉèÖöàÏ̵߳Ļ·¾³¡£ÔÚ¹¤³Ì/ÉèÖÃϵÄC/C++Ñ¡ÏÖУ¬Ñ¡ÔñCode Generation£¬ÔÚUse run-time libraryÖÐÑ¡ÔñDebug MultiThreaed DLL¼´¿É¡£
±¾ÀýµÄXMLÎļþStudents.xmlÈçÏ£º
<Class name="¼ÆËã»úÈí¼þ°à">
<Students>
<student name="ÕÅÈý" studentNo="13031001" sex="ÄÐ" age="22">
<phone>88208888</phone>
<address>Î÷°²ÊÐÌ«°×ÄÏ·¶þºÅ</address>
</student>
Ïà¹ØÎĵµ£º
ÔÚXMLÊý¾ÝÖУ¬Ò»Ð©ÌØÊâ×Ö·û±ØÐëÓÃתÒå·ûºÅÀ´´úÌ棬¶ø»Ø³µ»»ÐÐ×Ö·û¾ÍÊÇÊôÓÚÌØÊâ·ûºÅ¡£
¿Õ¸ñ ( )
Tab (	)
»Ø³µ (
)
»»ÐÐ (
)
ÏÂÃæÊÇÒ»¸ö±¨±íXMLÊý¾Ý£¬ÀïÃæ°üÀ¨Óлسµ»»ÐÐ×Ö·û£º
<report>
<NewDataSet>
<Table>
<CustomerID>BLONP</CustomerID& ......
±ÊÕßÔÚJava¿ª·¢Öг£³£»áÓöµ½½«Êý¾Ý¿âÊý¾Ýµ¼³öµ½ExcelµÄÒªÇ󣬱ÈÈçÔÚÎÒµÄÒ»¸öÏîÄ¿ÖУ¬¿Í»§ÒªÇóËùÓвéѯ½á¹û¶¼¿ÉÒÔµ¼³öµ½Excel£¬¶ÔÓÚÊý¾ÝÁ¿²»´óµÄ£¨¼¸ÍòÌõ£©£¬Õâ±È½ÏÈÝÒ×ʵÏÖ£¬µ«¶ÔÓÚÊý¾ÝÁ¿±È½Ï´óµÄ£¨¼¸Ê®Íò¼°ÒÔÉÏ£¬¾ßÌåÒª¿´µ¼³öÄÚÈݵÄ×ֶθöÊýºÍ³¤¶Ì£©£¬ÔòÔÚÊý¾Ý¿â²éѯºÍÉú³ÉexcelÎļþÉ϶¼»áÓÐÂé·³¡£
ÒÔÎÒÔÚʵ¼ÊÏîÄ¿ÖеÄÒ»¸ ......
×÷ÕߣºKevin Lynx¡¡À´Ô´£ºC++²©¿Í
ת×Ô:http://www.kuqin.com/language/20080319/4797.html
ÖÚ¶àC++Êé¼®¶¼ÖÒ¸æÎÒÃÇCÓïÑÔºêÊÇÍò¶ñÖ®Ê×£¬µ«ÊÂÇé×ܲ»ÈçÎÒÃÇÏëÏóµÄÄÇô»µ£¬¾ÍÈçͬgotoÒ»Ñù¡£ºêÓÐ
Ò»¸öºÜ´óµÄ×÷Ó㬾ÍÊÇ×Ô¶¯ÎªÎÒÃDzúÉú´úÂë¡£Èç¹û˵ģ°å¿ÉÒÔΪÎÒÃDzúÉú¸÷ÖÖÐͱðµÄ´úÂë(ÐͱðÌæ»»)£¬
ÄÇôºêÆäʵ¿ÉÒÔΪÎÒÃÇÔÚ·ûºÅÉÏ ......
c++¿âÎļþÖеķûºÅµÄº¬Ò壺
ËùÓеķûºÅ¶¼ÊÇÒÔÏ»®Ïß¼ÓÉÏ´óд×ÖĸҲ¾ÍÊÇ"_Z"¿ªÍ·£¬¶ÔÓÚÔÚ ÀàÀï»òÕßÃüÃû¿Õ¼äÖеķûºÅ£¬ºóÃæ½ô¸ú"N"£¬È»ºóÊǸ÷¸öÃüÃû¿Õ¼äºÍÀàµÄÃû×Ö£¬Ã¿¸öÃû×ÖÇ°ÊÇÃû×Ö×Ö·û´®µÄ³¤¶È£¬ËæºóÊÇ´óд×Öĸ"E"£¬¶ÔÓÚÒ»¸öº¯Êý£¬ËûµÄ²ÎÊýÁÐ±í¶¼ÔÚEºóÃ棬 ......
ÔÚƽʱ¹¤×÷ÖУ¬ÄÑÃâ»áÓöµ½°ÑXML×÷ΪÊý¾Ý´æ´¢¸ñʽ¡£Ãæ¶ÔÄ¿Ç°ÖÖÀà·±¶àµÄ½â¾ö·½°¸£¬Äĸö×îÊʺÏÎÒÃÇÄØ£¿ÔÚÕâƪÎÄÕÂÖУ¬ÎÒ¶ÔÕâËÄÖÖÖ÷Á÷·½°¸×öÒ»¸ö²»ÍêÈ«ÆÀ²â£¬½ö½öÕë¶Ô±éÀúXMLÕâ¿éÀ´²âÊÔ£¬ÒòΪ±éÀúXMLÊǹ¤×÷ÖÐʹÓÃ×î¶àµÄ(ÖÁÉÙÎÒÈÏΪ)¡£
¡¡¡¡Ô¤±¸
¡¡¡¡²âÊÔ»·¾³£º
¡¡¡¡AMD¶¾Áú1.4G OC 1.5G¡¢256M DDR333¡¢Windows2000 Server SP ......