Class HTML5::TreeWalkers::Hpricot::TreeWalker
In: lib/feed_tools/vendor/html5/lib/html5/treewalkers/hpricot.rb
Parent: HTML5::TreeWalkers::NonRecursiveTreeWalker

Methods

Public Instance methods

[Source]

    # File lib/feed_tools/vendor/html5/lib/html5/treewalkers/hpricot.rb, line 34
34:         def first_child(node)
35:           node.children.first
36:         end

[Source]

    # File lib/feed_tools/vendor/html5/lib/html5/treewalkers/hpricot.rb, line 38
38:         def next_sibling(node)
39:           node.next_node
40:         end

[Source]

    # File lib/feed_tools/vendor/html5/lib/html5/treewalkers/hpricot.rb, line 9
 9:         def node_details(node)
10:           case node
11:           when ::Hpricot::Elem
12:             if node.name.empty?
13:               [:DOCUMENT_FRAGMENT]
14:             else
15:               [:ELEMENT, node.name,
16:                 node.attributes.map {|name, value| [name, value]},
17:                 !node.empty?]
18:             end
19:           when ::Hpricot::Text
20:             [:TEXT, node.content]
21:           when ::Hpricot::Comment
22:             [:COMMENT, node.content]
23:           when ::Hpricot::Doc
24:             [:DOCUMENT]
25:           when ::Hpricot::DocType
26:             [:DOCTYPE, node.target, node.public_id, node.system_id]
27:           when ::Hpricot::XMLDecl
28:             [nil]
29:           else
30:             [:UNKNOWN, node.class.inspect]
31:           end
32:         end

[Source]

    # File lib/feed_tools/vendor/html5/lib/html5/treewalkers/hpricot.rb, line 42
42:         def parent(node)
43:           node.parent
44:         end

[Validate]