DTD 校验
来源:互联网 发布:js获取表格一行数据 编辑:程序博客网 时间:2024/04/29 21:16
Internet Explorer 5.0 can validate your XML against a DTD.
IE5.0可以通过DTD检验你的XML。
Validating with the XML Parser
用XML剖析器确认
If you try to open an XML document, the XML Parser might generate an error. By accessing the parseError object, the exact error code, the error text, and even the line that caused the error can be retrieved:
如果你想打开一个XML文件,那XML剖析器会产生错误。通过访问分析错误目标,精确的错误代码、错误文本以及引起错误的线路都能找到。
Note: The load( ) method is used for files, while the loadXML( ) method is used for strings.
注意:The load( ) method是用于文件的,而the loadXML( ) method是用于字符串的。
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.validateOnParse="true"
xmlDoc.load("note_dtd_error.xml")
document.write("<br>Error Code: ")
document.write(xmlDoc.parseError.errorCode)
document.write("<br>Error Reason: ")
document.write(xmlDoc.parseError.reason)
document.write("<br>Error Line: ")
document.write(xmlDoc.parseError.line)
你可以自己尝试一下 或 查看这个XML文件
Turning Validation off
关闭确认
Validation can be turned off by setting the XML parser's validateOnParse="false".
确认可以通过XML解析器的validateOnParse="false"来关闭。
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.validateOnParse="false"
xmlDoc.load("note_dtd_error.xml")
document.write("<br>Error Code: ")
document.write(xmlDoc.parseError.errorCode)
document.write("<br>Error Reason: ")
document.write(xmlDoc.parseError.reason)
document.write("<br>Error Line: ")
document.write(xmlDoc.parseError.line)
自己尝试一下吧!
A general XML Validator
XML通用的确认方法
To help you validate your xml files, we have created this link so that you can Validate any XML file.
如想确认你的XML文件,我们创建了一个可以快速访问Validate any XML file(确认XML文件)的链接
The parseError Object
分析错误对象(Object)
You can read more about the parseError object in our XML DOM tutorial.
如想了解更多关于parseError 对象的情况,请访问我们DOM tutorial (DOM教程)。
- DTD 校验
- DTD约束和DTD校验
- DTD 如何校验 XML
- XML初探(二)DTD校验
- xml约束和DTD校验
- XMl中DTD校验案例
- xml DTD的约束以及校验
- dom4j 解析xml字符串 去除.DTD校验
- Xml DTD校验中关于external entity的实现策略。
- struts2的校验文件DTD配置出错的解决方法
- struts2的输入校验框架及DTD文件配置
- 主题:Struts2的校验框架,找不到DTD信息
- xwork-validator-1.0.2.dtd 校验时出错
- eclipse自动校验xml文件是否符合dtd\xsd约束
- javaScript校验XML的DTD格式是否正确
- XML parser如何实现DTD校验之一:Element层次结构的校验
- DTD、
- DTD
- 我爱娃娃
- 2007年步入社会的第一年,开始实习的第二天,留下我的第一篇Blog
- DTD - 实体
- asp过滤非法字符
- CSS定义
- DTD 校验
- 欢迎访问我的blog站点 www.cdot.net/blog
- 常见四种虚拟化技术优劣势对比
- 我的程序人生
- 为什么大的网络公司都选择开源软件作为其主要开发工具和平台?
- 传奇源码分析-客户端(WindHorn简述和传奇文件格式分析)
- DeviceAnywhere,基于UDP协议的手机计算机C/S结构软件, 附源码
- DTD - 来自网络的举例
- 从图灵奖看计算机科学技术发展史的缩影