ÓÃCMarkUpÀà½âÎöXMLÎļþ
½âÎö£º
CMarkup xml;
CString strChanText, strChanType;
xml.Load("MyXml.xml");
xml.ResetMainPos();
if (!Chan.FindElem("TreeOrg"))
{
return;
}
if (xml.IntoElem())
{
xml.FindElem("Qchannels");
if (xml.IntoElem())
{
while (xml.FindElem("Chan"))
{
strChanText = xml.GetAttrib("iChanId");
strChanType = xml.GetAttrib("iChanType");
}
}
}
XMLÎļþÃû³Æ£ºMyXml.xml
ÄÚÈÝ£º
<?xml version="1.0" encoding="gb2312"?>
<TreeOrg>
<Qorganization>
<Org iAreaCode="3204000001" iUpperCode="0" sAreaName="±õ½Çø"/>
<Org iAreaCode="3204000003" iUpperCode="3204000001" sAreaName="³¤ºÓÅɳöËù"/>
<Org iAreaCode="3204000006" iUpperCode="0" sAreaName="Î÷ºþÇø"/>
</Qorganization>
<Qchannels>
<Chan iAreaCode="3204000001" iChanId="330108110503401463" iChanType="60" iChanModel="0" sChanName="Çò»ú1" />
<Chan iAreaCode="3204000003" iChanId="123456789000000002" iChanType="63" iChanModel="0" sChanName="Ä£Ä⿨¿Ú1"/>
<Chan iAreaCode="3204000003" iChanId="123456789000000003" iChanType="63" iChanModel="0" sChanName="Ä£Ä⿨¿Ú2"/>
<Chan iAreaCode="3204000006" iChanId="123456789000000004" iChanType="60" iChanModel="0" sChanName="Çò»ú2"/>
</Qchannels>
</TreeOrg>
Ïà¹ØÎĵµ£º
WebService£¬¼òµ¥Ò»µã˵£¬¾ÍÊǸö¶ÔÍâµÄ½Ó¿Ú,ÀïÃæÓк¯Êý¿É¹©Íⲿ¿Í»§µ÷ÓÃ(×¢Òâ:ÀïÃæͬÑùÓпͻ§²»¿Éµ÷Óõĺ¯Êý).¼ÙÈôÎÒÃÇÊÇ·þÎñ¶Ë,ÎÒÃÇдºÃÁ˸öwebservice,È»ºó°ÑËü¸øÁË¿Í»§(ͬʱÎÒÃǸøÁËËûÃǵ÷ÓùæÔò),¿Í»§¾Í¿ÉÒÔÔÚ´Ó·þÎñ¶Ë»ñÈ¡ÐÅϢʱ´¦ÓÚÒ»¸öÏà¶Ô͸Ã÷µÄ״̬.¼´ÊÇ¿Í»§²»Á˽â(Ò²²»ÐèÒª)Æä¹ý³Ì,ËûÃÇÖ»»ñÈ¡Êý¾Ý. Webservice´«µ ......
¡¡¡¡ÔÚƽʱ¹¤×÷ÖУ¬ÄÑÃâ»áÓöµ½°Ñ XML ×÷ΪÊý¾Ý´æ´¢¸ñʽ¡£Ãæ¶ÔÄ¿Ç°ÖÖÀà·±¶àµÄ½â¾ö·½°¸£¬Äĸö×îÊʺÏÎÒÃÇÄØ£¿ÔÚÕâƪÎÄÕÂÖУ¬ÎÒ¶ÔÕâËÄÖÖÖ÷Á÷·½°¸×öÒ»¸ö²»ÍêÈ«ÆÀ²â£¬½ö½öÕë¶Ô±éÀú XML Õâ¿éÀ´²âÊÔ£¬ÒòΪ±éÀú XML Êǹ¤×÷ÖÐʹÓÃ×î¶àµÄ£¨ÖÁÉÙÎÒÈÏΪ£©¡£
¡¡¡¡Ô¤ ±¸
¡¡¡¡²âÊÔ»·¾³£º
¡¡¡¡AMD ¶¾Áú1.4G OC 1.5G¡¢256M DDR333¡¢Wind ......
ÔÚƽʱ¹¤×÷ÖУ¬ÄÑÃâ»áÓöµ½°ÑXML×÷ΪÊý¾Ý´æ´¢¸ñʽ¡£Ãæ¶ÔÄ¿Ç°ÖÖÀà·±¶àµÄ½â¾ö·½°¸£¬Äĸö×îÊʺÏÎÒÃÇÄØ£¿ÔÚÕâƪÎÄÕÂÖУ¬ÎÒ¶ÔÕâËÄÖÖÖ÷Á÷·½°¸×öÒ»¸ö²»ÍêÈ«ÆÀ²â£¬½ö½öÕë¶Ô±éÀúXMLÕâ¿éÀ´²âÊÔ£¬ÒòΪ±éÀúXMLÊǹ¤×÷ÖÐʹÓÃ×î¶àµÄ(ÖÁÉÙÎÒÈÏΪ)¡£
¡¡¡¡Ô¤±¸
¡¡¡¡²âÊÔ»·¾³£º
¡¡¡¡AMD¶¾Áú1.4G OC 1.5G¡¢256M DDR333¡¢Windows2000 Server SP ......
private void WriteXML()
{
StringBuilder sb = new StringBuilder();
sb.Append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?> ");
sb.Append(" <!-- ");
sb.Append("<content>");
sb.Append(& ......
1£©DOM£¨JAXP Crimson½âÎöÆ÷£©
DOMÊÇÓÃÓëƽ̨ºÍÓïÑÔÎ޹صķ½Ê½±íʾXMLÎĵµµÄ¹Ù·½W3C±ê×¼¡£DOMÊÇÒÔ²ã´Î½á¹¹×éÖ¯µÄ½Úµã»òÐÅϢƬ¶ÏµÄ¼¯ºÏ¡£Õâ¸ö²ã´Î½á¹¹ÔÊÐí¿ª·¢ÈËÔ±ÔÚÊ÷ÖÐÑ°ÕÒÌض¨ÐÅÏ¢¡£·ÖÎö¸Ã½á¹¹Í¨³£ÐèÒª¼ÓÔØÕû¸öÎĵµºÍ¹¹Ôì²ã´Î½á¹¹£¬È»ºó²ÅÄÜ×öÈκι¤×÷¡£ÓÉÓÚËüÊÇ»ùÓÚÐÅÏ¢²ã´ÎµÄ£¬Òò¶øDO ......