Returns whether this attribute has child attributes.
# File lib/libxml/attr.rb, line 12 def child? not self.children.nil? end
Determine whether this attribute is associated with an XML::Document.
# File lib/libxml/attr.rb, line 21 def doc? not self.doc.nil? end
# File lib/libxml/attr.rb, line 96 def each_sibling(&blk) siblings(self,&blk) end
Determine whether this is the last attribute.
# File lib/libxml/attr.rb, line 29 def last? self.last.nil? end
Returns this node’s XML::Namespaces object, which is used to access the namespaces associated with this node.
# File lib/libxml/attr.rb, line 56 def namespaces @namespaces ||= XML::Namespaces.new(self) end
Determine whether there is a next attribute.
# File lib/libxml/attr.rb, line 37 def next? not self.next.nil? end
Returns this node’s type name
# File lib/libxml/attr.rb, line 78 def node_type_name if node_type == Node::ATTRIBUTE_NODE 'attribute' else raise(UnknownType, "Unknown node type: %n", node.node_type); end end
Determine whether this attribute has an associated namespace.
# File lib/libxml/attr.rb, line 46 def ns? not self.ns.nil? end
Determine whether this attribute has a parent.
# File lib/libxml/attr.rb, line 65 def parent? not self.parent.nil? end
Determine whether there is a previous attribute.
# File lib/libxml/attr.rb, line 73 def prev? not self.prev.nil? end
Iterates nodes and attributes
# File lib/libxml/attr.rb, line 87 def siblings(node, &blk) if n = node loop do blk.call(n) break unless n = n.next end end end
# File lib/libxml/attr.rb, line 110 def to_a inject([]) do |ary,a| ary << [a.name, a.value] ary end end
Generated with the Darkfish Rdoc Generator 2.