Hi Liu,

I've developed a generic layer using JXpath on top of a JAXB object tree for
the purpose of generating XML. You can actully get JXPath to work with the
JAXB list implementation by extending JXpath with a ListElementFactory. I've
included the Java source. This is explained in the JXpath docs.

Regards,
Francis

-----Original Message-----
From: yuanliang liu [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 5:34 PM
To: [EMAIL PROTECTED]
Subject: use JAXB generated object in woody binding


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 youre looking for faster
http://search.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Attachment: ModelManagerImpl.java
Description: Binary data

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to