polotek/libxmljs — Issue #87: Issue with new libxml.Document()
Author: halimali
Created: 2011-11-29 03:12:19+00:00
State: open

Hi before I continue on the issues faced, take note that I am using @shtylman repos as I need libxmljs to work with node.js 0.6.1. I am unable to create an issue at his repo and hence I open a ticket here.
The repo URL is as follows:https://github.com/shtylman/libxmljs.

I am using the below code snippet which is similar to https://github.com/polotek/libxmljs/wiki

trysend = function(){

var doc = new libxmljs.Document();
doc.node('root')
.node('child', {foo: 'bar'})
.node('grandchild', {baz: 'fizbuzz'}, 'grandchild content')
.parent()
.parent()
.node('sibling', 'with content!');

console.log(doc);
}

However it is generating the errors which I don't understand since I am following the wiki.
var doc = new libxmljs.Document();
^
TypeError: object is not a function
at Object.CALL_NON_FUNCTION_AS_CONSTRUCTOR (native)

I already have included var libxmljs = require("libxmljs");
outside the trysend function.