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±í´ïʽ¾Í¿ÉÒÔÕýÈ·µÄ·µ»Ø½á¹û¡£
Çë½ÌËÖªµ½ÔÒòÂð£¿
Ïà¹ØÎÊ´ð£º
Êý¾Ý¿â±íÖÐÓÐÒ»ÁУ¨TranXml£©ÀàÐÍÊÇxml£¬´æ´¢µÄÊÇÀàËÆ
<fathernode>
<a>aaa
</a>
<b>bbb
</b>
</fathernode>
µÄÐÅÏ¢£¬²¢ÇÒͨ¹ý²éѯ·½· ......
ÎÒÊÇÏëÓÃPHP´ÓÊý¾Ý¿âÖжÁÈ¡Êý¾Ý£¬È»ºóдÈëxml£¬È»ºóFLASHÏÔʾXMLÖеÄÊý¾Ý
µ«ÊDZ¾µØ²âÊÔPHPÄܶÁ³öXML£¬´«µ½¿Õ¼äÀï¾Í¶Á²»³öÀ´ÁË£¬ÇëÎÊÔõô»ØÊÂ?
´íÎó´úÂëÈçÏÂ:
Fatal error: Cannot instantiate non-exis ......
ÒÔÏ´úÂëÔÚIEÏÂÊÇ¿ÉÒÔÕý³££¬µ«ÊÇÓÃNETBOX·â×°¾Í²»ÐÐÁË£¬ÔËÐе½ºìÉ«µÄµØ·½¾Í³ö´íÁË£¬ËµÈ±ÉÙ¶ÔÏñ£¬ÇëÎÊÔõôÑùÐ޸ġ£
JScript code:
//////////////////// AJAXÀà////////////////
function getxml ......
ÏëÖªµÀÓÃdataset¶ÁдXMLÊÇÔõô°ìµ½µÄ£¬¶øÇÒÔõô´æÈëÊý¾Ý¿â£¿
ÓÃXML¶ÁдÓÖÔõôÄÜʵÏÖ£¿
Çë¸÷λ´óϺ°ï¸öæ~~~£¡
DataSet set = new DataSet();
set.ReadXml()
set.WriteXml
public static DataSet Con ......
×¢£º
1.ÊÖ¶¯É¾³ýieÁÙʱÎļþºó¿ÉÒÔ»ñÈ¡ÐÂÊý¾Ý£»
2.Ë¢ÐÂÒ³Ãæ²»ÄÜ»ñÈ¡ÐÂÊý¾Ý£»
3.²»ÒªËµ¼ÓËæ»úÊýÔÚurlÉÏ£¬ÎÒ²»ÖªµÀ¾ßÌå¼ÓÔÚÄÄÀÎÒÂÒÊÔÁËÒ²»¹ÊDz»ÐУ»
4.Ï£ÍûµÃµ½µÄЧ¹ûÊǵã»÷¡°»ñÈ¡Êý¾Ý¡±ºó¿ÉÒÔÏÔʾxmlÀï ......