我正在开发一个从 xml 文件中读取一些数据的 Java 应用程序。尝试执行,我收到此错误:
org.xml.sax.SAXParseException; systemId: 文件:/c:/myxmlfile.xml; 行号:7;列数:55;s4s-elt-character:除了“xs:appinfo”和“xs:documentation”之外的架构元素中不允许使用非空白字符。看到“我的名字价值”。
我的 xml 文件开头为:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<gdl_set xmlns="http://www.mywebsite.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.mywebsite.com/myxsddefinition.xsd"
shortname="Shortname">
<name>My Name Value</name>
Run Code Online (Sandbox Code Playgroud)
你能帮我理解问题出在哪里吗?
小智 5
是的,我也遇到了同样的问题,然后我发现我将 XSD 文件作为 XML 文件的输入传递。
像那样 -
String xsdPath= "122015/1224/sample.xml";
String **xmlPath** = "122015/1224/sample.xsd";
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
14244 次 |
| 最近记录: |