Method: XML::DOM::Text#to_s

Defined in:
lib/xml/dom/core.rb,
lib/xml/dom2/text.rb

#to_sObject

--- Text#to_s

return the string representation of the Text.



2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
# File 'lib/xml/dom/core.rb', line 2494

def to_s
  ret = ""
  @value.each_byte do |code|
    case (code)
    when 13
      ret << sprintf("&#x%X;", code)
    when ?&
      ret << "&amp;"
    when ?<
      ret << "&lt;"
    when ?>
      ret << "&gt;"
    else
      ret << code
    end
  end
  ret
end