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

libxml2ÈçºÎ»ñµÃxmlµÄ×Ö·û´®£¿ - C/C++ / CÓïÑÔ

C/C++ code:

xmlDocPtr doc;
char *tt = "<?xml version='1.0'?><class version='1.0'><sigcode for='actions'></sigcode><actions><copy></copy></actions></class>";
doc = xmlReadMemory(tt,strlen(tt),NULL,"UTF-8",XML_PARSE_RECOVER);


ÎÒÏÖÔÚÓÃC²Ù×÷libxml2£¬¾ÍÊÇ´ÓxmlDocPtrÖлñµÃ
Õû¸öXMLµÄ×Ö·û´®ÐÅÏ¢¡£
¼ÓÔØÊÇÕâÑùÁË£¬ÈçºÎÔÙ´ÓdocÀï»ñµÃ×Ö·û´®ÄØ£¿
Èç¹ûÎÊÌâ½â¾öÁË£¬ÎÒ²»»áÁßØÄ·ÖµÄo_@!

End_rbody_64850864//-->
¸Ã»Ø¸´ÓÚ2010-04-24 08:35:37±»¹ÜÀíԱɾ³ý



¶ÔÎÒÓÐÓÃ[0]
¶ª¸ö°åש[0]
ÒýÓÃ
¾Ù±¨
¹ÜÀí
TOP








mysuli312
(mysuli312)

µÈ¡¡¼¶£º



#2Â¥ µÃ·Ö£º95»Ø¸´ÓÚ£º2010-04-21 19:26:54



ÒýÓÃ
ÄãÈ·ÐÅÄãÏëÒªµÄÊÇÄǸö×Ö·û´®Âð£¿
ÓÃÕâ¸ö
xmlNodePtr root_element = xmlDocGetRootElement(doc);
Äã¾Í¿ÉÒԵõ½¸ù½ÚµãÁË£¬È»ºó½øÐÐÐèÒªµÄ²Ù×÷¡£Èç¹ûÏëÒª×Ö·û´®µÄ»°£¬Äã¸ù±¾Ã»ÓбØÒªÏȷŵ½ docÀï
ÎÞÂÛ´ÓÎļþÖжÁ³öÀ´£¬»¹ÊÇ´ÓÄÚ´æÖеõ½£¬¶¼²»ÓÃÔÚXMLÀïתһȦ

ÎÒÒ²²»ÏëתһȦµÄ£¬ÎÒÒª´´½¨Ò»¸öXML£¬¶øÇÒ¶ÔÆä½øÐÐÐ޸ģ¬²åÈëµÈ²Ù×÷£¬
×îºó²»ÐèҪдÈëÓ²ÅÌ£¬Ò²²»ÄÜдÈëÓ²ÅÌ£¬¶øÖ±½ÓÒª»ñµÃXMLÀïÃæµÄÄÚÈÝ¡£
»ñµÃ¸ù½ÚµãÎÒÒ²ÖªµÀ£¬ÏÖÔÚ¾ÍÊÇÏë´ÓdocÖлñµÃÀïÃæµÄXMLÄÚÈÝ¡£

¼ÇµÃÓиöÀàËÆxmlWriteMemoryµÄ£¬¾Í¿ÉÒÔÖ±½ÓдÄÚ´æÀïÁË

xmlDocDumpFormatMemoryEnc
ÓÃÕâ¸öº¯Êý£¬ÕÒµ½ÁË


Ïà¹ØÎÊ´ð£º

java xmlÎÄÌâ - Java / Java SE

<?xml version="1.0" encoding="utf-8" ?> 
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical&q ......

C/C++ÖÐÓÐûÓиñʽ»¯UÅ̵ĺ¯Êý - C/C++ / C++ ÓïÑÔ

´ó¼ÒºÃ£º
ÎÒÏëʵÏÖ¼ì²âµ½²åÈëSD¿¨ºó×Ô¶¯½«SD¿¨¸ñʽ»¯µÄ¹¦ÄÜ£¬²»ÖªC/C++ÖÐÓÐûÓиñʽ»¯UÅ̵ĺ¯Êý£¿
ÁíÍ⣬ÎÒ²»ÏëʹÓÃSHFormatDrive£¬ÒòΪÕâ¸öº¯Êý»áµ¯³öÊÇ·ñÒª¸ñʽ»¯µÄÌáʾ¿ò£¬ÎÒÐèÒªµÄÊÇϵͳ×Ô¶¯¸ñʽ»¯£¬¶ø²Ù×÷Õß² ......

c¾²Ì¬±àÒëÁíÒ»¸öÎļþ¼ÐµÄ¿âº¯Êý - C/C++ / CÓïÑÔ

ÔÚ¸ùĿ¼/libÖдæ·ÅÒ»¸ölog.c£¬log.h£¬²¢ÓÃÏÂÃæµÄÓï¾ä£º
gcc -c log.c
ar crv liblog.a log.o
±àÒë³öÒ»¸öliblog.a¾²Ì¬¿â£¬È»ºóÔÚÎļþ¼Ð£º/testfileÖд´½¨Ò»¸ötest.cºÍtestc.c£¬test.cÖÐÒýÓÃÁËtestc.cÖж¨ÒåµÄ·½·¨ ......

±éÀúÒ»¸öxml²¢Êä³öÖ¸¶¨½ÚµãµÄÖµ - .NET¼¼Êõ / C#

ÎÒÓÐÒ»¸öÀàËƵÄxmlµÄ string£¬Ïëͨ¹ý±éÀúÔõô¸öxml Êä³öÎÒÏëÒªµÄelementµÄÖµ
xml Ϊ£º
<Discover xmlns="urn:schemas-microsoft-com:xml-analysis">
  <RequestType>DISCOVER_XML_ME ......

Ϊʲôxml²»ÄÜÏÔʾ°¢À­²®ÎÄ - C/C++ / C++ ÓïÑÔ

ΪʲôÎҵijÌÐòµ÷ÓÃXMLÅäÖÃÎļþÖеİ¢À­²®ÎÄÏÔʾ²»³öÀ´£¿ÆäËûµÄÓïÖÖ¶¼¿ÉÒÔ£¬ÈçÖÐÎÄ£¬Ó¢ÎÄ£¬µÂÎĶ¼¿É¡£
ÎÒ½«XMLµÄ±àÂë¸ÄΪutf-8ºÍunicodeµÄµ½µÃ½á¹û¶¼Ò»Ñù.
°¢À­²®ÎĵÄ×Ö¿âÄãÓÐô£¿

ÓÐ,ÎÒµÄEXEÊÇ·ÅÔÚpc»úÉÏÖ´Ðе ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ