我用的例子来自java&xml,我已经装好了Xerces parser的各个类,所以不知原因,希望有用过的高手帮帮忙。

解决方案 »

  1.   

    难道没有人试过java&xml中的这些程序???
      

  2.   

    It used a xml parser of apache, you must set the parser jar file in your classpath, and set your work folder in your classpath
      

  3.   

    你的意思是不必把jar文件解压缩,直接放到classpath (jar文件放到classpath下)下,并且把工作文件放到classpath下?
      

  4.   

    set two jar files 
    xercesImpl.jar
    xmlParserAPIs.jar
    in your classpath then you can use the parser
      

  5.   

    To use the sample, you must set the work folder for you sample, then you can put the sample files in your work folder then you can run the sample
      

  6.   

    我把这两个文件放到jdk/bin中,为什么还是不行?
      

  7.   

    我把SAXParserDemo.java放到jdk中的一个工作目录中,把两个jar文件放到jdk\bin中{这必然在classpath 中},还是不对,不知道错在那里??
      

  8.   

    set your classpath =.;c:\xerces\xercesImpl.jar;c:\xerces\xmlParserAPIs.jar;c:\yourworkfolder 
    then put the sample files SAXParserDemo.java in the c:\yourworkfolder, then comple the *.java files(javac SAXParserDemo.java) ,then run the class files(java SAXParserDemo)
      

  9.   

    check your SAXParserDemo.java, it may be package in ch03
    then you must put the cho3\SAXParserDemo.java in your work folder
    then at c:\yourworkfolder\> java cho3.SAXParserDemogood luck!
      

  10.   

    我按照你说的作了,但现在在编译时就碰到了错:
    c:\mywork\SAXParserDemo.java:37:不能解析符号
    符号:类Attributes
    位置:包in sax
    import org.xml.sax.Attributes;