[ http://jira.codehaus.org/browse/JIBX-64?page=all ]
     
Dennis Sosnoski resolved JIBX-64:
---------------------------------

     Assign To: Dennis Sosnoski
    Resolution: Cannot Reproduce

I've added a test case for the actual error part of this (Namespace Index 
Incorrect for custom marshallers) and haven't been able to reproduce the 
problem. The test case is in CVS as build/test/extras/binding9.xml, so you can 
try it for yourself.

The need for a global namespace declaration is somewhat awkward, but is the 
intended behavior. I'll look at a cleaner approach for 2.0.

> Namespace Index Incorrect for custom marshallers
> ------------------------------------------------
>
>          Key: JIBX-64
>          URL: http://jira.codehaus.org/browse/JIBX-64
>      Project: JiBX
>         Type: Bug
>   Components: core
>     Versions: CVS
>     Reporter: Chris Chen
>     Assignee: Dennis Sosnoski
>     Priority: Minor

>
>
> When a binding file contains custom marshaller and unmarshaller for a 
> particular mapping in a specific namespace, the following is required:
> 1) The namespace must be declared globally, because
> 2) mappings with custom (un)marshallers cannot have child elements.
> When the binding file contains mappings with these custom (un)marshallers, 
> the generated code passes an index of 0 to the custom marshalling class's 
> constructor.
> Interestingly, if the mapping with the custom (un)marshallers is referenced 
> in other mappings that do not use custom (un)marshallers, then the proper 
> index for the namespace will be passed.
> For instance,
> <binding>
>   <namespace uri="ns:a" default="elements"/>
>   <mapping name="a" class="AClass" unmarshaller="AMapper" 
> marshaller="AMapper" ns="ns:a"/>
> </binding>
> The generated code for the above binding file should pass index 2 to 
> AMapper's constructor.  However, it does not.
> In the following binding file,
> <binding>
>   <namespace uri="ns:a" default="elements"/>
>   <mapping name="a" class="AClass" unmarshaller="AMapper" 
> marshaller="AMapper" ns="ns:a"/>
>   <mapping name="b" class="BClass">
>     <structure field="a" usage="optional"/>
>   </mapping>
> </binding>
> When the custom mapping (a) is referenced in another mapping, then this will 
> produce the proper code.  The generated class will pass an index of 2 to 
> AClass' constructor.
> I am not entirely sure if this is the intended behavior.  If not, then this 
> issue can be closed.
> Thanks,
> Chris

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs

Reply via email to