Class: HTML5::TreeBuilders::REXML::TreeBuilder

Inherits:
Base::TreeBuilder show all
Defined in:
lib/html5/treebuilders/rexml.rb

Instance Attribute Summary

Attributes inherited from Base::TreeBuilder

#activeFormattingElements, #document, #formPointer, #head_pointer, #insert_from_table, #open_elements

Instance Method Summary collapse

Methods inherited from Base::TreeBuilder

#clearActiveFormattingElements, #createElement, #elementInActiveFormattingElements, #elementInScope, #generateImpliedEndTags, #getTableMisnestedNodePosition, #insertText, #insert_comment, #insert_element, #insert_elementNormal, #insert_elementTable, #insert_foreign_element, #reconstructActiveFormattingElements, #reset

Constructor Details

#initializeTreeBuilder

Returns a new instance of TreeBuilder.



186
187
188
189
190
191
192
# File 'lib/html5/treebuilders/rexml.rb', line 186

def initialize
  @documentClass = Document
  @doctypeClass  = DocumentType
  @elementClass  = Element
  @commentClass  = CommentNode
  @fragmentClass = DocumentFragment
end

Instance Method Details

#get_documentObject



203
204
205
# File 'lib/html5/treebuilders/rexml.rb', line 203

def get_document
  @document.rxobj
end

#get_fragmentObject



207
208
209
210
# File 'lib/html5/treebuilders/rexml.rb', line 207

def get_fragment
  @document = super
  return @document.rxobj.children
end

#insertDoctype(name, public_id, system_id) ⇒ Object



194
195
196
197
# File 'lib/html5/treebuilders/rexml.rb', line 194

def insertDoctype(name, public_id, system_id)
  doctype = @doctypeClass.new(name, public_id, system_id)
  @document.appendChild(doctype)
end

#testSerializer(node) ⇒ Object



199
200
201
# File 'lib/html5/treebuilders/rexml.rb', line 199

def testSerializer node
  node.printTree
end