0
這是我第一次嘗試將JAXB用於任何事情,而且我遇到了問題。使用JAXB將XSD轉換爲其類時發生錯誤
我試圖使用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"
即可解決問題。
謝謝,我想出了你在同一時間回答,但你是對的,所以......接受! – 2009-12-20 21:56:37