You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Nitin Borwankar <ni...@borwankar.com> on 2009/09/04 02:31:15 UTC

e4x, xml and json

If an xml document is imported into a Couchdb database via e4x in the 
middle of the forest does anyone hear it scream?

No, but more seriously:

If an xml document is imported into couchdb via built in e4x support in 
spidermonkey then

a) is it browsable as a  JS document in futon?  Else  futon shows it as 
...??
b) is it queriable in a view over a collection of documents that has 
both XML origin docs and json origin docs ?

I guess my overarching question is does the internal representation of a 
doc in couch have any memory of the format it came in as?  Or is it true 
that once the data is in couch - it is indistinguishable as to it's 
origin format - and all these data items can be rendered as JSON by 
querying over them uniformly, with no regard to origin format.
I suspect the latter but I haven't spent any time (= my ample spare time 
is not that ample) looking at the btree code to  answer this question 
for myself.

Thanks for helping,

Nitin

Re: e4x, xml and json

Posted by Benoit Chesneau <bc...@gmail.com>.
On Fri, Sep 4, 2009 at 2:45 AM, Nitin Borwankar<ni...@borwankar.com> wrote:
> Paul Davis wrote:
>>>
>>> If an xml document is imported into couchdb via built in e4x support in
>>> spidermonkey then
>>>
>>
>> I don't understand how you would import a document via e4x when that
>> doesn't exist on the front side of CouchDB.
>>
>> Paul
>>
>
> Ahh! stupid question.  Misunderstanding of where e4x fits.
> As I see it now - blindingly obvious (thanks Paul) - no XML api on the way
> in.
>
> OK, so I will need to convert XML to JSON before saving to Couch and then
> query via views to emit JSON
> ( I don't want to emit XML anyway ).
>
> Thanks much,
> And allow me to retreat back to the middle of the forest,
>
> Nitin
>

You could eventually fit a doc with xml via _update I guess.

- benoît

Re: e4x, xml and json

Posted by Nitin Borwankar <ni...@borwankar.com>.
Paul Davis wrote:
>> If an xml document is imported into couchdb via built in e4x support in
>> spidermonkey then
>>     
>
> I don't understand how you would import a document via e4x when that
> doesn't exist on the front side of CouchDB.
>
> Paul
>   
Ahh! stupid question.  Misunderstanding of where e4x fits.
As I see it now - blindingly obvious (thanks Paul) - no XML api on the 
way in.

OK, so I will need to convert XML to JSON before saving to Couch and 
then query via views to emit JSON
 ( I don't want to emit XML anyway ).

Thanks much,
 And allow me to retreat back to the middle of the forest,

Nitin

Re: e4x, xml and json

Posted by Paul Davis <pa...@gmail.com>.
> If an xml document is imported into couchdb via built in e4x support in
> spidermonkey then

I don't understand how you would import a document via e4x when that
doesn't exist on the front side of CouchDB.

Paul