参考了一些文档,好像是dom4j,jdom这些解析框架在解析xml文件时,要使用一些xml解析器,而在jdk1.4或者更高版本中,提供了sax2和解析器,我的程序在jdk1.4下可以运行。
但是在jdk1.3下,出现如下提示:
Warning: Caught exception attempting to use SAX to load a SAX XMLReader
Warning: Exception was: org.xml.sax.SAXException: Can't create default XMLReader; is system property org.xml.sax.driver set?
Warning: I will print the stack trace then carry on using the default SAX parserorg.xml.sax.SAXException: Can't create default XMLReader; is system property org.xml.sax.driver set?
at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)
at org.dom4j.io.SAXHelper.createXMLReader(SAXHelper.java:83)
at org.dom4j.io.SAXReader.createXMLReader(SAXReader.java:894)
at org.dom4j.io.SAXReader.getXMLReader(SAXReader.java:715)
at org.dom4j.io.SAXReader.read(SAXReader.java:435)
at org.dom4j.io.SAXReader.read(SAXReader.java:264)
... ... 我应该提供一个什么xml解析器才可以解决这个问题?jdk1.4用的是哪个xml解析器啊
但是在jdk1.3下,出现如下提示:
Warning: Caught exception attempting to use SAX to load a SAX XMLReader
Warning: Exception was: org.xml.sax.SAXException: Can't create default XMLReader; is system property org.xml.sax.driver set?
Warning: I will print the stack trace then carry on using the default SAX parserorg.xml.sax.SAXException: Can't create default XMLReader; is system property org.xml.sax.driver set?
at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)
at org.dom4j.io.SAXHelper.createXMLReader(SAXHelper.java:83)
at org.dom4j.io.SAXReader.createXMLReader(SAXReader.java:894)
at org.dom4j.io.SAXReader.getXMLReader(SAXReader.java:715)
at org.dom4j.io.SAXReader.read(SAXReader.java:435)
at org.dom4j.io.SAXReader.read(SAXReader.java:264)
... ... 我应该提供一个什么xml解析器才可以解决这个问题?jdk1.4用的是哪个xml解析器啊
似乎是XML文件里Unicode字符集的问题,你Google一下
http://www-128.ibm.com/developerworks/cn/xml/x-injava/index.html
http://www-128.ibm.com/developerworks/cn/xml/x-databdopt/part2/index.html
http://www.ttud.com/info/1543.htm