troelskn / handsoap

Handsoap is a library for creating SOAP clients in Ruby
http://github.com/unwire/handsoap
151 stars 2 forks source link

XmlMason: CDATA values shouldnt be escaped #1

Closed ghost closed 15 years ago

ghost commented 15 years ago

Contents of statements like his souldnt be encoded:

element.set_value("<[[CDATA[bla]]>")

It would be great If there was a way to prevent it.

A quick workaround could look like this:

module Common class NonEscapingString < String def gsub(arg) self end

 def to_s
   self
 end

end end

Just wrap code that shouldn't be escaped with a NonEscapingString class. Not very beautiful.

troelskn commented 15 years ago

You can now use the :raw option to add raw xml. Eg.:

element.set_value "<[[CDATA[bla]]>", :raw