11

I've written some code to manipulate an XML document using standard W3C DOM APIs. It works well in the browser environment, and I'd like to get it to work under node.js. Unfortunately, I have not been able to find a working node.js library implementing standard W3C DOM APIs. Here are the libraries I have tried:

I could write a second implementation, using a different API, to perform the same function, but I'd rather find a library that will expose these standard interfaces, so that I can use the same code in both contexts. Is there a working node.js library that implements the W3C DOM API?

2
  • o3-xml worked for me on node 0.4.x. Now that I'm trying it on 0.6.8 it segfaults on parse — github.com/ajaxorg/node-o3-xml/issues/23 Commented Jan 29, 2012 at 0:30
  • BTW there is no win64 binary, I get Error: %1 is not a valid Win32 application: o3-win32.node Commented Sep 1, 2014 at 3:59

2 Answers 2

7

XMLDOM might be a good choice, it's a W3C Standard based DOMParser and XMLSerializer (DOM Level2 CORE)

good luck

Sign up to request clarification or add additional context in comments.

3 Comments

xmldom has no xpath support.
xmldom doesn't support <!ENTITY> declarations.
//xpath2 using xmldom as target document (github.com/jindw/xmldom) github.com/ilinsky/xpath.js , however i would look for libxmljs, it has xpath and xslt is available for it also
4

Cloud9 uses node-o3-xml, but I have had a horrible time with it while developing on a Mac. I talked to some folks in the #nodejs IRC room and the prevaling choice seemed to be libxmljs. I've used that myself and it seems to work well, though it's not the W3C DOM API.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.