Java 架构验证 - s4s-elt-character:除“xs:appinfo”和“xs:documentation”之外的架构元素中不允许使用非空白字符
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24695103/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Schema Validation - s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'
提问by TheCoder
I have a schema and sample XML. The xml is failing schema validation with the following error message. Can any one tell me why? I have checked the sample xml and do not see any 'e="ac'.
我有一个架构和示例 XML。xml 架构验证失败,并显示以下错误消息。谁能告诉我为什么?我检查了示例 xml,没有看到任何“e =“ac”。
EDIT: I meant to say I checked the Types.xsd and I don't see the issue.
编辑:我的意思是说我检查了 Types.xsd 并且我没有看到问题。
org.xml.sax.SAXParseException; systemId: file:/src/main/resources/schemas/Types.xsd; lineNumber: 1300; columnNumber: 6; s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw 'e="ac'.
org.xml.sax.SAXParseException; systemId:文件:/src/main/resources/schemas/Types.xsd;行号:1300;列数:6;s4s-elt-character:除了“xs:appinfo”和“xs:documentation”之外的架构元素中不允许使用非空白字符。看到 'e="ac'。
采纳答案by TheCoder
I replaced
我换了
?xml version="1.1" encoding="UTF-8"?
?xml 版本=“1.1”编码=“UTF-8”?
with
和
?xml version="1.0" encoding="UTF-8"?
?xml 版本=“1.0”编码=“UTF-8”?
and it worked.
它奏效了。