问题

redalert 2003-01-27 12:02:11
下面的schema:
<Schema xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:datatypes">
<AttributeType name='studentID' dt:type='string' required='yes'/>
<ElementType name='name' content='textOnly'/>
<ElementType name='GPA' content='textOnly' dt:type='float'/>
<ElementType name='student' content='mixed'>
<attribute type='studentID'/>
<element type='name'/>
<element type='GPA'/>
</ElementType>
<ElementType name='class' content='eltOnly'>
<element type='student'/>
</ElementType>
</Schema>
我保存在c:\ttt,文件名:classSchema.xml
另外建立一个xml文档保存在c:\ttt
<class xmlns="x-schema:classSchema.xml">
<student studentID="13429">
<name>James Smith</name>
<GPA>3.8</GPA>
</student>
</class>
用IE5.0打开上面的xml文档
我将GPA里面的3.8改为hkj等字符串,我觉得schema应该起作用,因为GPA必须是float类型数据,可是改成字符串用IE5浏览为什么不报错误?
...全文
29 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
ssm1226 2003-01-27
  • 打赏
  • 举报
回复
IE解析不是很严格

你可以用XMLDOM试试

<%
set xmldoc=server.CreateObject("msxml2.domdocument")
xmldoc.async=false
xmldoc.load server.MapPath("11.xml")
Response.Write xmldoc.parseError.reason

%>

8,907

社区成员

发帖
与我相关
我的任务
社区描述
XML/XSL相关问题讨论专区
社区管理员
  • XML/XSL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧