首页 > 解决方案 > 元素“crs:course”的前缀“crs”未绑定

问题描述

我不是在开头的课程标签中绑定了 crs 命名空间吗?问题似乎实际上是 xsi:schemaLocation 语句,但我不确定那是什么。我将命名空间应用于学生和课程元素,以解决 firstName 和 lastName 元素上的名称冲突。我认为这将非常简单。

<crs:course courseID="PSAT-080-5"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmins:crs="http://example.com/higheredtestprep/courses/ns"
        xsi:schemaLocation="http://example.com/higheredtestprep/courses/ns courses.xsd">
   <name>
      <title>PSAT Mathematics Course</title>
      <session>5</session>
   </name>
   <description>
      This is a focused course for students who
      have previously taken the PSAT exam as a sophomore
      but did not receive a desired score on the mathematics 
      portion or students who will be taking the PSAT and 
      wish to strengthen their skills in the mathematics 
      area. Outcomes of the course will be measured using 
      the original PSAT mathematics score compared to a
      course post-test, or a course pre-test compared to the
      subsequent PSAT mathematics score.
   </description>
   <instructor>
      <firstName>Rachel</firstName>
      <lastName>Polygoni</lastName>
   </instructor>
   <stu:students xmlns:stu="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://example.com/higheredtestprep/courses/ns studentsvb.xsd">
       <student stuID="I8900-041" courseID="PSAT-080-5">
          <lastName>Garcia</lastName>
          <firstName>Georgianna</firstName>
          <examDate>2017-10-17</examDate>
          <pretest level="M">55</pretest>
          <score>51</score>
       </student>
    
       <student stuID="I7711-121" courseID="PSAT-080-5">
          <lastName>Smith</lastName>
          <firstName>Ryan</firstName>
          <examDate>2017-10-17</examDate>
          <pretest level="L">25</pretest>
       </student>
    
       <student stuID="I7012-891" courseID="PSAT-080-5">
          <lastName>Zheng</lastName>
          <firstName>Paddy</firstName>
          <examDate>2017-10-17</examDate>
          <pretest level="H">65</pretest>
       </student>
    
       <student stuID="I8053-891" courseID="PSAT-080-5">
          <lastName>Steinke</lastName>
          <firstName>Devon</firstName>
          <examDate>2017-10-22</examDate>
          <pretest level="M">51</pretest>
       </student>
    
       <student stuID="I8154-741" courseID="PSAT-080-5">
          <lastName>Browne</lastName>
          <firstName>Brenda</firstName>
          <examDate>2017-10-22</examDate>
          <pretest level="L">30</pretest>
       </student>
    </stu:students>
</crs:course>

标签: xmlxml-namespaces

解决方案


你只是有一个语法错误,使用某些字体很难发现......

更改i命名空间前缀定义crs

xmins:crs="http://example.com/higheredtestprep/courses/ns"
  ^

l

xmlns:crs="http://example.com/higheredtestprep/courses/ns"
  ^

推荐阅读