找不到元素“xml"的声明 [英] Can not find declaration of element 'xml'

查看:46
本文介绍了找不到元素“xml"的声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到了很多与我的 xml 文件相关的来自 python 的解析错误.我在 stackoverflow 上的其他地方读到我应该先验证 xml 文件.

I'm getting a lot of parsing errors from python related to my xml file. I read elsewhere on stackoverflow that I should validate the xml file first.

我不明白为什么这个 xml 不会验证:

I can't understand why this xml will not validate:

<xml><hive name="myprojectname">

XML 验证器说这个错误:找不到元素xml"的声明.错误位置:

XML validator says this Error: Can not find declaration of element 'xml'. Error Position: <xml><hive name="myprojectname">

推荐答案

这个:

<xml><hive name="myprojectname">

不在 http://www.validome.org/xml/validate/,因为首先您必须在那里选中仅格式良好"选项.

doesn't validate in http://www.validome.org/xml/validate/, because first you have to check "Well-Formedness only" option there.

其次,它必须遵循 XML 规则,http://en.wikipedia.org/wiki/XML#Well-formedness_and_error-handling.所以这应该看起来:

Second, it have to follow XML rules, http://en.wikipedia.org/wiki/XML#Well-formedness_and_error-handling. So this should look:

<xml><hive name="myprojectname"/></xml>

这篇关于找不到元素“xml"的声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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