老师 我这里为什么报错啊

来源:2-6 自由编程

jia_蛙

2019-10-30 11:29:25

<?xml version="1.0" encoding="UTF-8"?>
<teaching-plan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="plan.xsd">
	<!-- number 课程编号 -->	
	<course number="1101">
		<course-name>大学英语</course-name>
		<class-hour>36</class-hour>
		<exam-form>考试</exam-form>
	</course>
	<course number="1102">
		<course-name>高等数学</course-name>
		<class-hour>70</class-hour>
		<exam-form>考试</exam-form>
	</course>
	<course number="1103">
		<course-name>计算机应用基础</course-name>
		<class-hour>100</class-hour>
		<exam-form>上机考试</exam-form>
	</course>
</teaching-plan>
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
	<element name="teaching-plan">
		<complexType>
			<sequence>
				<element name="course" minOccurs="1" maxOccurs="999">
					<complexType>
						<sequence>
							<element name="course-name" type="string"></element>
							<element name="class-hour">
								<simpleType>
									<restriction base="integer">
										<minInclusive value="0"></minInclusive>
										<maxInclusive value="100"></maxInclusive>
									</restriction>
								</simpleType>
							</element>
							<element name="exam-form" type="string"></element>
						</sequence>
						<attribute name="number" type="string" use="required"></attribute>
					</complexType>
				</element>
			</sequence>
		</complexType>
	</element>
</schema>

http://img.mukewang.com/climg/5db9037d097d9d7015420654.jpg

是编辑器的原因还是我哪里编写错误了呀


写回答

2回答

好帮手慕小班

2019-10-30

同学你好,1、复制运行贴出代码,并没有报错内容,所以同学的报错可能是因为Eclipse并没有加载好,同学刷新重启,这个错误就会消失不见。

代码完成的不错,只是根据题目要求还有几个小问题:

    2、根据题目要求,设置course节点最多有100个,但是同学设置最多有999个呐

http://img.mukewang.com/climg/5db92ff10990bab506450070.jpg

    3、根据题目要求:class-hour节点为integer类型,并设置最小值为20,最大值为110

http://img.mukewang.com/climg/5db9301109d04ead05870184.jpg

如果我的回答解决了你的疑惑,请采纳,祝学习愉快~

1
hia_蛙
h 粗心了
h019-10-30
共1条回复

jia_蛙

提问者

2019-10-30

重启Eclipse 之后就不报错了 这是Eclipse的问题吗?
老师 帮我看一下有没有问题


1

0 学习 · 9666 问题

查看课程