Module Erubis::XmlHelper
In: erubis/helper.rb

helper for xml

Methods

escape_xml   h   html_escape  

Constants

ESCAPE_TABLE = { '&' => '&amp;', '<' => '&lt;', '>' => '&gt;', '"' => '&quot;', "'" => '&#039;', }

Public Instance methods

[Source]

# File erubis/helper.rb, line 25
    def escape_xml(obj)
      #table = ESCAPE_TABLE
      #obj.to_s.gsub(/[&<>"]/) { |s| table[s] }    # or /[&<>"']/
      obj.to_s.gsub(/[&<>"]/) { |s| ESCAPE_TABLE[s] }   # or /[&<>"']/
      #obj.to_s.gsub(SCAN_REGEXP) { |s| ESCAPE_TABLE[s] }
      #obj.to_s.gsub(/[&<>"]/) { ESCAPE_TABLE[$&] }
    end
h(obj)

Alias for escape_xml

html_escape(obj)

Alias for escape_xml

[Validate]