现在读出xml的数据流.怎么解译出来啊??
怎么解析下面的内容
<books>
  <book>
  <author>Jack Herrington</author>
  <title>PHP Hacks</title>
  <publisher>O'Reilly</publisher>
  </book>
  <book>
  <author>Jack Herrington</author>
  <title>Podcasting Hacks</title>
  <publisher>O'Reilly</publisher>
  </book>
  </books>

解决方案 »

  1.   

    用文档对象模型来解析,先构建文档对象的工厂,指定你的xml文件的位置,然后再通过dom的一些内部方法或者属性把xml解析.  曹翔 Age:20 Sex:Man 
         MSN:[email protected]
         E-mail:[email protected]
         论坛:http://linlin520.cc.topzj.com
         主页:www.linlin520.any2000.com
         职业:软件工程师
         语言:英语3级,日语入门
         开发:JAVA,Hibernate,Spring,Struts,Ajax,JSP
         工具:Eclipse,Tomcat,Weblogic
       数据库:Oracle,MySql,Sql Server 2000,Access
     其他语言:Html,Xml,C#(Winform,Asp.net,VB.net),C,C++,VB,ASP,JavaScript
      

  2.   

    曹翔 Age:20 Sex:Man 
         MSN:[email protected]
         E-mail:[email protected]
         论坛:http://linlin520.cc.topzj.com
         主页:www.linlin520.any2000.com
         职业:软件工程师
         语言:英语3级,日语入门
         开发:JAVA,Hibernate,Spring,Struts,Ajax,JSP
         工具:Eclipse,Tomcat,Weblogic
       数据库:Oracle,MySql,Sql Server 2000,Access
     其他语言:Html,Xml,C#(Winform,Asp.net,VB.net),C,C++,VB,ASP,JavaScript
      

  3.   

    JDOM来解析啊 SAXBuilder proc = new SAXBuilder();
            Document doc=null;
            try{
                doc= proc.build(new FileInputStream(xmlname));
            }
            catch(JDOMException e)
            {
                System.out .print(e.getMessage() );
            }
            catch(IOException e)
            {
                System.out .print(e.getMessage() );
            }
            StringBuffer buf = new StringBuffer();        Element bookRoot = doc.getRootElement();
            List list = bookRoot.getChildren("root");
            for(int i=0;i<list.size();i++){
                Element book1 = (Element)list.get(i);
                buf.append(book1.getText()+"\t"+book1.getChildText("data")+"\r\n");
            }
      

  4.   

    地區:北京
    年限:2年
    技術:.Net BS开发
    工資:avg>>5K + 福利,几乎不加班,工作开心,心情愉快。
    公司性質:汽车门户网站。 PS: 透露点消息,我们公司正在招.net BS开发人员,如果哪位同仁想换工作,是一个不错的机会选择,加[email protected] 说应聘即可!
      

  5.   

    SAXBuilder proc = new SAXBuilder();
            Document doc=null;
            try{
                doc= proc.build(new FileInputStream(xmlname));
            }
            catch(JDOMException e)
            {
                System.out .print(e.getMessage() );
            }
            catch(IOException e)
            {
                System.out .print(e.getMessage() );
            }
            StringBuffer buf = new StringBuffer();        Element bookRoot = doc.getRootElement();
            List list = bookRoot.getChildren("book");
            for(int i=0;i<list.size();i++){
                Element book1 = (Element)list.get(i);
                buf.append(book1.getChildText("author"));
            }就按照这样套用啊