cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yuanliang liu <flyingcolor...@yahoo.com>
Subject use JAXB generated object in woody binding
Date Tue, 02 Mar 2004 16:33:53 GMT
Hi,
  Has anyone have tried using JAXB generated object in
woody binding? I use JAXB to ummarshall xml string to
get a java object and use this java object as a bean
in  woody binding. It can get data from the jaxb
object without problem. But it failed to save the data
back to the jaxb object(the error says:
org.apache.commons.jxpath.JXPathException: Exception
trying to create xpath ). I think it is due to two
reasons:
1. The implementation of a sequence of child elements
is different in JAXB. For example, suppose in your xml
string you have a <course> element, which has a
sequence of <chapter> elements. In jaxb, the Course
object would have a field called ChapterType, then the
ChapterType would have a field which is a list of
Chapter objects. But in woody bean, it would require a
Couse object having a field chapters. The chapters
field itself should be a list of Chapter objects. So
due to this different implementation, jaxb object
cannot work in woody binding.
2. The other problem is that in jaxb object, for a
list, it doesn't have set and add methods. It would
expect you to use get method to get the list and then
use the method provided by the list to manipulate it.
I think this is the other reason.

There might be other reasons that jaxb objects cannot
work in woody binding. Anyone pointing out?

I have tried to extend jaxb object and some other ways
to see if it can work. But it seems a lot of trouble.
So I already gave up using JAXB objects in woody
binding. 

Has anyone done the similar work before? Are u able to
get it work?

Thanks.


__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message