# File lib/xml_helper.rb, line 5 def XmlHelper.escape_xml_attribute_values(string_to_escape,for_data_url) escaped_str= string_to_escape # In case of inline xml, we need to escape the single quotes if for_data_url==false escaped_str = escaped_str.gsub(%r{'},'%26apos;'); end # Common Replacements # In Ruby On Rails, the builder automatically escapes < , >, % # Hence these replacements are not required #We've not considered any special characters here. #You can add them as per your language and requirements. return escaped_str end