cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Menard <>
Subject Re: XML Encoder in Apache
Date Fri, 14 Dec 2007 01:42:49 GMT
Hi Todd,

I'm taking this back to the list.

You seem to have been the victim of out of date documentation.  I was
initially writing the documentation as the XML serialization feature was
being developed.  The API evolved and unfortunately I didn't stay on top of
the docs.

I've now updated them based on the API and that should be enough to get you
going.  Apologies for the mishap.

Anything you can offer to improve the docs would be appreciated.  I can
usually be prodded into it, but unfortunately I tend to focus my efforts to
whatever I need at the current moment.


On 12/12/07 7:14 AM, "Ted Moens" <> wrote:

> Hi Kevin:
> I hope it is ok to contact you directly - it is with respect to a
> document you recently updated -
> XML Encoding - Apache Cayenne - Apache Software Foundation
> Under "Provide a Mapping File" you have the following code:
> public static void main(final String args[])
> {
>      final XMLEncoder encoder = new XMLEncoder();
>      final Person person = new Person("Bob", 27);
>      final String xml = encoder.encode(person,
> "/some/path/to/mapping/file");
>      // These will print out the same content.  encode() returns the XML
>      // as a matter of convenience.
>      System.out.println(xml);
>      System.out.println(encoder.getXml());
> }
> I'm using 3.0M2 on Vista.  My reading of the API shows that I have to
> specify the mapping file as a URL in the constructor of the XMLEncoder
> rather than as a file path the encode method as per your example.  Am I
> missing something?
> Also, you refer to a couple of static methods in XMLEncoder for encoding
> and decoding lists.  I'm having trouble tracking them down - is this
> just a version issue for me?
> Finally, I have not done much of this before, but I could add a couple
> of examples and possibly an .xsd file to the XML Mapping File page if
> you like....
> XML Mapping File - Apache Cayenne - Apache Software Foundation
> Ted Moens

View raw message