From user-return-10494-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Fri May 14 08:51:47 2010 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 88946 invoked from network); 14 May 2010 08:51:46 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 14 May 2010 08:51:46 -0000 Received: (qmail 21257 invoked by uid 500); 14 May 2010 08:51:45 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 20945 invoked by uid 500); 14 May 2010 08:51:44 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 20937 invoked by uid 99); 14 May 2010 08:51:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 May 2010 08:51:44 +0000 X-ASF-Spam-Status: No, hits=-1.2 required=10.0 tests=AWL,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [209.85.221.180] (HELO mail-qy0-f180.google.com) (209.85.221.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 May 2010 08:51:39 +0000 Received: by qyk10 with SMTP id 10so2806074qyk.11 for ; Fri, 14 May 2010 01:51:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.95.137 with SMTP id d9mr277610qcn.125.1273827076019; Fri, 14 May 2010 01:51:16 -0700 (PDT) Received: by 10.229.74.18 with HTTP; Fri, 14 May 2010 01:51:15 -0700 (PDT) Date: Fri, 14 May 2010 10:51:15 +0200 Message-ID: Subject: _update, XML, and POST From: Cory Zue To: user Content-Type: text/plain; charset=ISO-8859-1 Hi folks, I am prototyping an app to receive an XML POST and convert the data to a couch object. Based on what I've read so far it seems like the _update method is designed to let you do exactly this. However, I have some questions (note that I haven't tried any of this yet, am just basing my information off documentation on-line. >From here: http://wiki.apache.org/couchdb/Document_Update_Handlers I understand that "To invoke a handler, one must "PUT" the document against the handler function itself (POST does not seem to be supported)." Was there any reasoning behind this decision or was it just a feature that never made it? Not allowing these things to run on POSTs seems to drastically reduce their utility for no reason that's obvious to me. Second, is there a community recommended XML to JSON library to perform the data transfer? I've been evaluating several (listed below), none of which seem to be highly active, recent, or well established. Anyone done this before and want to make a recommendation? I'm surprised that there's not a de-facto choice for this. http://www.thomasfrank.se/xml_to_json.html http://goessner.net/download/prj/jsonxml/ http://www.codeproject.com/KB/scripting/XmlToJson.aspx http://michael.hinnerup.net/blog/2008/01/26/converting-json-to-xml-and-xml-to-json/ thanks, Cory