javaÖÐʹÓÃdom4j¶ÁxmlÎļþ¼òµ¥½Ì³Ì
ÐèÒªdom4j.jarÎļþ £¬×ÔÐÐÏÂÔØ¡£ test.xml 1: <?xml version="1.0" encoding="gbk"?>
2:
3: <students>
4: <person sex="ÄÐ" age="21">
5: <id>1</id>
6: <name>ÕÂÖÎÅô</name>
7: <homepage>http://blog.csdn.net/tonyzzp</homepage>
8: </person>
9: <person age="20">
10: <id>2</id>
11: <name>ÐìÐÛð©</name>
12: <homepage boolean="false">http://www.xxh.com</homepage>
13: </person>
14: </students>
XMLStudentsParam.java
1: package org.zzp.common.xml.dom4j;
2:
3: public enum XMLStudentsParam {
4: id,name,homepage,sex,age
5: }
Dom4jReadDemo.java
1: package org.zzp.common.xml.dom4j;
2:
3: import java.util.Iterator;
4: import java.util.List;
5:
6: import org.dom4j.Attribute;
7: import org.dom4j.Document;
8: import org.dom4j.DocumentException;
9: import org.dom4j.Element;
10: import org.dom4j.io.SAXReader;
11:
12: public class Dom4jReadDemo {
13: public static void main(String[] args) {
14: try {
15: Document doc=new SAXReader().read("test.xml");
16: Element root=doc.getRootElement();
17: System.out.println("¸ù½ÚµãÃû£º"+root.getName());
18: List<Element> students=root.elements();
19: System.out.println("¹²ÓÐѧÉúÊý"+students.size()+"\n");
20: //±éÀúÿ¸öѧÉú
21: for(Iterator<Element> it= students.iterator();it.hasNext();){
22: Element student=(Element)it.next();
23: List<Element> student_s=student.elements();
24: //±éÀúÿ¸öѧÉúµÄ×Ó±êÇ©
25: for(Iterator<Element> its=student_s.iterator();its.hasNext();){
26: Element param=(Element)its.next();
27: switch(XMLStudentsParam.valueOf(param.getName())){
28: case name:
29: System.out.prin
Ïà¹ØÎĵµ£º
Á´±íLinkedListÊÇÓÉÈô¸É¸ö³ÆΪ½áµãµÄ¶ÔÏó×é³ÉµÄÒ»ÖÖÊý¾Ý½á¹¹£¬Ã¿¸ö½áµãº¬ÓÐÒ»¸öÊý¾ÝºÍÏÂÒ»¸ö½áµãµÄÒýÓ㬻òº¬ÓÐÒ»¸öÊý¾Ý²¢º¬ÓÐÉÏÒ»¸ö½áµãµÄÒýÓúÍÏÂÒ»¸ö½áµãµÄÒýÓà LinkedListÀàÔÚjava.util°üÖÐ
1.¹¹Ôì·½·¨£ºLinkedList()
2.³£Ó÷½·¨
public boolean add(Object o)£ºÏòÁ´±íÌí¼ÓÒ»¸ ......
ʵÑé»·¾³£ºJDK1.5¡¢Eclipse3.1¡¢XP²Ù×÷ϵͳ
·Ö´ÊϵͳJava½Ó¿Ú½âѹ°ü£ºd:\fenci£¨http://www.nlp.org.cnÖвéÕÒÏÂÔØ£©
µ¼Èë²½Ö裺
ÔÚEclipseÖÐн¨JavaÏîÄ¿£¬Ãû³ÆΪ£ºWordSpli£¬Ä¿Â¼½á¹¹ÈçÏÂËùʾ£º
ÓÒ»÷WordSplitÏîÄ¿£¬Ñ¡Ôñ“µ¼È딣¬½«µ¯³öµ¼Èë´°¿Ú£¬Ñ¡ÔñÁбíÖеēÎļþϵͳ”£¬µ¯³ö“ÎļþÏµÍ ......
»¨ÁËÒ»¸ö¶àÔÂÓÃJava NIOдÁËÒ»¸ö¶¨ÖƵÄHTTP Server£¬Ö÷ÒªÊÇÖ§³ÖÎÒµÄWeBuzz.IMÍøÒ³°æÁÄÌì·þÎñ
¡£
ÏȽéÉÜÒ»ÏÂWeBuzz.IMÍøÒ³ÁÄÌì·þÎñ¡£
WeBuzz.IM
ÊÇÒ»¿îÍøÒ³°æ¼´Ê±ÁÄÌ칤¾ß£¬ÓÃÓÚ°ïÖúÓû§Í¨¹ýÍøÒ³ºÍÅóÓÑÁÄÌì¡£Gtalk£¨Google Talk£©
¡¢MSN£¨Windows Live Messenger£©
¡¢Yahoo! Messenger£¨Yahoo! Chat£¬ÓÖ³ÆΪÑÅ»¢Í¨£©
......
ÏÂÔØ dom4j-1.6.1.jar¡£
1: package org.zzp.common.xml.dom4j;
2:
3: import java.io.FileWriter;
4: import java.io.IOException;
5: import org.dom4j.Document;
6: import org.dom4j.DocumentHelper;
7: import org.dom4j.Element;
8: import org.dom4j.io.OutputFormat;
9: impor ......
¼×¹ÇÎÄÒѾÍê³ÉÁ˶ÔSUN¹«Ë¾µÄÊÕ¹º£¬ÓÚ1ÔÂ27ÈÕ·¢²¼Á˶ÔSun¸÷ÏîÒµÎñµÄÕûºÏ¹æ»®¡£×ÜÌåÉÏ˵£¬OracleÒª³ÉΪÈíÓ²¼þÒ»Ì廯µÄÕûÌå½â¾ö·½°¸µÄ³§ÉÌ¡£ ÒÔϾÍÆä¶Ô±¸ÊܹØ×¢µÄJava·½ÃæµÄ²ßÂÔ×ö¸ö½éÉÜ¡£
Java SE:
1£©ÍƳöJDK SE 7£¬ Ëü½«°üÀ¨¶à¸öÐµĹ¦ÄÜ£¬ÈçÌá¸ß¿ª·¢ÈËÔ±µÄЧÂÊ£¬Ìṩ¸ßÐÔÄÜ£¬¶Ô¶àºËоƬµÄÖ§³ÖµÈ¡£
2£©SunµÄHotSpot ......