在创建SchemaFactory的新实例时出错

时间:2013-01-04 17:18:29

标签: java android xml xsd

我在做的时候遇到异常:

factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");

我得到了ileagal参数, 有人可能知道为什么?

部分堆栈跟踪

  

android.app.ActivityThread.access $ 1500(ActivityThread.java:117),   android.app.ActivityThread $ H.handleMessage(ActivityThread.java:935)   android.os.Handler.dispatchMessage(Handler.java:99),   android.os.Looper.loop(Looper.java:123),   android.app.ActivityThread.main(ActivityThread.java:3691),   java.lang.reflect.Method.invokeNative(Native Method),   java.lang.reflect.Method.invoke(Method.java:507),   com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:847)   com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605),   dalvik.system.NativeStart.main(Native Method)]

1 个答案:

答案 0 :(得分:-1)

你需要正确地逃脱结肠 http://docs.oracle.com/javase/1.5.0/docs/api/javax/xml/validation/SchemaFactory.html#newInstance(java.lang.String

尝试factory = SchemaFactory.newInstance("http\://www.w3.org/2001/XMLSchema");