users@jaxb.java.net

Re: Stripped off elements

From: Muhamad Nazir Samsudin <nazed_at_hotmail.com>
Date: Mon, 07 Aug 2006 09:33:18 +0800

Hi,

Thanks for the feedback, Ed.

I just reprhase the question. I have an xml example which conform to a
schema like this:
<library>
<book>
<nonfiction>
<isbn>1234567</isbn>
<title>Intro to Java</title>
<pages>345</pages>
<author>JW Arthur</author>
<nonfiction>
<book>
</library>

Whenever I put an extra element (non-valid based on the schema),

<library>
<mytest>test1</mytest>
<book>
<nonfiction>
<isbn>1234567</isbn>
<title>Intro to Java</title>
<pages>345</pages>
<author>JW Arthur</author><mytest>test2<mytest>
<nonfiction>
<book>
</library>

I only get the first (test1) non-valid element, but I couldn't get the
second (test2) element whenever I marshall it back to XML. Just a curiosity,
why is this happening?

Thanks
~nazir~

----Original Message Follows----
From: Ed Mooney <Ed.Mooney_at_Sun.COM>
Reply-To: users_at_jaxb.dev.java.net
To: users_at_jaxb.dev.java.net
Subject: Re: Stripped off elements
Date: Thu, 03 Aug 2006 12:26:57 -0400

Hi Nazir,

If you can turn your instance into an XML infoset, you can use Binder to
create a JAXB view. Check out


https://jaxb.dev.java.net/nonav/jaxb20-pfd/api/javax/xml/bind/Binder.html

and the updateablePartialBind sample.

Regards,
--
Ed Mooney         |Sun Microsystems, Inc.|Time flies like
Java Web Services |UBUR02-201            |an arrow, but
Ed.Mooney_at_Sun.COM |1 Network Drive       |fruit flies like
781-442-0459      |Burlington, MA  01803 |a banana. Groucho
Muhamad Nazir Samsudin wrote:
>Hi,
>
>I have a problem where some of the elements somehow were stripped off to 
>accomodate what the schema said. Somehow, when we unmarshall (without 
>putting a schema or without schema validation), the JAXB just stripped off 
>the unwanted elements based on the schema. May I know whether we still can 
>keep the elements (to be checked against another schema) which are beneath 
>of the root element? If yes, how can we do it? If No, what are the tasks 
>that I need to do to make this work.
>
>Thanks
>~nazir~
>
>_________________________________________________________________
>Get your mobile ringtones, operator logos and picture messages from MSN 
>Mobile http://msn.smsfactory.no/
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net
_________________________________________________________________
Find just what you are after with the more precise, more powerful new MSN 
Search. http://search.msn.com.my/ Try it now.