¹ØÓÚxml¡¾¸ß·Ö¡¿
×ÜÎÊÌ⣺ Ôõô»ñÈ¡·þÎñÆ÷ÉÏxmlÎļþ½Úµã£¿
˼·£º
µÚÒ»ÖÖ·½·¨:Ö±½ÓÔÚ·þÎñÆ÷É϶ÁÈ¡xml¡¾Ã²ËÆÃ»Õâ¸ö·½·¨¡¿
µÚ¶þÖÖ·½·¨£º°ÑxmlÏÂÔØ¹ýÀ´£¬È»ºóÓÃCMarkupÀàÈ¥»ñÈ¡ÏëÒªµÄ½Úµã
½âÎö£º 1.°ÑCMarkupÀàÏÂÔØ¹ýÀ´
2.´úÂëʵÏÖ£º
CString CCZkvodDlg::GetXMLInformation(CString tempstr,CString tempstr1)
{
CMarkup xml;
CString csSN;
if(xml.Load("http://222.247.50.5/update.xml"))//ÊäÈëÏëÒª»ñÈ¡ÄǸö·þÎñÆ÷µÄxmlµÄURL
m_EditNews.ReplaceSel("³É¹¦");
else
return "";
while ( xml.FindChildElem("tempstr") ) //ÄǸö½Úµã
{
xml.IntoElem();
xml.FindChildElem( "tempstr1" ); //½ÚµãÏÂÃæµÄÄǸöÊôÐÔÃû×Ö
csSN = xml.GetChildData();
//»ñÈ¡Êý×ÖÖµ
//xml.FindChildElem( "QTY" );
//int nQty = atoi( xml.GetChildData() );
xml.OutOfElem();
}
return csSN; //·µ»ØÏëÒªµÄ½ÚµãÖµ
}
ÎÊÌ⣺1.ÉÏÃæµÄÄǸö³ÌÐòÊÇÕæÈ·µÄô£¿´íÁËÄܰïæ¸ÄÏ£¬
2.¹Ø¼üÎÊÌ⣺Ôõô°ÑURLÉϵÄxmlϹýÀ´£¿
ÏÂÔØ´úÂëʵÏÖ¡¾ÍøÉÏ¿´µ½µÄ¡¿£º
String str="";
CInternetSession mySession(NULL,0);
CHttpConnection *MyHttpCon;
CHttpFile* myHttpFile=NULL;
//myHttpFile=(CHttpFile*)mySession.OpenURL(HttpFileName);
MyHttpCon = mySession.GetHttpConnection("http://222.247.50.5/upda
Ïà¹ØÎÊ´ð£º
Êý¾Ý¿â±íÖÐÓÐÒ»ÁУ¨TranXml£©ÀàÐÍÊÇxml£¬´æ´¢µÄÊÇÀàËÆ
<fathernode>
<a>aaa
</a>
<b>bbb
</b>
</fathernode>
µÄÐÅÏ¢£¬²¢ÇÒͨ¹ý²éѯ·½· ......
ÎÒÔÚ±àдһ¸öwince5.0µÄ³ÌÐò£¬ÏëʵÏÖ°ÑPDAÉϵÄÒ»¸öLIST <STRING>ÀàÐ͵ÄÊý¾ÝÐòÁл¯ÎªXML£¬È»ºóÔÚPCÉϵÄÒ»¸öwebserviceÄõ½Õâ¸öXML£¬×ª»¯ÎªDataset£¬¸üÐÂPCÉϵÄÊý¾Ý¿â£¬ÎÒÏëÎÊÔõô°ÑXML´«¸øwebserviceµÄÄØ£¿
......
ÈçºÎÓÃATL´°ÌåÓ¦ÓóÌÐòÖÐÓÃSystem.Xml±éÀúÒ»¸öXmlÎļþ
Äã˵µÄÊÇÍйܴúÂ룿
¡£
vc¿ÉÓÃmsxml
http://msdn.microsoft.com/en-us/library/ms767594(VS.85).aspx
MSXML4
//ÒýÈëmsxml4.dll &nbs ......
ÎÒÏÖÔÚÓÐÒ»¸öXML¶ÔÏó
var merxml
merxml ±£´æµÄÄÚÈÝ ÊÇ
<root>
<a>a</a>
<b>b</b>
</root>
ÎÒÏÖÔÚµÄÄ¿µÄÊÇÒª°Ñ merxml Õâ¸öXML¶ÔÏó ÍêÕûµÄÊä³öµ½Ò»¸öÎı¾¿ò tx ......
XMLÎļþÄÚÈÝ£º
- <ResList>
<page>0</page>
- <resItem>
<resName>WWW</resName>
</resItem>
- <resItem>
&nb ......