On 12/5/06, Elias Torres <[EMAIL PROTECTED]> wrote:
Dan Diephouse wrote: > Hi Elias, > > Please, I think I am the naive one around here as I'm just getting my feet > wet with Atom and Abdera. :-) > > Agreed that JSON and XML are not so easily mapped to each other. The > xml:base/id/lang stuff slipped my mind as a potential issue. It seems that > all the xml:base handling is in the FOM* classes right? So the JSON support > always outputs the full IRIs? That's my intent at least although the code hasn't been thoroughly tested. I think we are calling getHref() instead of getResolvedHref(). But anyways, that's the kinds of things we can do in a custom writer as opposed to one that reads it from XML. However, it's still unresolved how to map 80% of the most commonly used Atom elements into JSON without making it too complicated (e.g. doing string checks for '@' or maintaining $-namespaces) for the end-user.
Personally I hate the $ namespaces. Jettison does require an @ for attributes, so that is another limitation of it. (I could allow users to override this, which might be a nice feature, but I don't know that it makes any difference for this case)
> And yes, it would not be that hard for a user to use Jettison with the > current APIs. I was just wondering if it made sense to use it instead of a > custom mapping. If no, thats OK, thats just one of the things I'm trying to > figure out. I guess we could have "multiple" JSONWriters, but I'm not sure we are needing that just yet. I think that as we get more users, we'll be able to work out a good representation and stick with it. Maybe it's one of the automagic ones, maybe it's a custom one.
I wonder if there will ever be a standard Atom-JSON mapping... I'm starting to see how a custom one makes sense in this case, so I'd probably say stick with custom and people can use Jettison if they need it. Putting Jettison in by default sounds like a square peg for a round hole. - Dan -- Dan Diephouse Envoi Solutions http://envoisolutions.com | http://netzooid.com/blog