【发布时间】:2009-12-21 05:06:34
【问题描述】:
这是我第一次尝试将 JAXB 用于任何事情,但我遇到了问题。
当我收到此错误时,我正在尝试使用 JAXB 的 XJC 工具将 XSD 文件转换为 Java 类文件:
parsing a schema...
[ERROR] The prefix "msdata" for attribute "msdata:ColumnName" associated with an element type "xs:simpleContent" is not bound.
line 10 of file:/home/jeremy/TypeDefs.xsd
Failed to parse a schema.
架构文件中的第 10 行内容如下:
<xs:simpleContent msdata:ColumnName="paramText" msdata:Ordinal="1">
你可以看到整个事情here。
编辑:原来 XSD 文件缺少 msdata 的命名空间声明。只需添加 xmlns:msdata="http://schemas.microsoft.com/2003/07/msdata.xsd" 即可解决问题。
【问题讨论】: