Piriti: POJO --> XML

30 views
Skip to first unread message

Jonatan Mayorano

unread,
Mar 15, 2012, 11:18:38 AM3/15/12
to Piriti
I'm new user to your Piriti Parser and I have some doubts.
I haven't problem with parse XML to POJO. That work ok, but when I
want parse POJO to XML, problems begin.
In the first place, I want parse the atribute isbn and reviews in the
follow code:

public class Book
{
interface BookReader extends XmlReader<Book> {}
public static final BookReader XML = GWT.create(BookReader.class);

public interface BookWriter extends XmlWriter<Book> {}
public static final BookWriter WRITER =
GWT.create(BookWriter.class);


@Path("@isbn") String isbn;
@Path("reviews/review") List<String> reviews;
}
--------------------------------------------------
I hope the following result:
<book isbn="978-0345417954">
<reviews>
.
.
</reviews>
</book>

but the result is:
<book>
<reviews/review>
.
.
</reviews/review>
</book>

ISBN is lost and the tags reviews and review too

I want to know if I'm doing something wrong and the right way to do
this.

Many thanks

Harald Pehl

unread,
Mar 15, 2012, 11:24:03 AM3/15/12
to pir...@googlegroups.com
Your code looks ok. I will check this and let you know what I found out...

- Harald

Jonatan Mayorano

unread,
Mar 15, 2012, 11:52:27 AM3/15/12
to pir...@googlegroups.com
ok!!! thanks!!!

2012/3/15 Harald Pehl <haral...@googlemail.com>

Harald Pehl

unread,
Mar 16, 2012, 5:47:26 AM3/16/12
to pir...@googlegroups.com
Could you check which version of Velocity you're using.  Please make sure you have the right version of Velocity. You need version 1.7. See also  http://code.google.com/p/piriti/issues/detail?id=55 

- Harald


Am Donnerstag, 15. März 2012 16:52:27 UTC+1 schrieb Jonatan Mayorano:
ok!!! thanks!!!

2012/3/15 Harald Pehl
Your code looks ok. I will check this and let you know what I found out...
Reply all
Reply to author
Forward
0 new messages