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

ËÄÖÖ²Ù×÷xmlµÄ·½Ê½£º SAX, DOM, JDOM , DOM4JµÄ±È½Ï


1. ½éÉÜ
1£©DOM(JAXP Crimson½âÎöÆ÷)
        DOMÊÇÓÃÓëƽ̨ºÍÓïÑÔÎ޹صķ½Ê½±íʾXMLÎĵµµÄ¹Ù·½W3C±ê×¼¡£DOMÊÇÒÔ²ã´Î½á¹¹×éÖ¯µÄ½Úµã»òÐÅϢƬ¶ÏµÄ¼¯ºÏ¡£Õâ¸ö²ã´Î½á¹¹ÔÊÐí¿ª·¢ÈËÔ±ÔÚÊ÷ÖÐÑ°ÕÒÌض¨ÐÅÏ¢¡£·ÖÎö¸Ã½á¹¹Í¨³£ÐèÒª¼ÓÔØÕû¸öÎĵµºÍ¹¹Ôì²ã´Î½á¹¹£¬È»ºó²ÅÄÜ×öÈκι¤×÷¡£ÓÉÓÚËüÊÇ»ùÓÚÐÅÏ¢²ã´ÎµÄ£¬Òò¶øDOM±»ÈÏΪÊÇ»ùÓÚÊ÷»ò»ùÓÚ¶ÔÏóµÄ¡£DOMÒÔ¼°¹ãÒåµÄ»ùÓÚÊ÷µÄ´¦Àí¾ßÓм¸¸öÓŵ㡣Ê×ÏÈ£¬ÓÉÓÚÊ÷ÔÚÄÚ´æÖÐÊdz־õģ¬Òò´Ë¿ÉÒÔÐÞ¸ÄËüÒÔ±ãÓ¦ÓóÌÐòÄܶÔÊý¾ÝºÍ½á¹¹×÷³ö¸ü¸Ä¡£Ëü»¹¿ÉÒÔÔÚÈκÎʱºòÔÚÊ÷ÖÐÉÏϵ¼º½£¬¶ø²»ÊÇÏñSAXÄÇÑùÊÇÒ»´ÎÐԵĴ¦Àí¡£DOMʹÓÃÆðÀ´Ò²Òª¼òµ¥µÃ¶à¡£
2£©SAX
        SAX´¦ÀíµÄÓŵã·Ç³£ÀàËÆÓÚÁ÷ýÌåµÄÓŵ㡣·ÖÎöÄܹ»Á¢¼´¿ªÊ¼£¬¶ø²»ÊǵȴýËùÓеÄÊý¾Ý±»´¦Àí¡£¶øÇÒ£¬ÓÉÓÚÓ¦ÓóÌÐòÖ»ÊÇÔÚ¶ÁÈ¡Êý¾Ýʱ¼ì²éÊý¾Ý£¬Òò´Ë²»ÐèÒª½«Êý¾Ý´æ´¢ÔÚÄÚ´æÖС£Õâ¶ÔÓÚ´óÐÍÎĵµÀ´ËµÊǸö¾Þ´óµÄÓŵ㡣ÊÂʵÉÏ£¬Ó¦ÓóÌÐòÉõÖÁ²»±Ø½âÎöÕû¸öÎĵµ£»Ëü¿ÉÒÔÔÚij¸öÌõ¼þµÃµ½Âú×ãʱֹͣ½âÎö¡£Ò»°ãÀ´Ëµ£¬SAX»¹±ÈËüµÄÌæ´úÕßDOM¿ìÐí¶à¡£
 ¡¡¡¡Ñ¡ÔñDOM»¹ÊÇÑ¡ÔñSAX£¿ ¶ÔÓÚÐèÒª×Ô¼º±àд´úÂëÀ´´¦ÀíXMLÎĵµµÄ¿ª·¢ÈËÔ±À´Ëµ£¬  Ñ¡ÔñDOM»¹ÊÇSAX½âÎöÄ£ÐÍÊÇÒ»¸ö·Ç³£ÖØÒªµÄÉè¼Æ¾ö²ß¡£ DOM²ÉÓý¨Á¢Ê÷ÐνṹµÄ·½Ê½·ÃÎÊXMLÎĵµ£¬¶øSAX²ÉÓõÄʼþÄ£ÐÍ¡£
¡¡¡¡DOM½âÎöÆ÷°ÑXMLÎĵµ×ª»¯ÎªÒ»¸ö°üº¬ÆäÄÚÈݵÄÊ÷£¬²¢¿ÉÒÔ¶ÔÊ÷½øÐбéÀú¡£ÓÃDOM½âÎöÄ£Ð͵ÄÓŵãÊDZà³ÌÈÝÒ×£¬¿ª·¢ÈËÔ±Ö»ÐèÒªµ÷Óý¨Ê÷µÄÖ¸ÁȻºóÀûÓÃnavigation APIs·ÃÎÊËùÐèµÄÊ÷½ÚµãÀ´Íê³ÉÈÎÎñ¡£¿ÉÒÔºÜÈÝÒ×µÄÌí¼ÓºÍÐÞ¸ÄÊ÷ÖеÄÔªËØ¡£È»¶øÓÉÓÚʹÓÃDOM½âÎöÆ÷µÄʱºòÐèÒª´¦ÀíÕû¸öXMLÎĵµ£¬ËùÒÔ¶ÔÐÔÄܺÍÄÚ´æµÄÒªÇó±È½Ï¸ß£¬ÓÈÆäÊÇÓöµ½ºÜ´óµÄXMLÎļþµÄʱºò¡£ÓÉÓÚËüµÄ±éÀúÄÜÁ¦£¬DOM½âÎöÆ÷³£ÓÃÓÚXMLÎĵµÐèҪƵ·±µÄ¸Ä±äµÄ·þÎñÖС£
¡¡¡¡SAX½âÎöÆ÷²ÉÓÃÁË»ùÓÚʼþµÄÄ£ÐÍ£¬ËüÔÚ½âÎöXMLÎĵµµÄʱºò¿ÉÒÔ´¥·¢Ò»ÏµÁеÄʼþ£¬µ±·¢ÏÖ¸ø¶¨µÄtagµÄʱºò£¬Ëü¿ÉÒÔ¼¤»îÒ»¸ö»Øµ÷·½·¨£¬¸æË߸÷½·¨Öƶ¨µÄ±êÇ©ÒѾ­ÕÒµ½¡£SAX¶ÔÄÚ´æµÄÒªÇóͨ³£»á±È½ÏµÍ£¬ÒòΪËüÈÿª·¢ÈËÔ±×Ô¼ºÀ´¾ö¶¨ËùÒª´¦ÀíµÄtag¡£ÌرðÊǵ±¿ª·¢ÈËÔ±Ö»ÐèÒª´¦ÀíÎĵµÖÐËù°üº¬µÄ²¿·ÖÊý¾Ýʱ£¬SAXÕâÖÖÀ©Õ¹ÄÜÁ¦µÃµ½Á˸üºÃµÄÌåÏÖ¡£µ«ÓÃSAX½âÎöÆ÷µÄʱºò±àÂ빤×÷»á±È½ÏÀ§ÄÑ£¬¶øÇÒºÜÄÑͬʱ·ÃÎÊͬһ¸öÎĵµÖеĶദ²»Í¬Êý¾Ý¡£
3£©JDOM           http://www.jdom.org/


Ïà¹ØÎĵµ£º

Xml¶Áд

<?xml version="1.0" encoding="utf-8"?> 
<userdata createuser="false">
  <dataconnection>
    <server>xml test</server>
    <uid>sa</uid>
    <pwd>sa</pwd>
  </dataconnection> ......

c#xmlµÄÔöɾ¸Ä²é


ÒÑÖªÓÐÒ»¸öXMLÎļþ£¨bookstore.xml£©ÈçÏ£º  
  <?xml   version="1.0"   encoding="gb2312"?>  
  <bookstore>  
      <book   genre="fantasy"   ISBN="2-3631-4">  
       &n ......

xml ѧϰ¼Ç¼

1.
ÓÃXML½áµãµÄÊôÐÔÖµ²éÕÒÏàͬ½áµãµÄÆäËüÊôÐÔÖµ[C#]
ʵÏÖ¹¦ÄÜ:
ÓÃXML½áµãµÄÊôÐÔÖµ²éÕÒÏàͬ½áµãµÄÆäËüÊôÐÔÖµ,¼´ÈçϵÄxml,ÊäÈëÒ»¸ö001,ÄܵóöFistTag_ValueÕâ¸öÖµÀ´.
1)Ê×ÏÈ,°ÑÏÂÃæµÄxmlÎĵµ´æÔÚDÅÌĿ¼ÏÂ,ÃüÃûΪ:Test.xml,xmlÎĵµÄÚÈÝÈçÏÂ
//-------------------------------------xmlÎĵµ·Ö¸îÏß- ......

½âÎöXML¼¼Êõ

ÔÚ¿ª·¢ÏµÍ³Ê±£¬ÎÒÃǾ­³£»áʹÓõ½xmlÃèÊöµÄÎļþ£¬ÎÒÃÇ»ù±¾²ÉÓÃÈçϼ¸ÖÖ·½Ê½½øÐнâÎö£º
  1dom
  DOM ÊÇÓÃÓëƽ̨ºÍÓïÑÔÎ޹صķ½Ê½±íʾ XML ÎĵµµÄ¹Ù·½ W3C ±ê×¼¡£DOM ÊÇÒÔ²ã´Î½á¹¹×éÖ¯µÄ½Úµã»òÐÅϢƬ¶ÏµÄ¼¯ºÏ¡£Õâ¸ö²ã´Î½á¹¹ÔÊÐí¿ª·¢ÈËÔ±ÔÚÊ÷ÖÐÑ°ÕÒÌض¨ÐÅÏ¢¡£·ÖÎö¸Ã½á¹¹Í¨³£ÐèÒª¼ÓÔØÕû¸öÎĵµºÍ¹¹Ôì²ã´Î½á¹¹£¬È»ºó² ......

½áºÏʹÓÃ½Ó¿ÚºÍ ODI Ô¼Êø¿ª·¢ ODI XML µ½Êý¾Ý¿âµÄת»»

Ö÷Ìâ
±¾ OBE ½Ì³Ì°üÀ¨ÏÂÁÐÖ÷Ì⣺
¸ÅÊö
Çé¾°
Ñé֤ǰÌáÌõ¼þ
ÔÚ ODI ÖÐн¨ÏîÄ¿
Ϊ XML Îļþ²åÈëÐÂÄ£ÐÍ
ΪÊý¾Ý¿â±í CLIENT ²åÈëÄ£ÐÍ
ɾ³ý CITY_CLIENT µÄÔ¼Êø¸±±¾
ÔÚ CLIENT Êý¾Ý´æ´¢ÉÏÉèÖà ODI Ô¼Êø
µ¼Èë֪ʶģ¿é
´´½¨ÓÃÓÚ¼ÓÔØ XML ÎļþµÄнӿÚ
Ö´ÐгÌÐò°ü²¢²âÊÔ½á¹û
²é¿´½Ó¿ÚÖ´ÐеÄÔ¼Êø´íÎó
×ܽá
Ïà¹ØÐÅÏ¢
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ