我在编译时遇到错误。我得到的错误是异常:cvc-elt.1.a:找不到元素'employees'的声明。假。如何获取此代码的输出? [英] I got error while compiling. The error I got as exception: cvc-elt.1.a: cannot find the declaration of element 'employees'. False. How can I get the output for this code?

查看:223
本文介绍了我在编译时遇到错误。我得到的错误是异常:cvc-elt.1.a:找不到元素'employees'的声明。假。如何获取此代码的输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为下表创建格式良好的文档



Deptid Dname Empid名称工资邮箱phoneno

1销售1001 Tom 20000 tom @ gmail.com 9874563210

1002 Sam 25000 sam@gmail.com

1003 Shiny 20000 9876543210

2 Admin 1006 Ram 15000 ram @ gmail。 com 9873214560

1007 Gupta 17000 9632587410



我尝试过:



<?xml version =1.0encoding =utf-8?>



< employees xmlns:dept = http://www.lms.com/department\">







< employee> ;

< deptid> 1

< dname> Sal es

< empid> 1001

< name> Tom

< salary> 20000

<电子邮件> tom@gmail.com

< phoneno> 9874563210



< employee>

< deptid>

< dname>

< empid> 1002

< name> Sam

< salary> 25000

< email> sam@gmail.com

< phoneno>



< employee>

< deptid>

< dname>

< empid> 1003

< name> Shiny

< salary> 20000

< email>

< phoneno> ; 9876543210







< employee>

< deptid> 2

< dname> Admin



< empid> 1006

< name> Ram

< salary> 15000

< email> ram@gmail.com

< phoneno> ; 9873214560



< employee>

< deptid>

< dname>

< empid> 1007

< name> Gupta

< salary> 17000

< email> ;

< phoneno> 9632587410

解决方案

您的文档格式不正确,因为它不包含任何结束标记。



您必须添加

 <   / employees  >  

最后也是所有其他元素的结束标记。


请参阅 https:// www .quora.com / I-AM-新到XML-如何-可以-I-化妆这个表上的XML

Create a well-formed document for the following table

Deptid Dname Empid Name salary email phoneno
1 Sales 1001 Tom 20000 tom@gmail.com 9874563210
1002 Sam 25000 sam@gmail.com
1003 Shiny 20000 9876543210
2 Admin 1006 Ram 15000 ram@gmail.com 9873214560
1007 Gupta 17000 9632587410

What I have tried:

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

<employees xmlns:dept="http://www.lms.com/department">



<employee>
<deptid>1
<dname>Sales
<empid>1001
<name>Tom
<salary>20000
<email>tom@gmail.com
<phoneno>9874563210

<employee>
<deptid>""
<dname>""
<empid>1002
<name>Sam
<salary>25000
<email>sam@gmail.com
<phoneno>""

<employee>
<deptid>""
<dname>""
<empid>1003
<name>Shiny
<salary>20000
<email>""
<phoneno>9876543210



<employee>
<deptid>2
<dname>Admin

<empid>1006
<name>Ram
<salary>15000
<email>ram@gmail.com
<phoneno>9873214560

<employee>
<deptid>""
<dname>""
<empid>1007
<name>Gupta
<salary>17000
<email>""
<phoneno>9632587410

解决方案

Your document is not well-formed because it does not contain any end-tags.

You have to add

</employees>

at the end and also the end-tags for all other elements.


Refer here https://www.quora.com/I-am-new-to-XML-How-can-I-make-this-table-on-XML


这篇关于我在编译时遇到错误。我得到的错误是异常:cvc-elt.1.a:找不到元素'employees'的声明。假。如何获取此代码的输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆