免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5687 | 回复: 7
打印 上一主题 下一主题

dom4j能否通过dtd或xml scheme文件验证XML文件是否正确吗? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-01-16 10:18 |只看该作者 |倒序浏览
dom4j能否通过dtd或xml scheme文件验证XML文件是否正确吗?

论坛徽章:
0
2 [报告]
发表于 2006-01-16 14:41 |只看该作者
看dom4j文档啊,要通过第三方组件来进行,有例子的
http://www.dom4j.org/cookbook.html

Validation

Currently dom4j does not come with a validation engine. You are forced to use a external validator. In the past we recommended Xerces, but now you are able to use Sun Multi-Schema XML Validator. Xerces is able to validate against DTDs and XML Schema, but not against TREX or Relax. The Suns Multi Schema Validator supports all mentioned kinds of validation.

论坛徽章:
0
3 [报告]
发表于 2006-01-16 16:39 |只看该作者
哦,明白,多谢大侠指教!
但我看见dom4j的文档说有对dtd及XML scheme文件的支持,请问大侠,dom4j是提供这方面什么支持呢?

论坛徽章:
0
4 [报告]
发表于 2006-01-17 03:18 |只看该作者
文档上没说清楚吗?你在哪里看到的?给我url,我去看看。

论坛徽章:
0
5 [报告]
发表于 2006-01-17 10:33 |只看该作者
http://www.dom4j.org/

Features

support for XML Schema Data Type support using Kohsuke Kawaguchi's excellent Multi Schema Validator library

论坛徽章:
0
6 [报告]
发表于 2006-01-17 12:51 |只看该作者
这个和cookbook里面不矛盾啊,它是通过与Sun Multi-Schema XML Validator结合来进行schema-document验证的啊,就是说可以让你用schema来验证document,它的程序里面提供了接口,但是实现上,你得配备这个验证组件才能用。

论坛徽章:
0
7 [报告]
发表于 2006-01-18 09:42 |只看该作者
有这方面的例子吗?我想看看是怎么调用的!

论坛徽章:
0
8 [报告]
发表于 2006-01-18 13:29 |只看该作者
我第一次回帖给你的地址里面就有啊,你仔细看了没有啊,到cookbook页面里面搜索
Using Apaches Xerces 1.4.x and dom4j for validation
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP