Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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
ÓÃÕâ¸öº¯Êý£¬ÕÒµ½ÁË


Ïà¹ØÎÊ´ð£º

execlÔõôµ÷ÓÃjava³ÌÐò - C/C++ / CÓïÑÔ

ÈçÌ⣬C/C++ÖеÄexeclÔõôµ÷ÓÃдºÃµÄjava³ÌÐò£¬
execl("/opt/java1.5/bin/java","MyClass",NULL);
ÕâÑùµÄ²»ÐÐŶ¡£

²»»á.

ÔËÐÐjava³ÌÐò
ÕÒ¹¤¾ß²é¿´Ò»ÏÂÄǸö³ÌÐòµÄÃüÁîÐÐ

ËÑË÷Ï£ºjni ......

vb¶ÁÈ¡ÓÃwordת»»³ÉµÄxmlÀïµÄÊý¾Ý - VB / »ù´¡Àà

Private Sub Command1_Click()
Dim MyString() As String
Open "a.xml" For Binary As #1 ' ´ò¿ª¸Õ´´½¨µÄÎļþ¡£
ReDim MyString(LOF(1) - 1)
  Put #1, , MyRecord ' ¶ÁÈëËùÓÐ×Ö·ûµ½±äÁ¿ÖÐ ......

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

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

vb¶ÁÈ¡xml - VB / »ù´¡Àà

ÏÖÔÚÓиöxmlÎļþÊÇ<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
 xm ......

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

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

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