You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Cristiane Foga�a <cr...@yahoo.com> on 2005/08/19 16:25:24 UTC

Betwixt - convert XML to a bean Collection

Hi,

Does anybody know how to convert an XML to a
Collection of beans?

Here is the XML that I have:

<ProjectReviews>
  <ProjectReviewStatus>
    <comments>new status with date</comments>
    <createdBy>Cristiane</createdBy>
    <createdOn>2005-08-18 13:32:17.562</createdOn>
    <projectStatus>In Process</projectStatus>
  </ProjectReviewStatus>
  <ProjectReviewStatus>
    <comments>another comment</comments>
    <createdBy>Cristiane II</createdBy>
    <createdOn>2005-08-18 13:32:17.562</createdOn>
    <projectStatus>In Process</projectStatus>
  </ProjectReviewStatus>
</ProjectReviews>


I'm trying to do something like this:
beanReader.registerBeanClass("ProjectReviews",
ArrayList.class);
ArrayList reviews =
(ArrayList)beanReader.parse(xmlReader);

Anything is returned and no error is throw. What is
wrong with this code?

Thanks for any help.
Cristiane



		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Betwixt - convert XML back to bean

Posted by Cristiane Foga�a <cr...@yahoo.com>.
Hi,

I have this XML generated by betwixt, and now I wanna
to convert back to the bean structure.

I'm not receiving any error, but the comments (List
attribute of ProjectReviewDeliverable object) and
deliverableItems (List attribute of DeliverableItemDTO
object) are null.

Does anybody know why?

Please, any help would be appreciate!!!


Here is the XML file:

<?xml version='1.0' ?>
<ProjectReviews>
  <ProjectReviewDeliverableRow>
   <comments>
    <ProjectReviewDeliverable>
     <attachmentId>3303</attachmentId>
     <comments>new comment , red cell</comments>
     <createdBy>Cristiane</createdBy>
     <createdOn>2005-08-15 16:31:00.746</createdOn>
     <projectReviewId>0</projectReviewId>
     <status>false</status>
   </ProjectReviewDeliverable>
  <ProjectReviewDeliverable>
     <attachmentId>3303</attachmentId>
     <comments>deliverable comment</comments>
     <createdBy>Cristiane</createdBy>
     <createdOn>2005-08-12 17:26:22.062001</createdOn>
     <projectReviewId>0</projectReviewId>
     <status>false</status>
  </ProjectReviewDeliverable>
 </comments>
 <deliverableItems>
  <DeliverableItemDTO>
    <dtPosted>Fri Oct 01 </dtPosted>
    <type>A</type>
  </DeliverableItemDTO>
 </deliverableItems>
 <deliverableName>Architecture</deliverableName>
 <gridId>3303</gridId>
 <issueFound>false</issueFound>
 </ProjectReviewDeliverableRow>
</ProjectReviews>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: Betwixt - convert XML to a bean Collection

Posted by Cristiane Foga�a <cr...@yahoo.com>.
Hi Robert, I'm using the latest 0.7 version.

Where should I get the version that fix this bug?

Can you send me the URL?

Thanks,
Cristiane

--- robert burrell donkin
<ro...@blueyonder.co.uk> wrote:

> i think that this is caused by a bug which has now
> been fixed. could you
> try again using either the code from HEAD or a
> recent nightly?
> 
> - robert
> 
> On Fri, 2005-08-19 at 07:25 -0700, Cristiane Fogaça
> wrote:
> > Hi,
> > 
> > Does anybody know how to convert an XML to a
> > Collection of beans?
> > 
> > Here is the XML that I have:
> > 
> > <ProjectReviews>
> >   <ProjectReviewStatus>
> >     <comments>new status with date</comments>
> >     <createdBy>Cristiane</createdBy>
> >     <createdOn>2005-08-18 13:32:17.562</createdOn>
> >     <projectStatus>In Process</projectStatus>
> >   </ProjectReviewStatus>
> >   <ProjectReviewStatus>
> >     <comments>another comment</comments>
> >     <createdBy>Cristiane II</createdBy>
> >     <createdOn>2005-08-18 13:32:17.562</createdOn>
> >     <projectStatus>In Process</projectStatus>
> >   </ProjectReviewStatus>
> > </ProjectReviews>
> > 
> > 
> > I'm trying to do something like this:
> > beanReader.registerBeanClass("ProjectReviews",
> > ArrayList.class);
> > ArrayList reviews =
> > (ArrayList)beanReader.parse(xmlReader);
> > 
> > Anything is returned and no error is throw. What
> is
> > wrong with this code?
> > 
> > Thanks for any help.
> > Cristiane
> > 
> > 
> > 
> > 		
> >
> ____________________________________________________
> > Start your day with Yahoo! - make it your home
> page 
> > http://www.yahoo.com/r/hs 
> > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> commons-user-help@jakarta.apache.org
> > 
> > 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> commons-user-help@jakarta.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: Betwixt - convert XML to a bean Collection

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
i think that this is caused by a bug which has now been fixed. could you
try again using either the code from HEAD or a recent nightly?

- robert

On Fri, 2005-08-19 at 07:25 -0700, Cristiane Fogaça wrote:
> Hi,
> 
> Does anybody know how to convert an XML to a
> Collection of beans?
> 
> Here is the XML that I have:
> 
> <ProjectReviews>
>   <ProjectReviewStatus>
>     <comments>new status with date</comments>
>     <createdBy>Cristiane</createdBy>
>     <createdOn>2005-08-18 13:32:17.562</createdOn>
>     <projectStatus>In Process</projectStatus>
>   </ProjectReviewStatus>
>   <ProjectReviewStatus>
>     <comments>another comment</comments>
>     <createdBy>Cristiane II</createdBy>
>     <createdOn>2005-08-18 13:32:17.562</createdOn>
>     <projectStatus>In Process</projectStatus>
>   </ProjectReviewStatus>
> </ProjectReviews>
> 
> 
> I'm trying to do something like this:
> beanReader.registerBeanClass("ProjectReviews",
> ArrayList.class);
> ArrayList reviews =
> (ArrayList)beanReader.parse(xmlReader);
> 
> Anything is returned and no error is throw. What is
> wrong with this code?
> 
> Thanks for any help.
> Cristiane
> 
> 
> 
> 		
> ____________________________________________________
> Start your day with Yahoo! - make it your home page 
> http://www.yahoo.com/r/hs 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org