posts - 21,  comments - 6,  trackbacks - 0
公告


いいじゃないか転んだってまた
起き上がれば
いいんだから
転んだついでに仰向いて
空を見上げてごらん
青い空が
今日もお前の上に限りなく広がって
ほほえんでいるのが見えるだろう
お前は
生きてるんだ

<2006年9月>
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

常用链接

留言簿(2)

随笔档案(21)

文章分类(2)

文章档案(2)

CLASSMATE

FRIENDS

Net-Superior

NEUSOFT

Official-WEB

  • AppFuse
  • Matt Raible 开发的一个指导性的入门级J2EE框架

搜索

  •  

积分与排名

  • 积分 - 10191
  • 排名 - 2364

最新评论

阅读排行榜

评论排行榜

 1 package  cn.com;
 2
 3 import  java.io.FileInputStream;
 4 import  java.io.FileNotFoundException;
 5 import  java.io.IOException;
 6 import  java.util.List;
 7
 8 import  org.jdom.Document;
 9 import  org.jdom.Element;
10 import  org.jdom.JDOMException;
11 import  org.jdom.input.SAXBuilder;
12
13 public   class  MyJDom  {
14      public   static   void  main(String[] args)  throws  FileNotFoundException, JDOMException, IOException  {
15         SAXBuilder sab  =   new  SAXBuilder();
16         Document doc  =  sab.build( new  FileInputStream( " ./data/myjdom.xml " ));
17         
18         Element element  =  doc.getRootElement();
19         List list  =  element.getChildren();
20         
21          for ( int  i = 0 ; i < list.size(); i ++ {
22             System.out.println( " ------------ " );
23             
24             Element ele2  =  (Element) list.get(i);
25             String id  =  ele2.getAttribute( " id " ).getValue();
26             System.out.println( " ID===>>> "   +  id);
27             
28             Element ele3  =  ele2.getChild( " title " );
29             String title  =  ele3.getText();
30             System.out.println( " Title===>>> "   +  title);
31         }

32     }

33 }

34
posted on 2006-09-25 14:48 Warren.Wu 阅读(541) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: