我在XML文件中收到错误
问题描述:
生成XML。一个人将有家属,家属可以是配偶和子女,也可以是配偶。一个人可以有一个以上的孩子。
我尝试过:
<?xml version =1.0encoding =UTF-8?>
<!DOCTYPE person SYSTEMperson.dtd>
< person>
< name> priya
< age> 22
旁遮普地址>
< dependents>
< spouse>
< sname> sam
< sage> 22 >
< children>
< child>
< cname> rtrtt
< cgender> f
< cage> 16
Generate XML .A person will have dependents and the dependents can be spouse and children or only spouse. A person can have more than 1 child.
What I have tried:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE person SYSTEM "person.dtd">
<person>
<name>priya
<age>22
<dependents>
<spouse>
<sname>sam
<sage>22
<children>
<child>
<cname>rtrtt
<cgender>f
<cage>16
答
您没有关闭您的参赛作品。请参阅 XML教程 [ ^ ]。
You are not closing your entries. See XML Tutorial[^].
XML标签必须有开始和结束标签
XML tags must have opening and closing tags
<person>
<name>priya</name>
<age>22</age>
.
.
.
</person>
这里 person
是必须唯一的根标记。
所有其他标签都可以重复。
Here person
is the root tag that has to be unique.
All other tags can be repeated.