Support other result types of evaluating XPath expressions #142

merged 2 commits into from Jul 6, 2012


None yet
4 participants

dpw commented Jul 5, 2012

libxmljs only reliably supported evaluation of XPath expressions that yielded nodesets of element. These two commits add support for nodesets with attributes and expressions yielding non-nodeset values.

David Wragg added some commits Jul 5, 2012

David Wragg Support XPath expressions that yield attributes
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
David Wragg Support XPath expressions that don't yield nodesets
When an XPath expression evaluates to a boolean, number or string
it gets turned into the corresponding JS value.

This pull request passes (merged 3ec6790 into 7bddc0d).


ncb000gt commented Jul 5, 2012



polotek commented Jul 6, 2012

Me too. Let's land it.

@ncb000gt ncb000gt added a commit that referenced this pull request Jul 6, 2012

@ncb000gt ncb000gt Merge pull request #142 from dpw/xpath-results
Support other result types of evaluating XPath expressions

@ncb000gt ncb000gt merged commit f4707b5 into libxmljs:master Jul 6, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment