nodes = document.find('/header') nodes.class == XPath::Object nodes.first nodes.length nodes.each do |node| .. end
And then... node_set = nodes.set node_set.class == XML::Node::Set node.first node.length node.each do |node| .. endSeems better to re-purpose the XML::Node::Set to be used to return a node set when a user calls node.children (which now returns a node, which is fairly weird, although that is how libxml works).
If that doesn't make sense, then it should just be removed. XPath::Object#set could just return itself, calling code would be none the wiser since the API's are identical.
Charlie
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________ libxml-devel mailing list libxml-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/libxml-devel