xml - 元素“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>
解决方案
你只是有一个语法错误,使用某些字体很难发现......
更改i
命名空间前缀定义crs
,
xmins:crs="http://example.com/higheredtestprep/courses/ns"
^
至l
:
xmlns:crs="http://example.com/higheredtestprep/courses/ns"
^
推荐阅读
- python - 查找具有空字符串的字段
- javascript - 如何使 svg 交互以收集对描绘元素的评论/注释
- c# - 选择值时,下拉列表未在代码后面发布数据
- python - 尝试将 PyTorch 模型导出到 ONNX 时崩溃:forward() 缺少 1 个必需的位置参数
- swiftui - SwiftUI:为什么没有显示第二个警报?
- c++ - 为什么 GCC 不能为两个 int32 的结构生成最佳 operator==?
- c - 在c中将浮点数更改为整数
- javascript - 如何防止 SVG JavaScript 图像被截断?
- javascript - Firebase .update() 返回未定义,它不应该返回更新的对象吗?
- r - 使用聚集时如何更改构面的顺序?