users@jaxb.java.net

Re: Namespace prefix 'ns2' being added

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Tue, 17 Sep 2013 21:32:08 +0200

A prefix is a rather arbitrary abbreviation for the namespace URI.
Since an XML document defines all of the prefix translations,
it shouldn't matter. The error message you've shown doesn't
appear to be related to this.

Please provide XML schema and Java code for reproducing the
problem.

-W


On 17/09/2013, Akhil Anil <akhil.karun_at_gmail.com> wrote:
> Hi,
>
> I have a java object that needs to be written into an xml file.
>
> *<sdtc:raceCode code="foo" />*
>
> when I try to marshal and write my java object to xml it's showing an error
> that
>
> invalid content in *ns2:raceCode* it should be something else...
>
> I guess the prefix sdtc is not read from the xsd and instead dummy prefix
> ns2 is added which is obiviously not valid. What should I add to fix this
> problem and make it fetch the 'sdtc' prefix. I've already added the prefix
> entry in packages-info.java and the Qname is also defined.
>
>
>
> --
>
> Thanks and regards....
>
> May God Bless us!
>
> *AkH!L.*
>
> *http://akhilspassion.blogspot.com*
>