class XML::DOM::ProcessingInstruction
Class XML::DOM::ProcessingInstruction
¶ ↑
superclass¶ ↑
class Comment
def getDigest(algorithm = Digest::MD5, force = false) (!force && @digest) || @digest = algorithm.digest([COMMENT_NODE].pack("N") + DOM.tou16(data)).digest end
end
Class XML::DOM::ProcessingInstruction
¶ ↑
superclass¶ ↑
Public Class Methods
new(target = nil, data = nil)
click to toggle source
Class Methods¶ ↑
Calls superclass method
XML::DOM::Node::new
# File lib/xml/dom/core.rb, line 3126 def initialize(target = nil, data = nil) super() raise "parameter error" if !data @target = target.freeze @data = data.freeze @value = target.dup @value << " #{data}" if data != "" @value.freeze end
Public Instance Methods
_getMyLocation(parent)
click to toggle source
# File lib/xml/dom/core.rb, line 3246 def _getMyLocation(parent) index = 1 parent.childNodes do |child| if child == self return "child(#{index},#pi)" end if child.nodeType == PROCESSING_INSTRUCTION_NODE index += 1 end end nil end
_getMyLocationInXPath(parent)
click to toggle source
# File lib/xml/dom2/xpath.rb, line 376 def _getMyLocationInXPath(parent) n = parent.childNodes.to_a.select { |i| i.nodeType == PROCESSING_INSTRUCTION_NODE }.index(self) "processing-instruction()[#{n + 1}]" end
cloneNode(deep = true)
click to toggle source
Calls superclass method
XML::DOM::Node#cloneNode
# File lib/xml/dom/core.rb, line 3266 def cloneNode(deep = true) super(deep, @target.dup, @data.dup) end
data()
click to toggle source
# File lib/xml/dom/core.rb, line 3192 def data @data end
data=(p)
click to toggle source
# File lib/xml/dom/core.rb, line 3203 def data=(p) @data = p.freeze @value = @target.dup @value << " #{@data}" if @data != "" @value.freeze end
dump(depth = 0)
click to toggle source
# File lib/xml/dom/core.rb, line 3241 def dump(depth = 0) print ' ' * depth * 2 print "<?#{@value.inspect}?>\n" end
getDigest(algorithm = Digest::MD5, force = false)
click to toggle source
# File lib/xml/dom/digest.rb, line 51 def getDigest(algorithm = Digest::MD5, force = false) (!force && @digest) || @digest = algorithm.digest([PROCESSING_INSTRUCTION_NODE].pack("N") + DOM.tou16(target) + "\0\0" + DOM.tou16(data)) end
nodeName()
click to toggle source
# File lib/xml/dom/core.rb, line 3156 def nodeName "#proccessing-instruction" end
nodeType()
click to toggle source
nodeValue()
click to toggle source
# File lib/xml/dom/core.rb, line 3218 def nodeValue @value end
target()
click to toggle source
# File lib/xml/dom/core.rb, line 3167 def target @target end
target=(p)
click to toggle source
# File lib/xml/dom/core.rb, line 3178 def target=(p) @target = p.freeze @value = @target.dup @value << " #{@data}" if @data != "" @value.freeze end
to_s()
click to toggle source
# File lib/xml/dom/core.rb, line 3230 def to_s ret = "<?#{@value}?>" ret << "\n" if parentNode.nodeType == DOCUMENT_NODE ret end