jaxp程序问题sos

04-05-20 freelanceer
public class Conversion {

public static void main(String[] args) {

File f=null;

try

{

f = new File("data.xml");

if (!f.exists()) {

f.createNewFile();

}

}

catch(IOException r){

}

try {

DocumentBuilderFactory factory = BuilderFactory.newInstance();

//factory.setNamespaceAware(true);

//factory.setValidating(false);

DocumentBuilder builder = factory.newDocumentBuilder();

System.out.println("e");

Document document = builder.parse(f);

System.out.println("eo");

Conversion conversion=new Conversion(document);

}catch(Exception e){

System.out.println("eorror!");

}

}

为什么总是显示

e

eorror!

意思是Document document = builder.parse(f);这句话总是产生异常???

SportsBaby1980
2004-06-09 17:46
能找到你的文件路径吗?

你能找到

程序也能找到吗?

猜你喜欢