Class: HTML5::TreeBuilders::REXML::Document
- Inherits:
-
Node
- Object
- Base::Node
- Node
- HTML5::TreeBuilders::REXML::Document
- Defined in:
- lib/html5/treebuilders/rexml.rb
Instance Attribute Summary
Attributes inherited from Node
Attributes inherited from Base::Node
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Document
constructor
A new instance of Document.
-
#printTree(indent = 0) ⇒ Object
ryansking: not sure why this was here.
Methods inherited from Node
#appendChild, #hasContent, #insertBefore, #insertText, #removeChild
Methods inherited from Base::Node
#appendChild, #cloneNode, #hasContent, #insertBefore, #insertText, #removeChild, #reparentChildren
Constructor Details
#initialize ⇒ Document
Returns a new instance of Document.
100 101 102 |
# File 'lib/html5/treebuilders/rexml.rb', line 100 def initialize super nil end |
Class Method Details
.rxclass ⇒ Object
96 97 98 |
# File 'lib/html5/treebuilders/rexml.rb', line 96 def self.rxclass ::REXML::Document end |
Instance Method Details
#printTree(indent = 0) ⇒ Object
ryansking: not sure why this was here. removing it doesn’t cause any tests to fail def appendChild node
if node.kind_of? Element and node.name == 'html'
node.rxobj.add_namespace('http://www.w3.org/1999/xhtml')
end
super node
end
112 113 114 115 116 117 118 |
# File 'lib/html5/treebuilders/rexml.rb', line 112 def printTree indent=0 tree = "#document" for child in childNodes tree += child.printTree(indent + 2) end return tree end |