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

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

Instance Attribute Summary

Attributes inherited from Base::TreeBuilder

#activeFormattingElements, #document, #formPointer, #head_pointer, #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_from_table=, #reconstructActiveFormattingElements, #reset

Constructor Details

#initializeTreeBuilder

Returns a new instance of TreeBuilder.



180
181
182
183
184
185
186
# File 'lib/feed_tools/vendor/html5/lib/html5/treebuilders/rexml.rb', line 180

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

Instance Method Details

#get_documentObject



197
198
199
# File 'lib/feed_tools/vendor/html5/lib/html5/treebuilders/rexml.rb', line 197

def get_document
  @document.rxobj
end

#get_fragmentObject



201
202
203
204
# File 'lib/feed_tools/vendor/html5/lib/html5/treebuilders/rexml.rb', line 201

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

#insertDoctype(name, public_id, system_id) ⇒ Object



188
189
190
191
# File 'lib/feed_tools/vendor/html5/lib/html5/treebuilders/rexml.rb', line 188

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

#testSerializer(node) ⇒ Object



193
194
195
# File 'lib/feed_tools/vendor/html5/lib/html5/treebuilders/rexml.rb', line 193

def testSerializer node
  node.printTree
end