You need to specify default="elements" to have this used as the default namespace (which appears to be what you want). The documentation says "prefix - This is the prefix to map to the namespace when marshalling. It is ignored when unmarshalling, since the namespace URI is used directly to identify elements and attributes. This attribute is required for namespaces in an output binding unless default="elements" is specified.", but the code doesn't currently check for this case (which is why you don't get an error on the binding).

- Dennis

Linus Kamb wrote:

I've been spending some time trying to figure out why I was getting a "No unmarshaller for element ..." exception, when everything seemed to be ok. Mapping was ok, marshalling was ok, but unmarshalling failed, even for the simplest of classes.

So, it turns out it doesn't like my binding-level namespace declaration.

A very simple example:


This works:


<binding>
        <!-- namespace commented out.
        <namespace uri="http://www.iris.edu/jibtest"; />
        -->
        <mapping name="JibTest" class="edu.iris.dmc.JibTest" >
                <value name="Str1" field="str1" style="attribute" />
                <value name="Str2" field="str2" style="attribute" />
        </mapping>
</binding>

Adding the namespace back in doesn't.

[java] org.jibx.runtime.JiBXException: No unmarshaller for element "{http://www.iris.edu/jibtest}JibTest"; (line 4, col 25)
[java] at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2565)


(Of course, the xml data file had the namespace added or removed, depending on the test.)

Any thoughts? What am I doing wrong?

I'm using Beta3a. Beta3b doesn't like my <structure ... using="..." /> element for some reason, but that is another issue.





-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
jibx-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to