class XML::DOM::DocumentType
Class XML::DOM::DocumentType
¶ ↑
superclass¶ ↑
Class XML::DOM::DocumentType
¶ ↑
superclass¶ ↑
Public Class Methods
Source
# File lib/xml/dom/core.rb, line 2747 def initialize(name, value = nil, *children) super(*children) raise "parameter error" if !name @name = name.freeze @value = value.freeze end
Class Methods¶ ↑
Calls superclass method
XML::DOM::Node::new
Public Instance Methods
Source
# File lib/xml/dom/core.rb, line 2831 def cloneNode(deep = true) super(deep, @name, @value) end
Calls superclass method
XML::DOM::Node#cloneNode
Source
# File lib/xml/dom/core.rb, line 2808 def dump(depth = 0) print ' ' * depth * 2 print "<!DOCTYPE #{@name} #{@value} [\n" @children.each do |child| print ' ' * (depth + 1) * 2 if child.nodeType == PROCESSING_INSTRUCTION_NODE || child.nodeType == COMMENT_NODE child.dump else print child.nodeValue, "\n" end end if @children print ' ' * depth * 2 print "]>\n" end
Source
Source
# File lib/xml/dom/core.rb, line 2783 def to_s ret = "<!DOCTYPE " + @name if !@value.nil? ret <<= " " + @value end if !@children.nil? && @children.length > 0 ret <<= " [\n" @children.each do |child| if child.nodeType == PROCESSING_INSTRUCTION_NODE || child.nodeType == COMMENT_NODE ret <<= child.to_s + "\n" else ret <<= child.nodeValue + "\n" end end ret <<= "]" end ret <<= ">" end