users@jaxb.java.net

Re: While parsing with JAXB, sub branch is coming null

From: olamalam <ilker.cikrikcili_at_aspone.co.uk>
Date: Tue, 9 Nov 2010 02:00:02 -0800 (PST)

Hello Wolfgang,
Thanks for your reply.

I'm developing an integration system and the xml file is what we receive
from our client. Yes, when I remove xmlns=",,,commands" manually, commands
object is started to be filled however the inner object (iodata) is coming
null now. So I guess I need to remove all xmlns fields whenever I receive a
message from client programmatically but it is not a very pleasant solution.

I generated the xsd file by liquid xml studio. When I use some other tools,
xmlns:q1="..." fields aren't created. However I'm having the same problem
even if I'm using the new xsd file, command is coming null. The new xsd file
is attached. In xmlbeans forum they suggested me to set targetnamespace to
the xsd file. But when I set a targetnamespace manually, I' getting
validation errors.

Do you thing that entering targetnamespace also solves the problem? What
should I set there?

Thanks again
ilker


Wolfgang Laun-2 wrote:
>
> Please remove the xmlns=",,,commands" from the <command> element and try
> unmarshalling. If I haven't missed something, this will bring the element
> into the correct (according to the XML schema) namespace.
>
> In the schema, there is indeed
> xmlns:q1="http://jabber.org/protocol/commands",
> but the prefix q1 isn't used anywhere, so this is just dead freight.
>
> -W
>
>
> <command xmlns="http://jabber.org/protocol/commands"
>
>
> On 8 November 2010 17:31, olamalam <ilker.cikrikcili_at_aspone.co.uk> wrote:
>
>>
>> Hi to all,
>>
>> Actually, I'm not new to JAXB :) however I've faced with a problem for
>> the
>> first time and couldn't solve it.
>>
>> I"m using Java 1.6.0_18 and the xml file I'm trying to parse and it's
>> schema
>> are attached. I created the class files by using "xjc" command properly
>> but
>> when I parse the file, the first tag is returned with correct values at
>> "id", "to", "from" and "type" fields but "command" object returns null. I
>> also tried parsing it with xmlBeans but I got the same problem there too.
>> (I'm going to ask the same question to xmlBeans forum)
>>
>> Can you see what I'm missing?
>>
>> http://old.nabble.com/file/p30162263/getProfile.xml getProfile.xml
>> http://old.nabble.com/file/p30162263/getProfile.xsd getProfile.xsd
>> --
>> View this message in context:
>> http://old.nabble.com/While-parsing-with-JAXB%2C-sub-branch-is-coming-null-tp30162263p30162263.html
>> Sent from the java.net - jaxb users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>>
>>
>
>
http://old.nabble.com/file/p30169307/getprofile.xsd getprofile.xsd
-- 
View this message in context: http://old.nabble.com/While-parsing-with-JAXB%2C-sub-branch-is-coming-null-tp30162263p30169307.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.