Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

VC¶ÁдXMLÎļþ

MSXML2::IXMLDOMDocumentPtr pDoc;
MSXML2::IXMLDOMElementPtr  xmlRoot ;
 // ´´½¨DOMDocument¶ÔÏó
 HRESULT hr  =  pDoc.CreateInstance(__uuidof(MSXML2::DOMDocument40));
 if ( ! SUCCEEDED(hr))
  { 
 MessageBox( " ÎÞ·¨´´½¨DOMDocument¶ÔÏó£¬Çë¼ì²éÊÇ·ñ°²×°ÁËMS XML Parser ÔËÐпâ! " );
  return  ;

 // ¸ù½ÚµãµÄÃû³ÆΪBook
 // ´´½¨ÔªËز¢Ìí¼Óµ½ÎĵµÖÐ

 xmlRoot = pDoc -> createElement((_bstr_t) " Book " );
 // ÉèÖÃÊôÐÔ

 xmlRoot -> setAttribute( " id " ,( const   char   * )m_strId);
pDoc -> appendChild(xmlRoot);
MSXML2::IXMLDOMElementPtr pNode;
 // Ìí¼Ó“author”ÔªËØ

 pNode = pDoc -> createElement((_bstr_t) " Author " );
pNode -> Puttext((_bstr_t)( const   char   * )m_strAuthor);
xmlRoot -> appendChild(pNode);
 // Ìí¼Ó“Title”ÔªËØ

 pNode = pDoc -> createElement( " Title " );
pNode -> Puttext(( const   char   * )m_strTitle);
xmlRoot -> appendChild(pNode);
 // ±£´æµ½Îļþ
 // Èç¹û²»´æÔھͽ¨Á¢,´æÔھ͸²¸Ç
 
 pDoc -> save( " d:\\he.xml " );
------------------------------------------------------------------------------------------------------------------------------------------------
MSXML2::IXMLDOMDocumentPtr pDoc;
HRESULT hr;
hr = pDoc.CreateInstance(__uuidof(MSXML2::DOMDocument40));
 if (FAILED(hr))

  MessageBox( " ÎÞ·¨´´½¨DOMDocument¶ÔÏó£¬Çë¼ì²éÊÇ·ñ°²×°ÁËMS XML Parser ÔËÐпâ! " );
  return  ;

 // ¼ÓÔØÎļþ
 
 pDoc -> load( " d:\\he.xml " );
MSXML2::IXMLDOMNodePtr  pNode;
 // ÔÚÊ÷ÖвéÕÒÃûΪBookµÄ½Úµã," // "±íʾÔÚÈÎÒâÒ»²ã²éÕÒ
 
 pNode = pDoc -> selectSingleNode( " //Book " );
MSXML2::DOMNodeType nodeType;
&nbs


Ïà¹ØÎĵµ£º

ajaxÓëjsp »ñµÃ¿Õxml½â¾ö·½·¨


AjaxºÍjspµÄ¹ÖÏÖÏó     
Èç¹ûÓÃAjaxÈ¥ÇëÇóÒ»¸öjspÒ³Ã棬¸ÃjspÒ³Ãæ·µ»ØµÄÊÇxml£¨response.setContentType("text/xml; charset=GB2312");£©£¬²¢ÇÒ¸Ãjsp°üº¬ÏÂÃæÕâЩͷ@pageÖ¸ÁîµÄ»°£¬ÔòÔÚ¿Í»§¶Ëxml=XMLHttpRequest.responseXMLµÃµ½µÄÊÇÒ»¸ö²»°üº¬ÈÎÎñ¶«Î÷µÄxml¶ÔÏ󣬼´xml.childNodes.length½«»áÊÇ0. ......

ѧϰ¼Ç¼ ģʽºÍxml£¨1£©

ÒÔÏÂΪһÌìµÄ»ù±¾Ñ§Ï°Çé¿ö£¬°üÀ¨Ñ§Ï°ºÍ¸´Ï°£¬Ä£Ê½²¿·ÖÇ°Ç°ºóºóÒ²¿´Á˺ܶàÁË£¬µ«ÊÇһֱûÄܼá³Ö¿´Í꣬ϣÍûÕâ´Î¿ÉÒÔ¼á³ÖÏÂÈ¥¡£
ģʽ²¿·ÖÎÒûÓÐÖ±½ÓÈ¥¿´±È½Ï¾­µäµÄ¡¶javaÓëģʽ¡·£¬ÕâÊéÌ«ºñÈÝÒ×ÈÃÎÒ¼á³Ö²»ÏÂÈ¥£¬¶øÊDzÉÓÃÁ˳̽ÜдµÄ¡¶´ó»°Éè¼Æģʽ¡·£¬
ÕâÊéдµÄºÜÓÐÒâ˼£¬Ò²ºÜÈÝÒ×Àí½â¡£Ï£ÍûÕâÑùµÄÊé¿ÉÒÔ¶àЩ¡£ºÇºÇ£¬µ±È»µÈ¿´ ......

XMLʵÏÖÒì¹¹Êý¾Ý¿â¼äת»»µÄʵÏÖÓë·ÖÎö£¨×ª£©

XMLÖÐÒ»ÖÖÀ©Õ¹µÄ±ê¼ÇÓïÑÔ,Ëü¾ßÓкܺõÄÀ©Õ¹ÐÔ±ê¼Ç.±¾ÎÄͨ¹ýXMLʵÏÖ²»Í¬Êý¾Ý¿âµÄ¶¨Òå,ʵÏÖ¶ÔXMLÊý¾Ý¿âµÄ·ÃÎʺÍÒì¹¹Êý¾Ý¿âÖ®¼äµÄ»¥·Ã.  
¡¡¡¡¹Ø¼ü´Ê:XML  Òì¹¹Êý¾Ý¿â  ÐÅÏ¢½»»»  Êý¾Ý¿â·ÃÎÊ  
1  ÒýÑÔ  
¡¡¡¡XML(Extensible  Markup  Language)ËüÊÇÓÉW3C×éÖ¯ÓÚ1998Äê2Ô &nb ......

HTML¡¢SHTML¡¢DHTML¡¢XHTML¡¢XMLÇø±ð


HTML £­ Hyper Text Mark-up Language £­ ³¬Îı¾±ê¼ÇÓïÑÔ
     HTML-³¬Îı¾±ê¼ÇÓïÑÔ£¬ÊÇWWWµÄÃèÊöÓïÑÔ¡£Éè¼ÆHTMLÓïÑÔµÄÄ¿µÄÊÇΪÁËÄÜ°Ñ´æ·ÅÔÚһ̨µçÄÔÖеÄÎı¾»òͼÐÎÓëÁíһ̨µçÄÔÖеÄÎı¾»òͼÐη½±ãµØÁªÏµÔÚÒ»Æð£¬ÐγÉÓлúµÄÕûÌ壬ÈËÃDz»Óÿ¼ÂǾßÌåÐÅÏ¢ÊÇÔÚµ±Ç°µçÄÔÉÏ»¹ÊÇÔÚÍøÂçµÄÆäËüµçÄÔÉÏ¡£ÎÒÃÇÖ» ......

flexͨ¹ýHTTPService×é¼þ¶ÁÈ¡¸´ÔӽṹµÄxmlÎļþ

    ŪÁËÁ½Ì죬ÖÕÓڰѸ´ÔÓµÄxmlÎļþµÄÊý¾Ý¸ù¾Ý×Ô¼ºµÄÒªÇó¶Á³öÀ´£¬ÏÔʾÔÚÒ³ÃæÉÏÁË¡£flexͨ¹ýHTTPService×é¼þ·¢ËÍÇëÇ󣬶ÁÈ¡xmlÎļþÖÐÊý¾Ý£¬ÓÃxmllistcollection´æ´¢xmlÖÐijһ²¿·ÖÊý¾Ý£¬²¢°ó¶¨ÔÚgridview¿Ø¼þÉÏ¡£
    xml£¬xmllist£¬xmllistcollectionÖÐÖ»ÓÐxmllistcollection¾ßÓÐÐ޸ĸüÐÂÊý¾ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ