这个XML没有问题啊?你的程序?
解决方案 »
- s:checkbox怎么在表格中排版?
- spring+ibatis连接数据库如果用到getDatasouce,getconnection要关闭吗
- 请问RESIN是不是不支持SPRING的注解式注入
- 初学hibernate , org.hibernate.exception.GenericJDBCException: Cannot open connection 大家帮帮忙!!鞠躬了!!!
- 急,请问JAVA 调用 .NET的WebServices 为何传过去的参数为NULL.(string)类型.
- 验证码问题
- struts2环境搭建,tomcat报错如下,我的包都引进去了
- 在jsp里,如何选择日期。
- java调用oracl函数问题,急,在线等,麻烦各位帮帮忙阿~~~~
- 引用数据源
- 关于EJB初学者的一个问题..
- Applet使用的弱智问题
String strCurPath = System.getProperty("user.dir");
String strSchema = strCurPath + "\\TestPaper.xsd";
java.io.File f = new java.io.File(strSchema);
try {
parser.setFeature( "http://xml.org/sax/features/validation", true );
parser.setFeature( "http://apache.org/xml/features/validation/schema", true);
parser.setFeature( "http://apache.org/xml/features/validation/schema-full-checking", true);
parser.setExternalNoNamespaceSchemaLocation2(strSchema);
parser.parse(uri);
}
catch(Exception e) {
e.printStackTrace();
fSuccess = false;
}
if ( fSuccess ) {
System.out.println("合法");
}
else {
System.out.println("非法");
} return fSuccess;
} public void warning(SAXParseException exception) throws SAXException {
fSuccess = false;
System.out.println("警告"+exception);
} public void error(SAXParseException exception) throws SAXException {
fSuccess = false;
System.out.println("错误"+exception);
} public void fatalError(SAXParseException exception) throws SAXException {
fSuccess = false;
System.out.println("致命错误"+exception);
}
Sorry,把parser忘定义了。
private MyParser parser = new MyParser();
class MyParser extends DOMParser {
public MyParser() {
}
public void setExternalNoNamespaceSchemaLocation2(String value)
throws SAXNotRecognizedException, SAXNotSupportedException {
this.setExternalNoNamespaceSchemaLocation(value);
}
}