Cannot find the declaration of element

Cannot find the declaration of element

<?xml version="1.0" encoding="UTF-8"?>

<!-- <!DOCTYPE teaching-plan SYSTEM "xml1.10.dtd"> -->

<teaching-plan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 

xsi:noNamespaceSchemaLocation="xml1.10.xsd">

  <course no="1">

    <course-name>大学英语</course-name>

    <class-hour>76</class-hour>

    <exam-form>考试</exam-form>

  </course>

  <course no="2">

    <course-name>高等数学</course-name>

    <class-hour>70</class-hour>

    <exam-form>考试</exam-form>

  </course>

  <course no="3">

    <course-name>计算机网络</course-name>

    <class-hour>80</class-hour>

    <exam-form>上机考试</exam-form>

  </course>

</teaching-plan>

=================================================

<?xml version="1.0" encoding="UTF-8"?>

<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/xml1.10" xmlns:tns="http://www.example.org/xml1.10" elementFormDefault="qualified">

    <element name="teaching-plan">

       <complexType>

          <sequence>

              <element name="course" minOccurs="1" maxOccurs="100">

                 <complexType>

                    <sequence>

                       <element name="course-name" type="string"></element>

                       <element name="class-hour">

                          <simpleType>

                              <restriction base="integer">

                                 <minInclusive value="20"></minInclusive>

                                 <maxInclusive value="110"></maxInclusive>

                              </restriction>

                          </simpleType>

                       </element>

                       <element name="exam-form" type="string"></element>

                    </sequence>

                     <attribute name="no" type="integer" use="required"></attribute>

                 </complexType>

              </element>

          </sequence>

       </complexType>

    </element>

</schema>


正在回答

登陆购买课程后可参与讨论,去登陆

1回答

<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/xml1.10" xmlns:tns="http://www.example.org/xml1.10" elementFormDefault="qualified">  

改为:

<schema xmlns="http://www.w3.org/2001/XMLSchema" >

把后边的那些去掉就可以了。

因为咱们的xml中引用时用的不带名称空间的。

http://img1.sycdn.imooc.com//climg/5c15d3330001877f05410062.jpg

同学把xsd中<schema xmlns="http://www.w3.org/2001/XMLSchema" >后边其他的去掉就可以了。

如果我的回答解决了你的问题,请采纳,祝学习愉快.

问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
从网页搭建入门Java Web2018版
  • 参与学习           人
  • 提交作业       1088    份
  • 解答问题       10204    个

如果你有Java语言基础,又想以后从事Java Web开发,那么本路径是你的不二选择!本路径从网页搭建开始入手,通过大量案例来学习Java Web基础。定能助你完成Java Web小白的蜕变!

了解课程
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师