cvc-elt.1: Cannot find the declaration of element 'MyElement'
来源:互联网 发布:华为数据分析师招聘 编辑:程序博客网 时间:2024/06/06 03:30
在制作xml的根节点出现的问题:提示cvc-elt.1: Cannot find the declaration of element 'MyElement' 源码如下:
XML File
<?xml version="1.0" encoding="utf-8"?> <MyElement>A</MyElement>
XSD File
<?xml version="1.0" encoding="UTF-8"?><schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/Test" xmlns:tns="http://www.example.org/Test" elementFormDefault="qualified"> <simpleType name="MyType"> <restriction base="string"></restriction> </simpleType> <element name="MyElement" type="tns:MyType"></element></schema>
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:simpleType name="MyType"> <xs:restriction base="xs:string"></xs:restriction> </xs:simpleType> <xs:element name="MyElement" type="MyType"></xs:element> </xs:schema>
解决方法:需要指定根目录的命名空间,如下
<MyElement xmlns="http://www.example.org/Test">A</MyElement>
0 0
- cvc-elt.1: Cannot find the declaration of element 'MyElement'
- cvc-elt.1: Cannot find the declaration of element 'ehcache'.
- cvc-elt.1: Cannot find the declaration of element 'beans'.
- cvc-elt.1: Cannot find the declaration of element 'beans'.
- cvc-elt.1: Cannot find the declaration of element 'beans'
- Spring启动异常: cvc-elt.1: Cannot find the declaration of element 'beans'
- Spring cvc-elt.1: Cannot find the declaration of element 'beans'.
- Spring启动异常: cvc-elt.1: Cannot find the declaration of element 'beans'
- org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'taglib'. 异常
- org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
- Spring 配置文件报错: cvc-elt.1: Cannot find the declaration of element ""beans""
- Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
- spring cvc-elt.1: Cannot find the declaration of element 'beans'
- Spring启动异常: cvc-elt.1: Cannot find the declaration of element 'beans'
- cvc-elt.1: Cannot find the declaration of element 'taglib'的解决方法
- Spring启动异常: cvc-elt.1: Cannot find the declaration of element 'beans'
- spring cvc-elt.1: Cannot find the declaration of element 'beans'解决办法
- Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
- linux下杀死进程(kill)的N种方法
- Android中为什么主线程不会因为Looper.loop()里的死循环卡死?
- 图片64编码和解码
- shell的一些符号
- 游戏 相关工作
- cvc-elt.1: Cannot find the declaration of element 'MyElement'
- BootStrap 警告框
- JAVA ResourceBundle 加载外部路径资源文件方式
- tesseract-ocr 第四课 如何训练新语言
- React Native
- LINUX 使用tcgetattr与tcsetattr函数控制终端
- Cocos2dx学习笔记(二)、点击事件
- Tapestry5.4的layout组件引入JavaScript
- Android Studio与eclipse的区别