incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Copenhaver <>
Subject Re: Parsing HTML in CouchApp show functions?
Date Tue, 21 Jun 2011 12:10:51 GMT
You should keep in mind that CouchDB is not a browser and JavaScript is just
a language with really no notion of a standard library. The browser hosts
the DOM and JavaScript, so you use JavaScript to interact with the DOM.

CouchDB does not come with a DOM or HTML parser library. You can still use
CommonJS modules and require them in your functions if you find a good
library. Hopefully someone can suggest one as I do not know.

I would say that it seems odd to me you would want to store the actual HTML
in CouchDB and not just the data. Then use shows to render the data into the
format of choice. Of course I have no idea what your situation is.

On Fri, Jun 17, 2011 at 2:01 PM, Greg Johnston <>wrote:

> Hi all,
> I'm trying to transform some HTML I have stored in a CouchDB document
> to another format. It's actually pretty simple to do, really just
> looping over the DOM. Normally I'd start out with something like:
> var div = document.createElement("div");
> div.innerHTML = [...]
> ...and be ready to go. Unfortunately it looks like "document" is
> undefined in the show function. Am I doing something stupid here, is
> there a better way, or does anyone have other suggestions?
> Thanks,
> Greg Johnston

“The limits of language are the limits of one's world. “ -Ludwig von

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message