那是是要解析 xml用到的包,DOM或责sax都可以,你到google取搜索一下,就有好多资料了,ibm网站上也有很多

解决方案 »

  1.   

    你我觉的你还是看看jdom包吧,比较新,且好用,也能实现好多xml的问题,
    我当时也是要用到xml所以看看了两三天就上手了
    但好多方法还要在以后的工作中慢慢掌握
      

  2.   

    那就学习学习xml吧。俺也要看看咯。听说不会这个要被淘汰哟
      

  3.   

    J2SDK 1.5支持SAX,至于DOM

    xml.apache.org
    下一个XERCES
    XML解析器,配一下CLASSPATH
    OK了!!!
      

  4.   

    针对xml的读写有好多种包,你用那个就下载那个就可以了。
      

  5.   

    javax.xml.parsers.*在xml-apis.jar里面!
    JBoss4.0的lib中就带有,JBuilderX也有,jbuilder7不知道,xerces的lib中也有,你可以搜一下你的电脑,太多了
    至于怎样知道什么包在什么地方可以导入,好像没有什么技巧吧,我想应该是一种知识的积累。
      

  6.   

    org.w3c.dom.*这个在哪里找呀
    还有一般的包在哪些站点有下,省得我们这些菜鸟们经常到这里来问呀
      

  7.   

    我把JDK升到了1。4
    这两个都搞定了
    其它的就不知道会不会这么简单搞定
      

  8.   

    你的jbuild应该有自带的,Search下,Find Classes 中,你可以查找啊,
    比如输入DOM,他就会给你列出来。
      

  9.   

    org.w3c.dom.*这个在哪里找呀
    还有一般的包在哪些站点有下,省得我们这些菜鸟们经常到这里来问呀
    xerces里有了 
      

  10.   

    beta-dom3-Xerces-J-bin.2.6.0.zip
    beta2-dom3-Xerces-J-bin.2.6.1.zip
    beta2-dom3-Xerces-J-bin.2.6.2.zip
    xerces-2_6_2
    Xerces-J-bin.1.4.4.zip
    Xerces-J-bin.2.6.0.zip
    Xerces-J-bin.2.6.1.zip
    Xerces-J-bin.2.6.2.zip
    Xerces-J-src.1.4.4.zip
    Xerces-J-src.2.5.0.zip
    Xerces-J-src.2.6.0.zip
    Xerces-J-src.2.6.1.zip
    Xerces-J-src.2.6.2.zip
    Xerces-J-tools.1.4.4.zip
    Xerces-J-tools.2.5.0.zip
    Xerces-J-tools.2.6.0.zip
    Xerces-J-tools.2.6.1.zip
    Xerces-J-tools.2.6.2.zip我下了这么多,要哪一个呀?还有我解开了一个xerces-2_6_2 可以装的时候确定出现:K:\jdk\xerces-2_6_2>build
    Xerces-Java Build System
    ------------------------
    Building with ant classpath F:\JBuilder7\j2sdk1.4.1_02\lib\tools.jar;F:\JBuilder
    7\j2sdk1.4.1_02\lib\classes.zip;.\tools\ant.jar;.\tools\xercesImpl.jar;.\tools\x
    ml-apis.jar;.\tools\bin\xjavac.jar
    Starting Ant...
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/
    Main怎么解决呀
      

  11.   

    Error #: 360 : unreported exception: javax.xml.parsers.ParserConfigurationException; must be caught or declared to be thrown at line 19, column 35
    Error #: 360 : unreported exception: java.io.IOException; must be caught or declared to be thrown at line 20, column 24
    Error #: 360 : unreported exception: org.xml.sax.SAXException; must be caught or declared to be thrown at line 20, column 24
    这又是什么东西
      

  12.   

    Xerces-J-bin.2.6.2用rar解压到硬盘,我的是D盘,然后在CLASSPATH里设置
    D:\xerces-2_6_2\xercesImpl.jar;就可以了
      

  13.   

    上边的设置是用写字版写程序,然后用命令行编译执行。
    具体的IDE还有可能不同。我还用NETBEANS写东西,在NETBEANS里只要加载xercesImpl.jar就能用了。jbuilder我不太清楚怎么设置,查查帮助了。
      

  14.   

    谢谢了
    我看了一下书上的例子,是这样的:(还没有完)
    import javax.xml.parsers.*;
    import org.w3c.dom.*;public class xmldisplay {DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();//newDocumentBuilder错
    Document doc = builder.parse("link.xml");//parse错
      public xmldisplay() {
      }
    }可为什么会提示错误:
    Error #: 360 : unreported exception: javax.xml.parsers.ParserConfigurationException; must be caught or declared to be thrown at line 19, column 35
    Error #: 360 : unreported exception: java.io.IOException; must be caught or declared to be thrown at line 20, column 24
    Error #: 360 : unreported exception: org.xml.sax.SAXException; must be caught or declared to be thrown at line 20, column 24
      

  15.   

    建议先看看java基础方面的内容,如Exception
      

  16.   

    没有用try{}catch(ParserConfigurationException){}
      

  17.   

    Error #: 360 : unreported exception: javax.xml.parsers.ParserConfigurationException; must be caught or declared to be thrown at line 19, column 35
    Error #: 360 : unreported exception: java.io.IOException; must be caught or declared to be thrown at line 20, column 24
    Error #: 360 : unreported exception: org.xml.sax.SAXException; must be caught or declared to be thrown at line 20, column 24
    DOM的处理你要仔细看看专门的书public void test(String xmlDocument, String outputFilename) throws Exception
    {
     File outputFile=new File(outputFilename);
    DOMParser parser=new DOMParser();
    parser.parser(xmlDocument);
    Document doc=parser.getDocument();//串行化
    DOMSerializer serializer=new DOMSerializer();//自己定义的
    serializer.serializer(doc,new File(outputfilename));
    }你找本书看看,内容很复杂DOM是一个标准,有很多东西要看你的解析包的支持。