In preparation for adding support for buffers. The old names are still supported.
When an XPath expression evaluates to a boolean, number or string it gets turned into the corresponding JS value.
XPath expressions like '@attr' evaluate to a nodeset containing attributes. This would sometimes work in libxmljs (when the libxml xmlNode for an attribute already had a _private pointing to a libxmljs attribute wrapper). But in other cases you could end up with a libxmljs element wrapper wrapping a libxmljs xmlAttr. This makes it work in general.
… form for GH-124. Signed-off-by: Nick Campbell <email@example.com>
- constructor function can take an object listing the callbacks (no longer does it provide an argument or require a function) - connect events to the parser using 'on' and other event emitter methods - setCallbacks no longer exists