libxml2ÓÃxpath½âÎöxmlÎĵµµÄÎÊÌâ
xmlÎĵµÊ±ÄÚ´æÖеÄÒ»¶Î×Ö·û´®£¬ÏÖÔÚÐèÒªÓÃxpath½âÎö³öÆäÖÐÒ»¸ö½ÚµãµÄÖµ¡£´úÂëÈçÏ£º
C/C++ code:
// buffer ÊÇxmlÎĵµ£¬sizeÊÇÎĵµµÄ³¤¶È¡£
xmlDocPtr pXmlDoc = xmlParseMemory(buffer, size);
xmlXPathContextPtr pPathCtxt = xmlXPathNewContext(pXmlDoc);
string xpathStr = "node1/node2";
xmlXPathObjectPtr pPathObject = xmlXPathEvalExprexxion(xpathStr.cstr(), pPathCtxt );
²»ÖªµÀÊÇÄÄÀï³öÁËÎÊÌ⣬½âÎö³öÀ´µÄpPathObjectÄÜ·µ»ØÕýÈ·µÄÀàÐÍ£¬È´·´²»»Ø¾ßÌåµÄÖµ£»Èç¹û½«xpathStr»»³ËÓëÎĵµÎ޹صÄÈÎÒâxpath±í´ïʽ¾Í¿ÉÒÔÕýÈ·µÄ·µ»Ø½á¹û¡£
Çë½ÌËÖªµ½ÔÒòÂð£¿
Ïà¹ØÎÊ´ð£º
vbÖÐÔõôͨ¹ýxmlÀ´½âÎöÊý¾Ý¿âÖеÄ×Ö¶ÎÖµ¡£
û°ì·¨ÓÃXML½âÎöÊý¾Ý¿âµÄ×Ö¶ÎÖµ£¬³ý·ÇÊý¾Ý¿âÖб£´æµÄÊÇXML¸ñʽµÄ×Ö·û´®Îĵµ¡£
XMLÓÃÀ´Õ¹Ê¾²ã´ÎµÄÊý¾Ý¡£
Êý¾Ý¿âÒ»°ãÊǶþάÊý¾Ý¡£
Êý¾Ý¿âÖб£´æµÄÊÇXML×Ö·û´®¸ñʽ£ ......
ÔÚ¿´Ò»¶ÎAS´úÂëʱÓöµ½¼¸¸öÒÉÎÊ¡£
ÔÚFlashÖеÄXML¶ÔÏóòËÆÓÐÒ»¸öchildÊôÐÔ
ÇëÎÊ
1.childÊôÐÔºÍchildNodesÓÐʲôÇø±ð£¿
2.ASÖÐÓÐintÊý¾ÝÀàÐÍÂð£¿AS3.0ÖÐÓÐÂð£¿
´úÂëÖÐÓõ½ÁË´ËÀàÐÍ¡£
3._name¡¢_pare ......
·µ»ØÈçÏÂxml×Ö·û´®£º
<?xml version="1.0" encoding="utf-8" ?>
<DeliverMsg xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www ......
ÎÒÊÇÏëÓÃPHP´ÓÊý¾Ý¿âÖжÁÈ¡Êý¾Ý£¬È»ºóдÈëxml£¬È»ºóFLASHÏÔʾXMLÖеÄÊý¾Ý
µ«ÊDZ¾µØ²âÊÔPHPÄܶÁ³öXML£¬´«µ½¿Õ¼äÀï¾Í¶Á²»³öÀ´ÁË£¬ÇëÎÊÔõô»ØÊÂ?
´íÎó´úÂëÈçÏÂ:
Fatal error: Cannot instantiate non-exis ......
XMLÈç
XML code:
<? xml version="1.0" ?>
<root>
<P>PÎı¾
<c1>c1±êÌâ<c1/>
<c1>c2±êÌâ<c1/>
</P>
</root>
......