java½âÎöxmlÎļþËÄÖÖ·½Ê½
from: http://blog.csdn.net/WOSHISUNXIANGFU/archive/2008/08/25/2828634.aspx
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
JDOMµÄÄ¿µÄÊdzÉΪJavaÌض¨ÎĵµÄ£ÐÍ£¬Ëü¼ò»¯ÓëXMLµÄ½»»¥²¢ÇÒ±ÈʹÓÃDOMʵÏÖ¸ü¿ì¡£ÓÉÓÚÊǵÚÒ»¸öJav
Ïà¹ØÎĵµ£º
java exception ½â¾ö·½°¸ - ÎÒµÄÒì³£Íø|Òì³£|exception 770 - java.net.unknownhostException 771 - com.ibatis.struts.BeanActionException 772 - javax.servlet.jsp.JspException:Cannot find bean under name org.apache.struts.taglib.html.BEAN 773 - java.lang.NoClassDefFoundError:org apache commons lang Unhand ......
½Ì³Ì5 ËãÊýÔËËãѧϰ³ÌÐò ѧϰĿ±ê 5.1¼òµ¥¼Ó·¨Ñ§Ï°³ÌÐò СѧÉúÔÚ¸Õ¸Õ¿ªÊ¼Ñ§Ï°ÊýѧÔËËãµÄʱºò£¬ÐèÒª²»¶ÏµØ½øÐз´¸´´óÁ¿µÄÁ·Ï°£¬²ÅÄܹ»Ñ¸ËÙÕÆÎÕÕⲿ·ÖÄÚÈÝ¡£ÏÂÃ濪·¢Ò»¸ö¼òµ¥µÄ¼Ó·¨Ñ§Ï°³ÌÐò£¬Äܹ»²úÉú¼Ó·¨ÔËËãÈÃѧÉúÀ´Ñ§Ï°Ìá¸ß¡£ ±àд³ÌÐòÈçÏ£º 1 package lesson5; 2 3 public class Operation1 { 4 int number1; 5 ......
ѧϰjavaµÄ30¸öÄ¿±ê----Èç¹ûÕâ30ÌõÄã×öµÄ²î²»¶àÁË£¬jAVAˮƽ¾Íµ±È»²»ÓÃ˵ÁË£¬ºÃºÃŬÁ¦°É
1.ÄãÐèÒª¾«Í¨ÃæÏò¶ÔÏó·ÖÎöÓëÉè¼Æ(OOA/OOD)¡¢É漰ģʽ(GOF£¬J2EEDP)ÒÔ¼°×ÛºÏģʽ¡£ÄãÓ¦¸ÃÊ®·ÖÁ˽âUML£¬ÓÈÆäÊÇclass£¬object£¬interactionÒÔ¼°statediagrams¡£
¡¡¡¡2.ÄãÐèҪѧϰJAVAÓïÑԵĻù´¡ÖªÊ¶ÒÔ¼°ËüµÄºË ......
JAVA¿ª·¢Õß×ȥµÄ20¸öÓ¢ÎÄÍøÕ¾
1.[http://www.javaalmanac.com] – Java¿ª·¢ÕßÄê¼øÒ»ÊéµÄÔÚÏß°æ±¾. ÒªÏë¿ìËٲ鵽ijÖÖJava¼¼ÇɵÄÓ÷¨¼°Ê¾Àý´úÂë, ÕâÊÇÒ»¸ö²»´íµÄÈ¥´¦.
2.[http://www.onjava.com] – O’ReillyµÄJavaÍøÕ¾. ÿÖܶ¼ÓÐÐÂÎÄÕÂ.
3.[http://java.sun.com] – ¹Ù·½µÄJava¿ª·¢ÕßÍøÕ ......
1.Ï̴߳´½¨µÄÁ½ÖÖ·½Ê½
1£©À©Õ¹ThreadÀಢÖØдpublic void run()·½·¨
ps£º
¶¨ÒåỊ̈߳º
class myThread extends Thread(){
public void run(){
System.out.println("Ju ......