Compares two namespace objects. Namespace objects are considered equal if their prefixes and hrefs are the same.
# File lib/libxml/namespace.rb, line 13 def <=>(other) if self.prefix.nil? and other.prefix.nil? self.href <=> other.href elsif self.prefix.nil? -1 elsif other.prefix.nil? 1 else self.prefix <=> other.prefix end end
libxml stores namespaces in memory as a linked list. Use the each method to iterate over the list. Note the first namespace in the loop is the current namespace.
Usage:
namespace.each do |ns| .. end
# File lib/libxml/namespace.rb, line 36 def each ns = self while ns yield ns ns = ns.next end end
Generated with the Darkfish Rdoc Generator 2.