views:

116

answers:

2

This is the first time I've ever tried to use JAXB for anything at all and I'm running into a problem.

I'm trying to use JAXB's XJC tool to convert an XSD file into Java class files when I get this error:

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.

Line 10 in the schema file reads:

<xs:simpleContent msdata:ColumnName="paramText" msdata:Ordinal="1">

and you can see the whole thing here.

edit: It turns out the XSD file was missing the namespace declaration for msdata. Simply adding xmlns:msdata="http://schemas.microsoft.com/2003/07/msdata.xsd" fixed the problem.

+1  A: 

You need to have the msdata namespace prefix mapped. Like

<xs:schema targetNamespace="http://maps.trimet.org/maps/model/xml" 
    xmlns="http://maps.trimet.org/maps/model/xml"
    ....
    xmlns:msdata="http://yournamespace.com/foo"&gt;
Bozho
Thanks, I figured this out about the same time you answered, but you were right, so... ACCEPTED!
fiXedd
A: 

moved to question

fiXedd
Not sure why this was moved to the question as it was the answer, but... whatever.
fiXedd