以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XML工具及XML开发环境 』  (http://bbs.xml.org.cn/list.asp?boardid=7)
----  [讨论]大家看看这是否是xmlspy的bug  (http://bbs.xml.org.cn/dispbbs.asp?boardid=7&rootid=&id=5427)


--  作者:czguang
--  发布时间:2/19/2004 7:33:00 PM

--  [讨论]大家看看这是否是xmlspy的bug
在使用xmlspy验证xml文档时碰到的问题,大家看看是否是我理解错误:
schema文件:
<?xml version="1.0" encoding="GB2312"?>
<schema targetNamespace="http://www.xmlspytest.org/sample" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:test="http://www.xmlspytest.org/sample" elementFormDefault="qualified" attributeFormDefault="unqualified">
 <!--file name:schema1.xsd-->
 <complexType name="simpleType">
  <complexContent>
   <restriction base="anyType">
    <attribute name="attr" type="string" use="required"/>
    <anyAttribute namespace="http://www.other.org/sample/" processContents="lax"/>
   </restriction>
  </complexContent>
 </complexType>
 <element name="xmlspytest">
  <complexType>
   <sequence>
    <element name="simple" type="test:simpleType"/>
   </sequence>
  </complexType>
 </element>
</schema>

xml文档:
<?xml version="1.0" encoding="GB2312"?>
<!--file name:test1.xml-->
<xmlspytest xmlns="http://www.xmlspytest.org/sample" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xmlspytest.org/sample schema1.xsd">
 <simple attr="abc"/>
</xmlspytest>


验证时xmlspy提示simple元素中的attr属性一定要属于命名空间"http://www.other.org/sample/",我的理解是在xml文档其他加入simple元素中的属性一定要属于命名空间"http://www.other.org/sample/",属性attr属于“http://www.xmlspytest.org/sample”


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
7,613.281ms