From user-return-11281-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Mon Jul 05 15:52:23 2010 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 78592 invoked from network); 5 Jul 2010 15:52:23 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 5 Jul 2010 15:52:23 -0000 Received: (qmail 99895 invoked by uid 500); 5 Jul 2010 15:52:22 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 99837 invoked by uid 500); 5 Jul 2010 15:52:21 -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 99829 invoked by uid 99); 5 Jul 2010 15:52:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jul 2010 15:52:21 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.212.52] (HELO mail-vw0-f52.google.com) (209.85.212.52) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jul 2010 15:52:16 +0000 Received: by vws11 with SMTP id 11so2966181vws.11 for ; Mon, 05 Jul 2010 08:51:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.59.202 with SMTP id m10mr1644190vch.23.1278345113532; Mon, 05 Jul 2010 08:51:53 -0700 (PDT) Received: by 10.220.166.8 with HTTP; Mon, 5 Jul 2010 08:51:53 -0700 (PDT) In-Reply-To: References: <054DFED363B4F541B6CC4DDACD651CAE17FE77@DAEMSG01.eur.ad.sag> Date: Mon, 5 Jul 2010 11:51:53 -0400 Message-ID: Subject: Re: Problems inserting XML document into CouchDB 0.10.2 on CentOS 5.4 From: Cory Zue To: user Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org I also had to store xml documents in couch, and I accomplished this by modifying an xml to json library to support e4x (the xml parser that comes with couch) and using an update handler. I thought you might find it useful: http://gist.github.com/464483 Cory On Sun, Jul 4, 2010 at 4:49 AM, Nils Breunese wrote: > =3D=3D XML =3D=3D > > Remember that CouchDB uses JSON for documents. I think you have three opt= ions here: > > 1. Convert XML to a JSON document > > Instead of storing the XML you mentioned you could maybe transform your X= ML into JSON (not always easy, as attributes and subelements can clash, the= other way around is easier): > > ---- > { > =A0"type": "note", > =A0"to": "Tove", > =A0"from": "Jani", > =A0"heading": "Reminder", > =A0"body": "Don't forget me this weekend!" > } > ---- > > 2. Store the XML as a string field > > I believe this is what you were trying to do. Surround the XML with quote= s and escape any quotes in the XML. I believe most XML libraries have a fun= ction to output XML as a string with all escaping done automatically. > > { > =A0"XML": "ToveJaniReminderDon't forget me this weekend!" > } > > 3. Store the XML as an attachment > > You can store arbitrary files as attachments to CouchDB documents. > > I'd go route 1, as that will allow you to make use of CouchDB's indexing = features, etc. If you just want to store the data, all three options will w= ork. > > =3D=3D curl >=3D7.18 and RHEL/CentOS =3D=3D > > About the curl >=3D7.18 dependency, I don't know why 7.18 exactly, but I'= m sure the dependency version hasn't been changed for no reason. People hav= e built CouchDB 0.11 on RHEL/CentOS 5, but yes, you'll need to install a se= parate curl >=3D7.18 build. You could just install curl from source. Or you= could package curl >=3D 7.18 for installation in a location where it doesn= 't clash with the OS curl package and build CouchDB to find curl >=3D7.18 t= here, or maybe include curl >=3D7.18 in the CouchDB package itself and make= it a selfcontained package. It's not impossible, it's just more work than = when you're able to use the vendor's curl package. > > Nils. > ________________________________________ > Van: Himmelein, Ralf [Ralf.Himmelein@softwareag.com] > Verzonden: dinsdag 29 juni 2010 19:36 > Aan: user@couchdb.apache.org > Onderwerp: Problems inserting XML document into CouchDB 0.10.2 on CentOS = 5.4 > > Hello CouchDB experts, > I am using CouchDB at the moment for a potential large scale implementati= on. I am faced with the problem that I can't > insert a simple XML document into my CouchDB via the Futon interface. > The CouchDB is version 0.10.2 installed on CentOS. The error message that= I get on the UI is that the data I insert is not > a string. > > The document I try to insert looks like this: > > > Tove > Jani > Reminder > Don't forget me this weekend! > > > If I mask the the data with "" I can insert the data, but since I plan to= insert XML documents I can have "" everywhere. > At the moment this is a show stopper and I wonder if there is a special w= ay or procedure on how to store XML data within CouchDB. > > The second question I have is, why is CouchDB 0.11 depended on curl 7.18?= This fact makes building the new CouchDB version impossible > without breaking a lot of things within the CentOS (RHEL 5). Has anyone e= ventually produced a how to for CentOS on how to build CouchDB 0.11 > for CentOS? > > Thanks in advance, > Ralf Himmelein > > De informatie vervat in deze =A0e-mail en meegezonden bijlagen is uitslui= tend bedoeld voor gebruik door de geadresseerde en kan vertrouwelijke infor= matie bevatten. Openbaarmaking, vermenigvuldiging, verspreiding en/of verst= rekking van deze informatie aan derden is voorbehouden aan geadresseerde. D= e VPRO staat niet in voor de juiste en volledige overbrenging van de inhoud= van een verzonden e-mail, noch voor tijdige ontvangst daarvan. >