Thanks for your reply. I'm not up on the FieldHandler, DocumentHandler or ContentHandler stuff. I will probably have to parse the Map manually now.
I will try and get up to speed on the other methods. If I have any luck I'll inform the list. Thanks. --- Keith Visco <[EMAIL PROTECTED]> wrote: > > Hi Martyn, > > I don't believe it's possible at this time. You > might be able to work > some magic with writing wrappers or FieldHandlers, > but to use the key > from the map as the name of the element will be > tricky at best. > > One solution would be to marshal the elements as : > > <map-item> > <key>key1</key> > <value>value1</value> > </map-item> > > And then use an XSLT transformation to convert the > map-item element into > your desired output of: > > <key1>value1</key1> > > Another solution would be to marshal as the above > but add your own > DocumentHandler or ContentHandler in-between the > Serializer and the > marshaller so that you can filter the events > yourself. Each time you see > a map-item element you can strip it off and output > your desired result. > > You may also experiment with modifying Castor to > support the > functionality that you need. > > Thanks, > > --Keith > > Martyn Wilson wrote: > > > > Sorry about the last post, I sent it before I had > > completed it. > > > > Anyway, I want to marshal a java.util.HashMap to > XML, > > where the key, value pairs are represented as the > > element, text values. i.e.; > > > > <data> > > <key1>value1</key1> > > <key2>value2</key2> > > <key3>value3</key3> > > </data> > > > > Is this possible? > > > > ===== > > Martyn Wilson > > > > __________________________________________________ > > Do you Yahoo!? > > Yahoo! Web Hosting - Let the expert host your site > > http://webhosting.yahoo.com > > > > > ----------------------------------------------------------- > > If you wish to unsubscribe from this mailing, send > mail to > > [EMAIL PROTECTED] with a subject of: > > unsubscribe castor-dev > > ----------------------------------------------------------- > > If you wish to unsubscribe from this mailing, send > mail to > [EMAIL PROTECTED] with a subject of: > unsubscribe castor-dev > ===== Martyn Wilson __________________________________________________ Do you Yahoo!? Yahoo! Web Hosting - Let the expert host your site http://webhosting.yahoo.com ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
