以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 DTD/XML Schema 』  (http://bbs.xml.org.cn/list.asp?boardid=23)
----  [求助]用Schema校验XML格式在AIX上Websphere上出错  (http://bbs.xml.org.cn/dispbbs.asp?boardid=23&rootid=&id=67471)


--  作者:chentao1983
--  发布时间:9/20/2008 4:51:00 PM

--  [求助]用Schema校验XML格式在AIX上Websphere上出错
Java做XML解析入库,用Schema校验XML格式,在Windows环境下的Websphere6部署进行校验和解析都没问题,但在AIX上Websphere6上解析就出错,本人联系方式,MSN:chentao_1983_7@hotmail.com QQ:278555390,请高手指点一下,谢谢。

在共享库中已经加入jdom-1.0.jar、dom4j-1.6.1.jar和xerces.jar,校验XML格式报错信息如下:
第2行 第8列:General Schema Error: Can't get back Schema document's root element
:/usr/IBM/WebSphere/AppServer/profiles/App2Pro2/installedApps/operapp1Cell01/oper_amlmis_ear.ear/oper_amlmis.war
xml/validateYear.xsd.
第2行 第8列:Element type 'banks' must be declared.
第3行 第8列:Element type 'bank' must be declared.
第4行 第9列:Element type 'head' must be declared.
............//中间出错信息省略
第71行 第18列:Element type 'sjxmmcjzynr' must be declared.
第72行 第16列:Element type 'sjfxdzywt' must be declared.
第73行 第13列:Element type 'wtzgqk' must be declared.

--------------------------------
用Schema校验XML格式的程序如下:(附件中有Schema和XML文件)
SAXReader reader = new SAXReader();
Document document = null;
//数据校验
String schema = Config.getInstance().getRealPath() + "/xml/validateYear.xsd";
reader.setValidation(true);
reader.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",schema);
XMLErrorHandler errorHandler = new XMLErrorHandler();
reader.setErrorHandler(errorHandler);


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
31.250ms