Java Mailing List Archive

http://www.junlu.com/

Home » user.castor »

Re: [castor-user] Namespace during unmarshal

Werner Guttmann

2010-02-13

Replies: Find Java Web Hosting

Author LoginPost Reply
Hi,

that is a question that is not really easy to reply to. Please read
inline for more comments.

Cheers
Werner

On 13.02.2010 16:47, Sam-1234 wrote:
>
> Hi-
> I am facing issue during unmarshalling if the namespaces declared are not
> used in the xml.
> here is my sample xml
> <ns3:response xmlns:ns1="www.aaa.com/ns1"
>  xmlns:ns2="www.test.com/ns2"
>  xmlns:ns3="www.testing.com/ns3">
>   <ns3:Res>
>     <A1>
>  <B1>
>  <node1>A</node1>
>  <node2>B</node2>
>       </B1>
>   </A1>
> </ns3:Res>

As you do not have a default namespace declaration, I do not think that
this document is valid XML at all. For example, element <A1> is not
bound to any namespace and the document does not define a default
namespace via xmlns="....".

> If I remove ns2,ns1 and do unmarshal,it works fine.I understand if namespace
> are used they wil
> be part of the document and castor may use it.Is there any way to avoid
> unused namespaces during unmarshalling?
I'd like to see a test case attached to a new Jira issue, to be able to
replay this. Can you please create a new Jira issue at

http://jira.codehaus.org/browse/CASTOR

and attach all relevant classes (POJOs, mapping file, ....).

>
> Thanks,
> Sam

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


©2008 junlu.com - Jax Systems, LLC, U.S.A.