dfactory.setAttribute(JAXP_SCHEMA_LANGUAGE, new File(schemaSource));
===>
dfactory.setAttribute(JAXP_SCHEMA_SOURCE, new File(schemaSource));see
http://xml.apache.org/~edwingo/jaxp-ri-1.2.0-fcs/docs/samples.html#Schema
===>
dfactory.setAttribute(JAXP_SCHEMA_SOURCE, new File(schemaSource));see
http://xml.apache.org/~edwingo/jaxp-ri-1.2.0-fcs/docs/samples.html#Schema
1. 仍旧出现了No attributes are implemented的异常
2. Warning: validation was turned on but an org.xml.sax.ErrorHandler was not
set, which is probably not what is desired. Parser will use a default
ErrorHandler to print the first 10 errors. Please call
the 'setErrorHandler' method to fix this.
这个警告的问题如何解决呢,Log说用setErrorHandler方法来fix,请问具体如何操作呢?
// log如下:
java.lang.IllegalArgumentException: No attributes are implemented
at org.apache.crimson.jaxp.DocumentBuilderFactoryImpl.setAttribute(Docum
entBuilderFactoryImpl.java:93)
at xml.util.XmlAPI.getNodeList2(XmlAPI.java:611)
at xml.util.XmlAPI.main(XmlAPI.java:589)
Warning: validation was turned on but an org.xml.sax.ErrorHandler was not
set, which is probably not what is desired. Parser will use a default
ErrorHandler to print the first 10 errors. Please call
the 'setErrorHandler' method to fix this.
Error: URI=null Line=2: 组件类型“Movies”未被声明。
Error: URI=null Line=3: 属性“xmlns:xsi”未被声明为组件“Movies”。
Error: URI=null Line=3: 属性“xsi:noNamespaceSchemaLocation”未被声明为组件“Mov
ies”。
Error: URI=null Line=4: 组件类型“Movie”未被声明。
Error: URI=null Line=5: 组件类型“ID”未被声明。
Error: URI=null Line=6: 组件类型“Title”未被声明。
Error: URI=null Line=7: 组件类型“Length”未被声明。
Error: URI=null Line=8: 组件类型“Description”未被声明。
Error: URI=null Line=9: 组件类型“Genre”未被声明。
Error: URI=null Line=10: 组件类型“Directory”未被声明。
Validating with XML Schema
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPDOM9.html
Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found
at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)