Parent

Methods

Included Modules

LibXML::XML::Namespace

Public Instance Methods

namespace1 <=> namespace2 click to toggle source

Compares two namespace objects. Namespace objects are considered equal if their prefixes and hrefs are the same.

    # File lib/libxml/namespace.rb, line 14
14:       def <=>(other)
15:         if self.prefix.nil? and other.prefix.nil?
16:           self.href <=> other.href
17:         elsif self.prefix.nil?
18:           1
19:         elsif other.prefix.nil?
20:           1
21:         else
22:           self.prefix <=> other.prefix
23:         end
24:       end
} click to toggle source

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 37
37:       def each
38:         ns = self
39: 
40:         while ns
41:           yield ns
42:           ns = ns.next
43:         end
44:       end
to_s → "string" click to toggle source

Returns the string represenation of a namespace.

Usage:

  namespace.to_s
    # File lib/libxml/namespace.rb, line 53
53:       def to_s
54:         if self.prefix
55:           "#{self.prefix}:#{self.href}"
56:         else
57:           self.href
58:         end
59:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.