新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   XML论坛     W3CHINA.ORG讨论区     计算机科学论坛     SOAChina论坛     Blog     开放翻译计划     新浪微博  
 
  • 首页
  • 登录
  • 注册
  • 软件下载
  • 资料下载
  • 核心成员
  • 帮助
  •   Add to Google

    >> DTD, XML Schema(XMLS), RELAX NG
    [返回] 中文XML论坛 - 专业的XML技术讨论区XML.ORG.CN讨论区 - XML技术『 DTD/XML Schema 』 → [求助]用Schema校验XML格式在AIX上Websphere上出错 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 6039 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: [求助]用Schema校验XML格式在AIX上Websphere上出错 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     chentao1983 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:1
      积分:53
      门派:XML.ORG.CN
      注册:2008/8/25

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给chentao1983发送一个短消息 把chentao1983加入好友 查看chentao1983的个人资料 搜索chentao1983在『 DTD/XML Schema 』的所有贴子 引用回复这个贴子 回复这个贴子 查看chentao1983的博客楼主
    发贴心情 [求助]用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);


       收藏   分享  
    顶(0)
      




    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2008/9/20 16:51:00
     
     GoogleAdSense
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 DTD/XML Schema 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2024/4/29 5:30:26

    本主题贴数1,分页: [1]

    管理选项修改tag | 锁定 | 解锁 | 提升 | 删除 | 移动 | 固顶 | 总固顶 | 奖励 | 惩罚 | 发布公告
    W3C Contributing Supporter! W 3 C h i n a ( since 2003 ) 旗 下 站 点
    苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
    8,437.500ms