[Simple-support] using mapping files with Simple XML
Brought to you by:
niallg
|
From: Alexey S. <al...@gm...> - 2011-02-18 00:13:47
|
Hi! I'm working on a Java API for Redmine's REST service (www.redmine.org). One of the users has recently submitted a bug that my API does not work under Android OS: https://code.google.com/p/redmine-java-api/issues/detail?id=17 I'm using Castor XML now, but unfortunately it does not work under Android so I'm looking for some other solution... I'd like to give SimpleXML a try, but don't want to add SimpleXML-specific annotations to my objects. moreover having annotations is not flexible - unfortunately, objects can be provided by the server in different xml formats depending on how exactly I requested them. so, in one case "user name" can be stored in "name" attribute, and in another XML response from the REST service the same "user name" can be provided in "login" attribute. the way I deal with this in Castor XML is I use different XML mapping files for different requests/responses. e.g. one XML mapping file for getting "users list" and and another mapping for getting "project and its user/owner info". any advice? -- Alex |