moovweb/gokogiri

Make xml.Nodeset relevant

jbowtie opened this issue · 1 comments

The current implementation of NodeSet ( see xml/nodeset.go ) appears to be unused, and frankly it doesn't appear to be provide any useful functionality.

I propose this be changed to:

type Nodeset []Node

This can then be extended with some useful functionality. Specifically, I'd add functions to convert to and from a collection of unsafe.Pointer, a C.xmlXPathNodeSet structure, and a C.xmlXPathResultValueTree (which is a nodeset with an extra bit set for libxml).

We can then eliminate some duplicate code internally and simplify some type switches by using a Nodeset. I'd prefer to update the method signatures where appropriate but have no issue with us leaving those as is.

The current implementation does indeed seem to be unused. I wouldn't be opposed to this change. 👍