incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luciano Ramalho <luci...@ramalho.org>
Subject Re: XPath in CouchDB?
Date Tue, 07 Dec 2010 13:32:49 GMT
On Mon, Dec 6, 2010 at 6:24 PM, Taras Puchko <taras.puchko@gmail.com> wrote:
> I have to return a part of an XML blob from my list function based on
> a dynamic XPath expression. I'm trying to follow
> https://developer.mozilla.org/en/Introduction_to_using_XPath_in_JavaScript.
>
> But when I create a DOMParser in any way described in
> https://developer.mozilla.org/en/DOMParser I always get "DOMParser is
> not defined" or "Components is not defined".
>
> Does anyone know any other way to apply XPath expression to an XML
> blob in CouchDB show or list functions?

We can't "require" functions in map/reduce functions, and the
JavaScript environment embedded in CouchDB does not have all the libs
available in a Mozilla browser.

Currently, the CouchDB docs have almost nothing to say about what is
available in the embedded JavaScript. If it was Python or Ruby, it
would be easy to introspect and find out, but unfortunately JavaScript
introspection sucks.

Can any of the gurus post pointers to the source code where perhaps we
could find out which functions are available for use from JavaScript?

Cheers,

-- 
Luciano Ramalho
programador repentista || stand-up programmer
Twitter: @luciano

Mime
View raw message