Class: HTML5::TreeBuilders::REXML::DocumentType

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

Instance Attribute Summary

Attributes inherited from Node

#rxobj

Attributes inherited from Base::Node

#_flags, #childNodes, #parent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#appendChild, #hasContent, #insertBefore, #insertText, #removeChild

Methods inherited from Base::Node

#appendChild, #cloneNode, #hasContent, #insertBefore, #insertText, #removeChild, #reparentChildren

Constructor Details

#initialize(name, public_id, system_id) ⇒ DocumentType

Returns a new instance of DocumentType.



128
129
130
131
132
133
134
135
136
137
# File 'lib/feed_tools/vendor/html5/lib/html5/treebuilders/rexml.rb', line 128

def initialize name, public_id, system_id
    super(name)
    if public_id
      @rxobj = ::REXML::DocType.new [name, ::REXML::DocType::PUBLIC, public_id, system_id]
    elsif system_id
      @rxobj = ::REXML::DocType.new [name, ::REXML::DocType::SYSTEM, nil, system_id]
    else
      @rxobj = ::REXML::DocType.new name
    end
end

Class Method Details

.rxclassObject



124
125
126
# File 'lib/feed_tools/vendor/html5/lib/html5/treebuilders/rexml.rb', line 124

def self.rxclass
  ::REXML::DocType
end

Instance Method Details

#printTree(indent = 0) ⇒ Object



139
140
141
# File 'lib/feed_tools/vendor/html5/lib/html5/treebuilders/rexml.rb', line 139

def printTree indent=0
  "\n|#{' ' * indent}<!DOCTYPE #{name}>"
end