以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 DTD/XML Schema 』  (http://bbs.xml.org.cn/list.asp?boardid=23)
----  我的xml总是找不到xsd,不知道什么地方写错了。  (http://bbs.xml.org.cn/dispbbs.asp?boardid=23&rootid=&id=34103)


--  作者:快乐腊月梅
--  发布时间:6/9/2006 5:14:00 PM

--  我的xml总是找不到xsd,不知道什么地方写错了。
我要用xsd文件来检验xml,但是总找不到xsd文件
ClassMapping.xml如下:
<?xml version="1.0" encoding="utf-8" ?>
<classmapping xmlns="http://localhost"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://localhost ClassMapping.xsd">
        <name>System.Windows.Forms.TabControl</name>
       <address>System.Windows.Forms.TabPage</address>
</classmapping>

ClassMapping.xsd文件如下:
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
       targetNamespace="http://localhost"
       xmlns="http://localhost"
     elementFormDefault="qualified">
                      <xs:element name="classmapping">
  <xs:complexType>
   <xs:sequence>
    <xs:element name="name" type="xs:string">
    <xs:element name="address" type="xs:string">
   </xs:sequence>
  </xs:complexType>
 </xs:element>
</xs:schema>


--  作者:gemingke
--  发布时间:6/9/2006 5:25:00 PM

--  
http://localhost
要想上面这个东西生效,必须在Internet信息服务(IIS)里进行设置才行
--  作者:gemingke
--  发布时间:6/9/2006 5:27:00 PM

--  
http://localhost
要想上面这个东西生效,必须在Internet信息服务(IIS)里进行设置才行
--  作者:flyfoxs
--  发布时间:6/12/2006 11:11:00 AM

--  
楼主可以把XML,文件与xsd文件放在同一目录下面。

这样就可以设置 xsi:schemaLocation="ClassMapping.xsd"就没事了,并且有了一定的移植性。


--  作者:lm830324
--  发布时间:6/25/2006 3:42:00 PM

--  
xsi:schemaLocation="http://localhost/ ClassMapping.xsd
文件名前有一个空格
这样就行了吧



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