案例:DTD案例     状态:不可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<body>
3
<h3>
4
This demonstrates a parser error:
5
</h3>
6
7
<script type="text/javascript">
8
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM")
9
xmlDoc.async="false"
10
xmlDoc.validateOnParse="true"
11
xmlDoc.load("/example/dtde/note_dtd_error.xml")
12
13
document.write("<br />Error Code: ")
14
document.write(xmlDoc.parseError.errorCode)
15
document.write("<br />Error Reason: ")
16
document.write(xmlDoc.parseError.reason)
17
document.write("<br />Error Line: ")
18
document.write(xmlDoc.parseError.line)
19
</script>
20
21
</body>
22
</html>