Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

libxml bindings for v8 javascript engine

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 docs
Octocat-spinner-32 experiments
Octocat-spinner-32 spec
Octocat-spinner-32 src
Octocat-spinner-32 tools
Octocat-spinner-32 .gitignore
Octocat-spinner-32 CHANGELOG
Octocat-spinner-32 LICENSE
Octocat-spinner-32 Makefile
Octocat-spinner-32 README.md
Octocat-spinner-32 SConstruct
Octocat-spinner-32 package.json
README.md

Libxmljs

LibXML bindings for node.js

var libxmljs = require("libxmljs");
var xml =  '<?xml version="1.0" encoding="UTF-8"?>' +
           '<root>' +
               '<child foo="bar">' +
                   '<grandchild baz="fizbuzz">grandchild content</grandchild>' +
               '</child>' +
               '<sibling>with content!</sibling>' +
           '</root>';

var xmlDoc = libxmljs.parseXmlString(xml);

// xpath queries
var gchild = xmlDoc.get('//grandchild');

console.log(gchild.text());  // prints "grandchild content"

var children = xmlDoc.root().childNodes();
var child = children[0];

console.log(child.attr('foo').value()); // prints "bar"

Basics

API and Examples

Check out the wiki http://github.com/polotek/libxmljs/wiki

Requirements

pre-conditions

You will need have the libxml2 library installed and also the libxml2-devel package. This comes with the xml2-config utility that is needed for compiling. This command must be in your path.

The scons command is used for building and must also be in your path.

Installation

npm npm install libxmljs

source

In the root of the source directory, just run make. This will generate the binary libxmljs.node in the root of the source folder. You can copy this file to ~/.node_libraries or any other directory in your require path.

tests

make test

make test-verbose
Something went wrong with that request. Please try again.